diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-14 02:27:34 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-14 02:27:34 +0000 |
commit | 74e9983aad8bb03972a9716de621fd9292cad5b1 (patch) | |
tree | b0fb21f54bf86a2d2ce95db160860b2bc50a11f4 /chrome_frame/urlmon_bind_status_callback.cc | |
parent | f35dba2472393299a12e41c6ef3e445a4766215e (diff) | |
download | chromium_src-74e9983aad8bb03972a9716de621fd9292cad5b1.zip chromium_src-74e9983aad8bb03972a9716de621fd9292cad5b1.tar.gz chromium_src-74e9983aad8bb03972a9716de621fd9292cad5b1.tar.bz2 |
Not using std::wstring to store progress status text because mshtml is sensitive to NULL vs L"".
TEST=see bug
BUG=44103
Review URL: http://codereview.chromium.org/2118001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47232 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_bind_status_callback.cc')
-rw-r--r-- | chrome_frame/urlmon_bind_status_callback.cc | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/chrome_frame/urlmon_bind_status_callback.cc b/chrome_frame/urlmon_bind_status_callback.cc index 5730870..0f886a1 100644 --- a/chrome_frame/urlmon_bind_status_callback.cc +++ b/chrome_frame/urlmon_bind_status_callback.cc @@ -204,6 +204,16 @@ void SniffData::DetermineRendererType(bool last_chance) { ///////////////////////////////////////////////////////////////////// +BSCBStorageBind::BSCBStorageBind() : clip_format_(CF_NULL) { +} + +BSCBStorageBind::~BSCBStorageBind() { + for (std::vector<Progress*>::iterator i = saved_progress_.begin(); + i != saved_progress_.end(); i++) { + delete (*i); + } +} + HRESULT BSCBStorageBind::Initialize(IMoniker* moniker, IBindCtx* bind_ctx) { DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" tid=%i", PlatformThread::CurrentId()); @@ -250,9 +260,8 @@ STDMETHODIMP BSCBStorageBind::OnProgress(ULONG progress, ULONG progress_max, } if (ShouldCacheProgress(status_code)) { - Progress new_progress = { progress, progress_max, status_code, - status_text ? status_text : std::wstring() }; - saved_progress_.push_back(new_progress); + saved_progress_.push_back(new Progress(progress, progress_max, status_code, + status_text)); } else { hr = CallbackImpl::OnProgress(progress, progress_max, status_code, status_text); @@ -347,12 +356,12 @@ HRESULT BSCBStorageBind::MayPlayBack(DWORD flags) { clip_format_ = kMagicClipFormat; } else { if (!saved_progress_.empty()) { - for (std::vector<Progress>::iterator i = saved_progress_.begin(); - i != saved_progress_.end(); i++) { - const wchar_t* status_text = i->status_text_.empty() ? - NULL : i->status_text_.c_str(); - CallbackImpl::OnProgress(i->progress_, i->progress_max_, - i->status_code_, status_text); + for (std::vector<Progress*>::iterator i = saved_progress_.begin(); + i != saved_progress_.end(); i++) { + Progress* p = (*i); + CallbackImpl::OnProgress(p->progress(), p->progress_max(), + p->status_code(), p->status_text()); + delete p; } saved_progress_.clear(); } |