summaryrefslogtreecommitdiffstats
path: root/chrome_frame/bind_context_info.h
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-15 01:39:26 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-15 01:39:26 +0000
commit70277f6b896c776999e356d6546d65fd999dea05 (patch)
tree455a61a961f398d2b8dbab0c4673b1bae792b589 /chrome_frame/bind_context_info.h
parente6e55fb4b70fb47c6959b68e0cccd328bed9c358 (diff)
downloadchromium_src-70277f6b896c776999e356d6546d65fd999dea05.zip
chromium_src-70277f6b896c776999e356d6546d65fd999dea05.tar.gz
chromium_src-70277f6b896c776999e356d6546d65fd999dea05.tar.bz2
Avoid a crash in ChromeFrame in the BindToStorage call initiated when our active document is loaded. The crash occurs while dereferencing a
NULL delegate which is the case in the pending request object created by the active document to handle the initial load. Fix for this is to maintain a pending state in the request object. We ignore all OnProgress notifications in this state. When Chrome requests data for the top level url this state is cleared. Consolidated the number of bind context information structures into one which contains everything we need in ChromeFrame, i.e. to decide to switch to Chrome, indicating whether the request came from Chrome, etc. Review URL: http://codereview.chromium.org/1654012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44604 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/bind_context_info.h')
-rw-r--r--chrome_frame/bind_context_info.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/chrome_frame/bind_context_info.h b/chrome_frame/bind_context_info.h
new file mode 100644
index 0000000..e66d450
--- /dev/null
+++ b/chrome_frame/bind_context_info.h
@@ -0,0 +1,66 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_FRAME_BIND_CONTEXT_INFO_
+#define CHROME_FRAME_BIND_CONTEXT_INFO_
+
+#include <atlbase.h>
+#include <atlcom.h>
+
+#include "base/scoped_bstr_win.h"
+#include "base/scoped_comptr_win.h"
+
+// This class maintains contextual information used by ChromeFrame.
+// This information is maintained in the bind context.
+class BindContextInfo : public IUnknown, public CComObjectRoot {
+ public:
+ BindContextInfo();
+ virtual ~BindContextInfo() {}
+
+ BEGIN_COM_MAP(BindContextInfo)
+ END_COM_MAP()
+
+ // Returns the BindContextInfo instance associated with the bind
+ // context. Creates it if needed.
+ static BindContextInfo* FromBindContext(IBindCtx* bind_context);
+
+ void set_chrome_request(bool chrome_request) {
+ chrome_request_ = chrome_request;
+ }
+
+ bool chrome_request() const {
+ return chrome_request_;
+ }
+
+ void set_no_cache(bool no_cache) {
+ no_cache_ = no_cache;
+ }
+
+ bool no_cache() const {
+ return no_cache_;
+ }
+
+ bool is_switching() const {
+ return is_switching_;
+ }
+
+ void SetToSwitch(IStream* cache);
+
+ IStream* cache() {
+ return cache_;
+ }
+
+ void set_cache(IStream* cache);
+
+ private:
+ ScopedComPtr<IStream> cache_;
+ bool no_cache_;
+ bool chrome_request_;
+ bool is_switching_;
+
+ DISALLOW_COPY_AND_ASSIGN(BindContextInfo);
+};
+
+#endif // CHROME_FRAME_BIND_CONTEXT_INFO_
+