Chromium Code Reviews| Index: chrome/common/child_process_logging_win.cc |
| =================================================================== |
| --- chrome/common/child_process_logging_win.cc (revision 29446) |
| +++ chrome/common/child_process_logging_win.cc (working copy) |
| @@ -15,15 +15,18 @@ |
| typedef void (__cdecl *MainSetActiveURL)(const wchar_t*); |
| void SetActiveURL(const GURL& url) { |
| - HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); |
| - if (!exe_module) |
| - return; |
| + static MainSetActiveURL set_active_url = NULL; |
| - MainSetActiveURL set_active_url = |
| - reinterpret_cast<MainSetActiveURL>( |
| + if (!set_active_url) { |
| + HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); |
| + if (!exe_module) |
| + return; |
| + |
| + set_active_url = reinterpret_cast<MainSetActiveURL>( |
| GetProcAddress(exe_module, "SetActiveURL")); |
|
cpu_(ooo_6.6-7.5)
2009/10/21 17:32:26
strictly speaking the spacing here is wrong, shoul
|
| - if (!set_active_url) |
| - return; |
| + if (!set_active_url) |
| + return; |
| + } |
| (set_active_url)(UTF8ToWide(url.possibly_invalid_spec()).c_str()); |
| } |