summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_active_document.h
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 14:44:32 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 14:44:32 +0000
commit00aebd7077fba59430dc4d2bada1aa8b56b548f9 (patch)
tree367727f4a8af89d9b9b43e3013279ad7fa5d7211 /chrome_frame/chrome_active_document.h
parentf274a1c114c24dadddfbbeb51049a655cb075d90 (diff)
downloadchromium_src-00aebd7077fba59430dc4d2bada1aa8b56b548f9.zip
chromium_src-00aebd7077fba59430dc4d2bada1aa8b56b548f9.tar.gz
chromium_src-00aebd7077fba59430dc4d2bada1aa8b56b548f9.tar.bz2
Not firing DocumentComplete in the presence of buggy BHOs.
TEST=should be no functional change except if there are buggy BHOs that we know of loaded in IE. BUG=44463 Review URL: http://codereview.chromium.org/2906011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52668 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_active_document.h')
-rw-r--r--chrome_frame/chrome_active_document.h35
1 files changed, 20 insertions, 15 deletions
diff --git a/chrome_frame/chrome_active_document.h b/chrome_frame/chrome_active_document.h
index 1360ff1..6bd8e4d 100644
--- a/chrome_frame/chrome_active_document.h
+++ b/chrome_frame/chrome_active_document.h
@@ -9,10 +9,11 @@
#include <atlcom.h>
#include <atlctl.h>
#include <htiframe.h>
-#include <map>
#include <mshtmcid.h>
#include <perhist.h>
+#include <map>
+
#include "base/scoped_ptr.h"
#include "base/scoped_comptr_win.h"
#include "base/thread.h"
@@ -130,16 +131,16 @@ extern const DWORD kIEEncodingIdArray[];
// This macro should be defined in the public section of the class.
#define BEGIN_EXEC_COMMAND_MAP(theClass) \
- public: \
- HRESULT ProcessExecCommand(const GUID* cmd_group_guid, DWORD command_id, \
- DWORD cmd_exec_opt, VARIANT* in_args, \
- VARIANT* out_args) { \
- HRESULT hr = OLECMDERR_E_NOTSUPPORTED; \
- do {
+ public: \
+ HRESULT ProcessExecCommand(const GUID* cmd_group_guid, DWORD command_id, \
+ DWORD cmd_exec_opt, VARIANT* in_args, \
+ VARIANT* out_args) { \
+ HRESULT hr = OLECMDERR_E_NOTSUPPORTED; \
+ do {
#define EXEC_COMMAND_HANDLER(group, id, handler) \
if ((id == command_id) && ((group != NULL && cmd_group_guid != NULL && \
- IsEqualGUID(*(GUID*)group,*cmd_group_guid)) || \
+ IsEqualGUID(*reinterpret_cast<const GUID*>(group), *cmd_group_guid)) || \
(group == NULL && cmd_group_guid == NULL))) { \
hr = S_OK; \
handler(cmd_group_guid, command_id, cmd_exec_opt, in_args, out_args); \
@@ -148,7 +149,7 @@ extern const DWORD kIEEncodingIdArray[];
#define EXEC_COMMAND_HANDLER_NO_ARGS(group, id, handler) \
if ((id == command_id) && ((group != NULL && cmd_group_guid != NULL && \
- IsEqualGUID(*(GUID*)group,*cmd_group_guid)) || \
+ IsEqualGUID(*reinterpret_cast<const GUID*>(group), *cmd_group_guid)) || \
(group == NULL && cmd_group_guid == NULL))) { \
hr = S_OK; \
handler(); \
@@ -157,7 +158,7 @@ extern const DWORD kIEEncodingIdArray[];
#define EXEC_COMMAND_HANDLER_GENERIC(group, id, code) \
if ((id == command_id) && ((group != NULL && cmd_group_guid != NULL && \
- IsEqualGUID(*(GUID*)group,*cmd_group_guid)) || \
+ IsEqualGUID(*reinterpret_cast<const GUID*>(group), *cmd_group_guid)) || \
(group == NULL && cmd_group_guid == NULL))) { \
hr = S_OK; \
code; \
@@ -176,7 +177,8 @@ extern const DWORD kIEEncodingIdArray[];
commands++; \
} \
if (id_in_group_commands && ((group != NULL && cmd_group_guid != NULL && \
- IsEqualGUID(*(GUID*)group,*cmd_group_guid)) || \
+ IsEqualGUID(*reinterpret_cast<const GUID*>(group), \
+ *cmd_group_guid)) || \
(group == NULL && cmd_group_guid == NULL))) { \
hr = S_OK; \
handler(cmd_group_guid, command_id, cmd_exec_opt, in_args, out_args); \
@@ -343,10 +345,9 @@ END_EXEC_COMMAND_MAP()
// IEnumPrivacyRecords
STDMETHOD(Reset)();
- STDMETHOD(GetSize)(unsigned long* size);
+ STDMETHOD(GetSize)(ULONG* size);
STDMETHOD(GetPrivacyImpacted)(BOOL* privacy_impacted);
- STDMETHOD(Next)(BSTR* url, BSTR* policy, long* reserved,
- unsigned long* flags);
+ STDMETHOD(Next)(BSTR* url, BSTR* policy, LONG* reserved, DWORD* flags);
protected:
// ChromeFrameActivexBase overrides
@@ -379,7 +380,7 @@ END_EXEC_COMMAND_MAP()
HRESULT IEExec(const GUID* cmd_group_guid, DWORD command_id,
DWORD cmd_exec_opt, VARIANT* in_args, VARIANT* out_args);
- unsigned long MapUrlToZone(const wchar_t* url);
+ DWORD MapUrlToZone(const wchar_t* url);
// Parses the URL and returns information whether it is a new navigation and
// the actual url after stripping out the cf: prefix if any.
@@ -421,6 +422,10 @@ END_EXEC_COMMAND_MAP()
LRESULT OnFirePrivacyChange(UINT message, WPARAM wparam, LPARAM lparam,
BOOL& handled);
+ // Checks for the presence of known-to-be-buggy BHOs. If we find any
+ // we do not fire the DocumentComplete event to avoid a crash.
+ static bool ShouldFireDocumentComplete();
+
protected:
typedef std::map<int, bool> EnabledCommandsMap;