summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-11 20:25:46 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-11 20:25:46 +0000
commita1ba58ad06bed1452be605b5c2c01a203adea13e (patch)
treeb00adadd92c07ac92d7d1b7b758e93ce22ea2988
parent84efa823aece2b561dbd2764e06aa7ea618f1b81 (diff)
downloadchromium_src-a1ba58ad06bed1452be605b5c2c01a203adea13e.zip
chromium_src-a1ba58ad06bed1452be605b5c2c01a203adea13e.tar.gz
chromium_src-a1ba58ad06bed1452be605b5c2c01a203adea13e.tar.bz2
Rewrite scoped_array<T> to scoped_ptr<T[]> in chrome.
This is a manual cleanup pass using sed for files which are not built on Linux. BUG=171111 Review URL: https://chromiumcodereview.appspot.com/14114006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193728 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/enumerate_modules_model_win.cc2
-rw-r--r--chrome/browser/extensions/api/system_info_cpu/cpu_info_provider_win.cc2
-rw-r--r--chrome/browser/net/service_providers_win.cc4
-rw-r--r--chrome/browser/policy/policy_path_parser_win.cc4
-rw-r--r--chrome/browser/rlz/rlz_extension_api.cc2
-rw-r--r--chrome/browser/rlz/rlz_extension_api.h2
-rw-r--r--chrome/browser/ui/libgtk2ui/gtk2_util.cc2
-rw-r--r--chrome/browser/ui/pdf/pdf_browsertest.cc2
-rw-r--r--chrome/browser/ui/screen_capture_notification_ui_win.cc2
-rw-r--r--chrome/browser/ui/views/external_tab_container_win.cc2
-rw-r--r--chrome/installer/setup/setup_util_unittest.cc4
-rw-r--r--chrome/installer/util/delete_tree_work_item.h4
-rw-r--r--chrome/installer/util/l10n_string_util.cc2
-rw-r--r--chrome/service/cloud_print/print_system_win.cc2
14 files changed, 18 insertions, 18 deletions
diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc
index b6818de..3569b10 100644
--- a/chrome/browser/enumerate_modules_model_win.cc
+++ b/chrome/browser/enumerate_modules_model_win.cc
@@ -713,7 +713,7 @@ string16 ModuleEnumerator::GetSubjectNameFromDigitalSignature(
return string16();
// Allocate enough space to hold the signer info.
- scoped_array<BYTE> signer_info_buffer(new BYTE[signer_info_size]);
+ scoped_ptr<BYTE[]> signer_info_buffer(new BYTE[signer_info_size]);
CMSG_SIGNER_INFO* signer_info =
reinterpret_cast<CMSG_SIGNER_INFO*>(signer_info_buffer.get());
diff --git a/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider_win.cc b/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider_win.cc
index fad3baf..141923f 100644
--- a/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider_win.cc
+++ b/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider_win.cc
@@ -36,7 +36,7 @@ bool CpuInfoProvider::QueryCpuTimePerProcessor(std::vector<CpuTime>* times) {
CHECK(NtQuerySystemInformation != NULL);
int num_of_processors = base::SysInfo::NumberOfProcessors();
- scoped_array<SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION> processor_info(
+ scoped_ptr<SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION[]> processor_info(
new SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION[num_of_processors]);
ULONG returned_bytes = 0, bytes =
diff --git a/chrome/browser/net/service_providers_win.cc b/chrome/browser/net/service_providers_win.cc
index e6f6944..a20534e 100644
--- a/chrome/browser/net/service_providers_win.cc
+++ b/chrome/browser/net/service_providers_win.cc
@@ -23,7 +23,7 @@ void GetWinsockNamespaceProviders(
return;
}
- scoped_array<char> namespace_provider_bytes(new char[size]);
+ scoped_ptr<char[]> namespace_provider_bytes(new char[size]);
WSANAMESPACE_INFO* namespace_providers =
reinterpret_cast<WSANAMESPACE_INFO*>(namespace_provider_bytes.get());
@@ -58,7 +58,7 @@ void GetWinsockLayeredServiceProviders(
return;
}
- scoped_array<char> service_provider_bytes(new char[size]);
+ scoped_ptr<char[]> service_provider_bytes(new char[size]);
WSAPROTOCOL_INFOW* service_providers =
reinterpret_cast<WSAPROTOCOL_INFOW*>(service_provider_bytes.get());
diff --git a/chrome/browser/policy/policy_path_parser_win.cc b/chrome/browser/policy/policy_path_parser_win.cc
index bba3873..b8216bc 100644
--- a/chrome/browser/policy/policy_path_parser_win.cc
+++ b/chrome/browser/policy/policy_path_parser_win.cc
@@ -98,7 +98,7 @@ base::FilePath::StringType ExpandPathVariables(
DWORD return_length = 0;
::GetUserName(NULL, &return_length);
if (return_length != 0) {
- scoped_array<WCHAR> username(new WCHAR[return_length]);
+ scoped_ptr<WCHAR[]> username(new WCHAR[return_length]);
::GetUserName(username.get(), &return_length);
std::wstring username_string(username.get());
result.replace(position, wcslen(kUserNamePolicyVarName), username_string);
@@ -109,7 +109,7 @@ base::FilePath::StringType ExpandPathVariables(
DWORD return_length = 0;
::GetComputerNameEx(ComputerNamePhysicalDnsHostname, NULL, &return_length);
if (return_length != 0) {
- scoped_array<WCHAR> machinename(new WCHAR[return_length]);
+ scoped_ptr<WCHAR[]> machinename(new WCHAR[return_length]);
::GetComputerNameEx(ComputerNamePhysicalDnsHostname,
machinename.get(), &return_length);
std::wstring machinename_string(machinename.get());
diff --git a/chrome/browser/rlz/rlz_extension_api.cc b/chrome/browser/rlz/rlz_extension_api.cc
index e61c8fd..7447ce7 100644
--- a/chrome/browser/rlz/rlz_extension_api.cc
+++ b/chrome/browser/rlz/rlz_extension_api.cc
@@ -212,7 +212,7 @@ bool RlzClearProductStateFunction::RunImpl() {
// Allocate an access point array to pass to ClearProductState(). The array
// must be termindated with the value rlz_lib::NO_ACCESS_POINT, hence + 1
// when allocating the array.
- scoped_array<rlz_lib::AccessPoint> access_points(
+ scoped_ptr<rlz_lib::AccessPoint[]> access_points(
new rlz_lib::AccessPoint[access_points_list->GetSize() + 1]);
size_t i;
diff --git a/chrome/browser/rlz/rlz_extension_api.h b/chrome/browser/rlz/rlz_extension_api.h
index e10521b..a077e59 100644
--- a/chrome/browser/rlz/rlz_extension_api.h
+++ b/chrome/browser/rlz/rlz_extension_api.h
@@ -56,7 +56,7 @@ class RlzSendFinancialPingFunction : public AsyncExtensionFunction {
void RespondOnUIThread();
rlz_lib::Product product_;
- scoped_array<rlz_lib::AccessPoint> access_points_;
+ scoped_ptr<rlz_lib::AccessPoint[]> access_points_;
std::string signature_;
std::string brand_;
std::string id_;
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_util.cc b/chrome/browser/ui/libgtk2ui/gtk2_util.cc
index a28c746..ce542f6 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_util.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_util.cc
@@ -20,7 +20,7 @@ void CommonInitFromCommandLine(const CommandLine& command_line,
void (*init_func)(gint*, gchar***)) {
const std::vector<std::string>& args = command_line.argv();
int argc = args.size();
- scoped_array<char *> argv(new char *[argc + 1]);
+ scoped_ptr<char *[]> argv(new char *[argc + 1]);
for (size_t i = 0; i < args.size(); ++i) {
// TODO(piman@google.com): can gtk_init modify argv? Just being safe
// here.
diff --git a/chrome/browser/ui/pdf/pdf_browsertest.cc b/chrome/browser/ui/pdf/pdf_browsertest.cc
index 2316dd2..ad2dd08 100644
--- a/chrome/browser/ui/pdf/pdf_browsertest.cc
+++ b/chrome/browser/ui/pdf/pdf_browsertest.cc
@@ -130,7 +130,7 @@ class PDFBrowserTest : public InProcessBrowserTest,
base::PlatformFileInfo info;
ASSERT_TRUE(file_util::GetFileInfo(reference, &info));
int size = static_cast<size_t>(info.size);
- scoped_array<char> data(new char[size]);
+ scoped_ptr<char[]> data(new char[size]);
ASSERT_EQ(size, file_util::ReadFile(reference, data.get(), size));
int w, h;
diff --git a/chrome/browser/ui/screen_capture_notification_ui_win.cc b/chrome/browser/ui/screen_capture_notification_ui_win.cc
index 9b5dee9..f339cd0 100644
--- a/chrome/browser/ui/screen_capture_notification_ui_win.cc
+++ b/chrome/browser/ui/screen_capture_notification_ui_win.cc
@@ -214,7 +214,7 @@ bool ScreenCaptureNotificationUIWin::BeginDialog(const string16& title) {
// The actual resource type is DLGTEMPLATEEX, but this is not defined in any
// standard headers, so we treat it as a generic pointer and manipulate the
// correct offsets explicitly.
- scoped_array<unsigned char> rtl_dialog_template;
+ scoped_ptr<unsigned char[]> rtl_dialog_template;
if (base::i18n::IsRTL()) {
unsigned long dialog_template_size =
SizeofResource(module, dialog_resource);
diff --git a/chrome/browser/ui/views/external_tab_container_win.cc b/chrome/browser/ui/views/external_tab_container_win.cc
index 6a22fce..737da58 100644
--- a/chrome/browser/ui/views/external_tab_container_win.cc
+++ b/chrome/browser/ui/views/external_tab_container_win.cc
@@ -1158,7 +1158,7 @@ void ExternalTabContainerWin::LoadAccelerators() {
return;
}
- scoped_array<ACCEL> scoped_accelerators(new ACCEL[count]);
+ scoped_ptr<ACCEL[]> scoped_accelerators(new ACCEL[count]);
ACCEL* accelerators = scoped_accelerators.get();
DCHECK(accelerators != NULL);
diff --git a/chrome/installer/setup/setup_util_unittest.cc b/chrome/installer/setup/setup_util_unittest.cc
index 525f718..6fccc2c 100644
--- a/chrome/installer/setup/setup_util_unittest.cc
+++ b/chrome/installer/setup/setup_util_unittest.cc
@@ -61,7 +61,7 @@ bool CurrentProcessHasPrivilege(const wchar_t* privilege_name) {
DWORD size;
EXPECT_FALSE(::GetTokenInformation(token, TokenPrivileges, NULL, 0, &size));
- scoped_array<BYTE> privileges_bytes(new BYTE[size]);
+ scoped_ptr<BYTE[]> privileges_bytes(new BYTE[size]);
TOKEN_PRIVILEGES* privileges =
reinterpret_cast<TOKEN_PRIVILEGES*>(privileges_bytes.get());
@@ -74,7 +74,7 @@ bool CurrentProcessHasPrivilege(const wchar_t* privilege_name) {
// anything longer will obviously not be equal to |privilege_name|.
const DWORD desired_size = wcslen(privilege_name);
const DWORD buffer_size = desired_size + 1;
- scoped_array<wchar_t> name_buffer(new wchar_t[buffer_size]);
+ scoped_ptr<wchar_t[]> name_buffer(new wchar_t[buffer_size]);
for (int i = privileges->PrivilegeCount - 1; i >= 0 ; --i) {
LUID_AND_ATTRIBUTES& luid_and_att = privileges->Privileges[i];
DWORD size = buffer_size;
diff --git a/chrome/installer/util/delete_tree_work_item.h b/chrome/installer/util/delete_tree_work_item.h
index 3907ac2..e3c2bd5 100644
--- a/chrome/installer/util/delete_tree_work_item.h
+++ b/chrome/installer/util/delete_tree_work_item.h
@@ -43,12 +43,12 @@ class DeleteTreeWorkItem : public WorkItem {
// Contains the paths to the key files. If specified, deletion will be
// performed only if none of the key files are in use.
- scoped_array<base::FilePath> key_paths_;
+ scoped_ptr<base::FilePath[]> key_paths_;
// Contains the temp directories for the backed-up key files. The directories
// are created and populated in Do() as-needed. We don't use a standard
// container for this since base::ScopedTempDir isn't CopyConstructible.
- scoped_array<base::ScopedTempDir> key_backup_paths_;
+ scoped_ptr<base::ScopedTempDir[]> key_backup_paths_;
// The temporary directory into which the original root_path_ has been moved.
base::ScopedTempDir backup_path_;
diff --git a/chrome/installer/util/l10n_string_util.cc b/chrome/installer/util/l10n_string_util.cc
index ce2011f..e4e58c7 100644
--- a/chrome/installer/util/l10n_string_util.cc
+++ b/chrome/installer/util/l10n_string_util.cc
@@ -83,7 +83,7 @@ std::wstring GetLocalizedEulaResource() {
// (see the definition of full_exe_path and resource).
DCHECK(kuint32max > (url_path.size() * 3));
DWORD count = static_cast<DWORD>(url_path.size() * 3);
- scoped_array<wchar_t> url_canon(new wchar_t[count]);
+ scoped_ptr<wchar_t[]> url_canon(new wchar_t[count]);
HRESULT hr = ::UrlCanonicalizeW(url_path.c_str(), url_canon.get(),
&count, URL_ESCAPE_UNSAFE);
if (SUCCEEDED(hr))
diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc
index 903d192..881e795 100644
--- a/chrome/service/cloud_print/print_system_win.cc
+++ b/chrome/service/cloud_print/print_system_win.cc
@@ -837,7 +837,7 @@ bool PrintSystemWin::GetJobDetails(const std::string& printer_name,
if (ERROR_INVALID_PARAMETER != last_error) {
// ERROR_INVALID_PARAMETER normally means that the job id is not valid.
DCHECK(last_error == ERROR_INSUFFICIENT_BUFFER);
- scoped_array<BYTE> job_info_buffer(new BYTE[bytes_needed]);
+ scoped_ptr<BYTE[]> job_info_buffer(new BYTE[bytes_needed]);
if (GetJob(printer_handle, job_id, 1, job_info_buffer.get(), bytes_needed,
&bytes_needed)) {
JOB_INFO_1 *job_info =