diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-17 18:46:29 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-17 18:46:29 +0000 |
commit | 5091c42ec0df2e8f6f9c5767a0ba82fa56a64841 (patch) | |
tree | 0471d8461ab6b9e93d21ac55c7ab642a2c0db7de /chrome_frame | |
parent | 747b1d3d7cd1ee6ce2bd0a54d2198683ba70ba8f (diff) | |
download | chromium_src-5091c42ec0df2e8f6f9c5767a0ba82fa56a64841.zip chromium_src-5091c42ec0df2e8f6f9c5767a0ba82fa56a64841.tar.gz chromium_src-5091c42ec0df2e8f6f9c5767a0ba82fa56a64841.tar.bz2 |
Rewrite scoped_ptr<T>(NULL) to use the default ctor.
This is a manual cleanup of call sites that invoke scoped_ptr<T>'s
constructor with an explicit NULL argument, since the clang tooling
infrastructure does not work on Windows. Also fixes a misuse of
scoped_ptr<T> in chrome_frame to hold memory allocated by operator
new[].
BUG=173286
R=alexeypa@chromium.org, erg@chromium.org, jochen@chromium.org, mmenke@chromium.org, tommi@chromium.org
Review URL: https://codereview.chromium.org/16943003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206763 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/urlmon_bind_status_callback.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome_frame/urlmon_bind_status_callback.h b/chrome_frame/urlmon_bind_status_callback.h index dc31039..1bd76a9 100644 --- a/chrome_frame/urlmon_bind_status_callback.h +++ b/chrome_frame/urlmon_bind_status_callback.h @@ -22,7 +22,7 @@ class CacheStream : public CComObjectRoot, public StreamImpl { COM_INTERFACE_ENTRY(ISequentialStream) END_COM_MAP() - CacheStream() : cache_(NULL), size_(0), position_(0), eof_(false) { + CacheStream() : size_(0), position_(0), eof_(false) { } HRESULT Initialize(const char* cache, size_t size, bool eof); static HRESULT BSCBFeedData(IBindStatusCallback* bscb, const char* data, @@ -33,7 +33,7 @@ class CacheStream : public CComObjectRoot, public StreamImpl { STDMETHOD(Read)(void* pv, ULONG cb, ULONG* read); protected: - scoped_ptr<char> cache_; + scoped_ptr<char[]> cache_; size_t size_; size_t position_; bool eof_; @@ -126,8 +126,7 @@ END_COM_MAP() const wchar_t* status_text) : progress_(progress), progress_max_(progress_max), - status_code_(status_code), - status_text_(NULL) { + status_code_(status_code) { if (status_text) { int len = lstrlenW(status_text) + 1; status_text_.reset(new wchar_t[len]); @@ -165,7 +164,7 @@ END_COM_MAP() // We don't use std::wstring here since we want to be able to play // progress notifications back exactly as we got them. NULL and L"" are // not equal. - scoped_ptr<wchar_t> status_text_; + scoped_ptr<wchar_t[]> status_text_; }; typedef std::vector<Progress*> ProgressVector; |