| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/renderer/renderer_logging.h" | |
| 6 | |
| 7 #include <windows.h> | |
| 8 | |
| 9 #include "base/string_util.h" | |
| 10 #include "chrome/common/chrome_constants.h" | |
| 11 #include "googleurl/src/gurl.h" | |
| 12 | |
| 13 namespace renderer_logging { | |
| 14 | |
| 15 typedef void (__cdecl *MainSetActiveRendererURL)(const wchar_t*); | |
| 16 | |
| 17 // Sets the URL that is logged if the renderer crashes. Use GURL() to clear | |
| 18 // the URL. | |
| 19 void SetActiveRendererURL(const GURL& url) { | |
| 20 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); | |
| 21 if (!exe_module) | |
| 22 return; | |
| 23 | |
| 24 MainSetActiveRendererURL set_active_renderer_url = | |
| 25 reinterpret_cast<MainSetActiveRendererURL>( | |
| 26 GetProcAddress(exe_module, "SetActiveRendererURL")); | |
| 27 if (!set_active_renderer_url) | |
| 28 return; | |
| 29 | |
| 30 (set_active_renderer_url)(UTF8ToWide(url.possibly_invalid_spec()).c_str()); | |
| 31 } | |
| 32 | |
| 33 } // namespace renderer_logging | |
| OLD | NEW |