Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4939)

Unified Diff: chrome/common/child_process_logging_win.cc

Issue 293040: Added a static function pointer to cache the SetActiveURL pointer returned by... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698