Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4694)

Unified Diff: chrome_frame/urlmon_bind_status_callback.h

Issue 2118001: Not using std::wstring to store progress status text because mshtml is sensit... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome_frame/urlmon_bind_status_callback.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/urlmon_bind_status_callback.h
===================================================================
--- chrome_frame/urlmon_bind_status_callback.h (revision 47191)
+++ chrome_frame/urlmon_bind_status_callback.h (working copy)
@@ -93,7 +93,8 @@
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,60 @@
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_ = reinterpret_cast<wchar_t*>(
+ ::CoTaskMemAlloc(len * sizeof(wchar_t)));
+ if (status_text_) {
+ lstrcpyW(status_text_, status_text);
+ } else {
+ NOTREACHED();
+ }
+ }
+ }
+
+ ~Progress() {
+ if (status_text_) {
+ ::CoTaskMemFree(status_text_);
+ }
+ }
+
+ 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_;
+ }
+
+ 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.
+ wchar_t* status_text_;
};
- std::vector<Progress> saved_progress_;
+ std::vector<Progress*> saved_progress_;
CLIPFORMAT clip_format_;
private:
« no previous file with comments | « no previous file | chrome_frame/urlmon_bind_status_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698