summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_tab.cc
diff options
context:
space:
mode:
authorsiggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 15:34:22 +0000
committersiggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 15:34:22 +0000
commitcebd413af76d96d534a5f70a2eeb356dde3fa392 (patch)
tree8c0bddea5b0e16e4d2ba5d45058965c3b8e57710 /chrome_frame/chrome_tab.cc
parent935e9e15a66effeff40b2a4adcb4f3c3f9664029 (diff)
downloadchromium_src-cebd413af76d96d534a5f70a2eeb356dde3fa392.zip
chromium_src-cebd413af76d96d534a5f70a2eeb356dde3fa392.tar.gz
chromium_src-cebd413af76d96d534a5f70a2eeb356dde3fa392.tar.bz2
Sidestep a race in GoogleUrl by forcing initialization of the offending pointer during DLL loading.
BUG=38484 TEST=none Review URL: http://codereview.chromium.org/1233006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_tab.cc')
-rw-r--r--chrome_frame/chrome_tab.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome_frame/chrome_tab.cc b/chrome_frame/chrome_tab.cc
index 301d9f8..d8deec4 100644
--- a/chrome_frame/chrome_tab.cc
+++ b/chrome_frame/chrome_tab.cc
@@ -32,6 +32,21 @@
#include "chrome_frame/chrome_protocol.h"
#include "chrome_frame/resource.h"
#include "chrome_frame/utils.h"
+#include "googleurl/src/url_util.h"
+
+namespace {
+// This function has the side effect of initializing an unprotected
+// vector pointer inside GoogleUrl. If this is called during DLL loading,
+// it has the effect of avoiding an initializiation race on that pointer.
+// TODO(siggi): fix GoogleUrl.
+void InitGoogleUrl() {
+ static const char kDummyUrl[] = "http://www.google.com";
+
+ url_util::IsStandard(kDummyUrl,
+ url_parse::MakeRange(0, arraysize(kDummyUrl)));
+}
+
+}
static const wchar_t kBhoRegistryPath[] =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"
@@ -145,6 +160,8 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance,
ATL::CTrace::s_trace.ChangeCategory(atlTraceRegistrar, 0,
ATLTRACESTATUS_DISABLED);
#endif
+ InitGoogleUrl();
+
g_exit_manager = new base::AtExitManager();
CommandLine::Init(0, NULL);
InitializeCrashReporting();