diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 22:55:47 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 22:55:47 +0000 |
commit | 1f1e7cb4c07acbec92de5c49a2cd4a206282b7c3 (patch) | |
tree | cec5652d6d3a1dbf3875a1b58cd09d602ec6f3af | |
parent | a4137af3ab19dc0fed8def4b3f66872aeaf5094b (diff) | |
download | chromium_src-1f1e7cb4c07acbec92de5c49a2cd4a206282b7c3.zip chromium_src-1f1e7cb4c07acbec92de5c49a2cd4a206282b7c3.tar.gz chromium_src-1f1e7cb4c07acbec92de5c49a2cd4a206282b7c3.tar.bz2 |
scoped_ptr and new[] don't mix.
BUG=99261
TEST=none
Review URL: http://codereview.chromium.org/8207004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104592 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/external_tab_container_win.cc | 3 | ||||
-rw-r--r-- | chrome/service/cloud_print/print_system_win.cc | 2 | ||||
-rw-r--r-- | chrome_frame/test/urlmon_moniker_unittest.cc | 6 | ||||
-rw-r--r-- | printing/backend/print_backend_win.cc | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index 7b8d825..c7905c3 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -9,6 +9,7 @@ #include "base/debug/trace_event.h" #include "base/i18n/rtl.h" #include "base/logging.h" +#include "base/memory/scoped_ptr.h" #include "base/utf_string_conversions.h" #include "base/win/win_util.h" #include "chrome/app/chrome_command_ids.h" @@ -1098,7 +1099,7 @@ void ExternalTabContainer::LoadAccelerators() { return; } - scoped_ptr<ACCEL> scoped_accelerators(new ACCEL[count]); + scoped_array<ACCEL> scoped_accelerators(new ACCEL[count]); ACCEL* accelerators = scoped_accelerators.get(); DCHECK(accelerators != NULL); diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc index 43a8335..ce52f99 100644 --- a/chrome/service/cloud_print/print_system_win.cc +++ b/chrome/service/cloud_print/print_system_win.cc @@ -813,7 +813,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_ptr<BYTE> job_info_buffer(new BYTE[bytes_needed]); + scoped_array<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 = diff --git a/chrome_frame/test/urlmon_moniker_unittest.cc b/chrome_frame/test/urlmon_moniker_unittest.cc index f7e0f04..1e1126b 100644 --- a/chrome_frame/test/urlmon_moniker_unittest.cc +++ b/chrome_frame/test/urlmon_moniker_unittest.cc @@ -173,7 +173,7 @@ TEST_F(MonikerPatchTest, SniffDataPlayback1) { const DWORD data_size = small_html_meta_tag.size(); DWORD read_size1 = data_size * 2; - scoped_ptr<char> read_buffer1(new char[read_size1]); + scoped_array<char> read_buffer1(new char[read_size1]); ZeroMemory(read_buffer1.get(), read_size1); char read_buffer2[10] = {0}; @@ -217,8 +217,8 @@ TEST_F(MonikerPatchTest, SniffDataPlayback2) { DWORD read_size1 = data_size / 2; // First read is half the data. DWORD read_size2 = data_size; // Second read, try to read past data. - scoped_ptr<char> read_buffer1(new char[read_size1]); - scoped_ptr<char> read_buffer2(new char[read_size2]); + scoped_array<char> read_buffer1(new char[read_size1]); + scoped_array<char> read_buffer2(new char[read_size2]); ZeroMemory(read_buffer1.get(), read_size1); ZeroMemory(read_buffer2.get(), read_size2); diff --git a/printing/backend/print_backend_win.cc b/printing/backend/print_backend_win.cc index 39f085e..01be277 100644 --- a/printing/backend/print_backend_win.cc +++ b/printing/backend/print_backend_win.cc @@ -142,7 +142,7 @@ bool PrintBackendWin::GetPrinterCapsAndDefaults( NULL, NULL, 0); if (devmode_size <= 0) return false; - scoped_ptr<BYTE> devmode_out_buffer(new BYTE[devmode_size]); + scoped_array<BYTE> devmode_out_buffer(new BYTE[devmode_size]); DEVMODE* devmode_out = reinterpret_cast<DEVMODE*>(devmode_out_buffer.get()); DocumentProperties( |