summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_tab.cc
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 20:05:21 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 20:05:21 +0000
commit87b1942db3bfe2dd9d3a07f15c7abd854ddd1785 (patch)
tree2f093b5e70f1928723938e185a6caa3f00630e80 /chrome_frame/chrome_tab.cc
parent009557c3a5dabcdbf8dd55787611ddd651399f4d (diff)
downloadchromium_src-87b1942db3bfe2dd9d3a07f15c7abd854ddd1785.zip
chromium_src-87b1942db3bfe2dd9d3a07f15c7abd854ddd1785.tar.gz
chromium_src-87b1942db3bfe2dd9d3a07f15c7abd854ddd1785.tar.bz2
Fix a race condition in InitializeAndPatchProtocolsIfNeeded as discovered by MAD.
TEST=Should fix the issue MAD saw when starting up and tearing down the host browser in quick succession. Please see bug description. BUG=27641 Review URL: http://codereview.chromium.org/387049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31935 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_tab.cc')
-rw-r--r--chrome_frame/chrome_tab.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome_frame/chrome_tab.cc b/chrome_frame/chrome_tab.cc
index 01d862a..39436f4 100644
--- a/chrome_frame/chrome_tab.cc
+++ b/chrome_frame/chrome_tab.cc
@@ -259,8 +259,8 @@ STDAPI DllCanUnloadNow() {
// Returns a class factory to create an object of the requested type
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) {
- if (g_patch_helper.state() == PatchHelper::UNKNOWN) {
- g_patch_helper.InitializeAndPatchProtocolsIfNeeded();
+ if (g_patch_helper.InitializeAndPatchProtocolsIfNeeded()) {
+ // We should only get here once.
UrlMkSetSessionOption(URLMON_OPTION_USERAGENT_REFRESH, NULL, 0, 0);
}