summaryrefslogtreecommitdiffstats
path: root/chrome/common/child_process_logging_win.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 18:31:20 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 18:31:20 +0000
commitbd11ba32a3a9844a15ed2a0c2cf6a4140c2853ae (patch)
tree32c018c626c1b6580224fdd8ff7b2cc7aeadcbab /chrome/common/child_process_logging_win.cc
parent6f65cc3b4114080938c42bc1f3f55c0188f27163 (diff)
downloadchromium_src-bd11ba32a3a9844a15ed2a0c2cf6a4140c2853ae.zip
chromium_src-bd11ba32a3a9844a15ed2a0c2cf6a4140c2853ae.tar.gz
chromium_src-bd11ba32a3a9844a15ed2a0c2cf6a4140c2853ae.tar.bz2
Add the page url to plugin crashes to aid debugging.
Review URL: http://codereview.chromium.org/149305 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20173 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/child_process_logging_win.cc')
-rw-r--r--chrome/common/child_process_logging_win.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/chrome/common/child_process_logging_win.cc b/chrome/common/child_process_logging_win.cc
new file mode 100644
index 0000000..2221713
--- /dev/null
+++ b/chrome/common/child_process_logging_win.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2009 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.
+
+#include "chrome/common/child_process_logging.h"
+
+#include <windows.h>
+
+#include "base/string_util.h"
+#include "chrome/common/chrome_constants.h"
+#include "googleurl/src/gurl.h"
+
+namespace child_process_logging {
+
+typedef void (__cdecl *MainSetActiveURL)(const wchar_t*);
+
+void SetActiveURL(const GURL& url) {
+ HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
+ if (!exe_module)
+ return;
+
+ MainSetActiveURL set_active_url =
+ reinterpret_cast<MainSetActiveURL>(
+ GetProcAddress(exe_module, "SetActiveURL"));
+ if (!set_active_url)
+ return;
+
+ (set_active_url)(UTF8ToWide(url.possibly_invalid_spec()).c_str());
+}
+
+} // namespace child_process_logging