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.h | |
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.h')
-rw-r--r-- | chrome_frame/urlmon_bind_status_callback.h | 52 |
1 files changed, 47 insertions, 5 deletions
diff --git a/chrome_frame/urlmon_bind_status_callback.h b/chrome_frame/urlmon_bind_status_callback.h index 484bef3..ef73cb8 100644 --- a/chrome_frame/urlmon_bind_status_callback.h +++ b/chrome_frame/urlmon_bind_status_callback.h @@ -93,7 +93,8 @@ class SniffData { class BSCBStorageBind : public BSCBImpl { public: typedef BSCBImpl CallbackImpl; - BSCBStorageBind() : clip_format_(CF_NULL) {} + BSCBStorageBind(); + ~BSCBStorageBind(); BEGIN_COM_MAP(BSCBStorageBind) COM_INTERFACE_ENTRY(IBindStatusCallback) @@ -117,15 +118,56 @@ END_COM_MAP() protected: SniffData data_sniffer_; - // A structure to cache the progress notifications - struct Progress { + // A structure to cache the progress notifications. + class Progress { + public: + Progress(ULONG progress, ULONG progress_max, ULONG status_code, + const wchar_t* status_text) + : progress_(progress), + progress_max_(progress_max), + status_code_(status_code), + status_text_(NULL) { + if (status_text) { + int len = lstrlenW(status_text) + 1; + status_text_.reset(new wchar_t[len]); + if (status_text_.get()) { + lstrcpyW(status_text_.get(), status_text); + } else { + NOTREACHED(); + } + } + } + + ~Progress() { + } + + ULONG progress() const { + return progress_; + } + + ULONG progress_max() const { + return progress_max_; + } + + ULONG status_code() const { + return status_code_; + } + + const wchar_t* status_text() const { + return status_text_.get(); + } + + protected: ULONG progress_; ULONG progress_max_; ULONG status_code_; - std::wstring status_text_; + // 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_; }; - std::vector<Progress> saved_progress_; + std::vector<Progress*> saved_progress_; CLIPFORMAT clip_format_; private: |