Skip to content

Commit

Permalink
Finish scoped_array<T> to scoped_ptr<T[]> conversion on Linux.
Browse files Browse the repository at this point in the history
There are only a few instances left in the Linux build, so lumping
them all into one patch.

BUG=171111

Review URL: https://codereview.chromium.org/13916003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193134 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dcheng@chromium.org committed Apr 9, 2013
1 parent 1427cd5 commit e832895
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions components/autofill/browser/autofill_country.cc
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ class CountryNames {
// the |buffer| is resized.
const std::string GetSortKey(const icu::Collator& collator,
const string16& str,
scoped_array<uint8_t>* buffer,
scoped_ptr<uint8_t[]>* buffer,
int32_t* buffer_size) const;

// Maps from common country names, including 2- and 3-letter country codes,
Expand Down Expand Up @@ -954,7 +954,7 @@ void CountryNames::AddLocalizedNamesForLocale(const std::string& locale) {
std::map<std::string, std::string> localized_names;
const icu::Collator* collator = GetCollatorForLocale(locale);
int32_t buffer_size = 1000;
scoped_array<uint8_t> buffer(new uint8_t[buffer_size]);
scoped_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]);

for (CountryDataMap::Iterator it = CountryDataMap::Begin();
it != CountryDataMap::End();
Expand Down Expand Up @@ -984,7 +984,7 @@ const std::string CountryNames::GetCountryCodeForLocalizedName(
// source string length.
// [1] http://userguide.icu-project.org/collation/api#TOC-Examples
int32_t buffer_size = country_name.size() * 4;
scoped_array<uint8_t> buffer(new uint8_t[buffer_size]);
scoped_ptr<uint8_t[]> buffer(new uint8_t[buffer_size]);
std::string sort_key = GetSortKey(*collator,
country_name,
&buffer,
Expand Down Expand Up @@ -1021,7 +1021,7 @@ icu::Collator* CountryNames::GetCollatorForLocale(const std::string& locale) {

const std::string CountryNames::GetSortKey(const icu::Collator& collator,
const string16& str,
scoped_array<uint8_t>* buffer,
scoped_ptr<uint8_t[]>* buffer,
int32_t* buffer_size) const {
DCHECK(buffer);
DCHECK(buffer_size);
Expand Down
2 changes: 1 addition & 1 deletion courgette/assembly_program.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class AssemblyProgram {

// Sharing instructions that emit a single byte saves a lot of space.
Instruction* GetByteInstruction(uint8 byte);
scoped_array<Instruction*> byte_instruction_cache_;
scoped_ptr<Instruction*[]> byte_instruction_cache_;

uint64 image_base_; // Desired or mandated base address of image.

Expand Down
2 changes: 1 addition & 1 deletion crypto/hmac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bool HMAC::VerifyTruncated(const base::StringPiece& data,
if (digest.empty())
return false;
size_t digest_length = DigestLength();
scoped_array<unsigned char> computed_digest(
scoped_ptr<unsigned char[]> computed_digest(
new unsigned char[digest_length]);
if (!Sign(data, computed_digest.get(), digest_length))
return false;
Expand Down
2 changes: 1 addition & 1 deletion crypto/nss_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static const base::FilePath::CharType kReadOnlyCertDB[] =
std::string GetNSSErrorMessage() {
std::string result;
if (PR_GetErrorTextLength()) {
scoped_array<char> error_text(new char[PR_GetErrorTextLength() + 1]);
scoped_ptr<char[]> error_text(new char[PR_GetErrorTextLength() + 1]);
PRInt32 copied = PR_GetErrorText(error_text.get());
result = std::string(error_text.get(), copied);
} else {
Expand Down
2 changes: 1 addition & 1 deletion jingle/glue/chrome_async_socket_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class ChromeAsyncSocketTest

std::string DrainRead(size_t buf_size) {
std::string read;
scoped_array<char> buf(new char[buf_size]);
scoped_ptr<char[]> buf(new char[buf_size]);
size_t len_read;
while (true) {
bool success =
Expand Down
2 changes: 1 addition & 1 deletion ppapi/proxy/device_enumeration_resource_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void DeviceEnumerationResourceHelper::OnPluginMsgNotifyDeviceChange(

CHECK(monitor_callback_.get());

scoped_array<PP_Resource> elements;
scoped_ptr<PP_Resource[]> elements;
uint32_t size = devices.size();
if (size > 0) {
elements.reset(new PP_Resource[size]);
Expand Down
2 changes: 1 addition & 1 deletion ppapi/proxy/video_capture_resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void VideoCaptureResource::OnPluginMsgOnDeviceInfo(

PluginResourceTracker* tracker =
PluginGlobals::Get()->plugin_resource_tracker();
scoped_array<PP_Resource> resources(new PP_Resource[buffers.size()]);
scoped_ptr<PP_Resource[]> resources(new PP_Resource[buffers.size()]);
for (size_t i = 0; i < buffers.size(); ++i) {
// We assume that the browser created a new set of resources.
DCHECK(!tracker->PluginResourceForHostResource(buffers[i]));
Expand Down
2 changes: 1 addition & 1 deletion ppapi/shared_impl/ppb_audio_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class PPAPI_SHARED_EXPORT PPB_Audio_Shared

// Internal buffer for client's integer audio data.
int client_buffer_size_bytes_;
scoped_array<uint8_t> client_buffer_;
scoped_ptr<uint8_t[]> client_buffer_;

DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Shared);
};
Expand Down
2 changes: 1 addition & 1 deletion ppapi/shared_impl/ppb_device_ref_shared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ PP_Resource PPB_DeviceRef_Shared::CreateResourceArray(
ResourceObjectType type,
PP_Instance instance,
const std::vector<DeviceRefData>& devices) {
scoped_array<PP_Resource> elements;
scoped_ptr<PP_Resource[]> elements;
size_t size = devices.size();
if (size > 0) {
elements.reset(new PP_Resource[size]);
Expand Down
2 changes: 1 addition & 1 deletion ppapi/thunk/ppb_flash_clipboard_thunk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int32_t WriteData_4_0(PP_Instance instance,
uint32_t data_item_count,
const PP_Flash_Clipboard_Format formats[],
const PP_Var data_items[]) {
scoped_array<uint32_t> new_formats(new uint32_t[data_item_count]);
scoped_ptr<uint32_t[]> new_formats(new uint32_t[data_item_count]);
for (uint32_t i = 0; i < data_item_count; ++i)
new_formats[i] = static_cast<uint32_t>(formats[i]);
return WriteData(instance, clipboard_type, data_item_count,
Expand Down
2 changes: 1 addition & 1 deletion tools/imagediff/image_diff.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Image {
if (byte_length == 0)
return false;

scoped_array<unsigned char> source(new unsigned char[byte_length]);
scoped_ptr<unsigned char[]> source(new unsigned char[byte_length]);
if (fread(source.get(), 1, byte_length, stdin) != byte_length)
return false;

Expand Down

0 comments on commit e832895

Please sign in to comment.