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

Unified Diff: ppapi/shared_impl/ppapi_globals.cc

Issue 10702188: Fix unit test to allow repeated successful runs by avoiding a function static variable in tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify with a member variable Created 8 years, 5 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
« ppapi/shared_impl/ppapi_globals.h ('K') | « ppapi/shared_impl/ppapi_globals.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppapi_globals.cc
diff --git a/ppapi/shared_impl/ppapi_globals.cc b/ppapi/shared_impl/ppapi_globals.cc
index 80a4ee2417fc8ecb448fde261f411f8284abe73c..510a821f6bde119bb8c352904fc78c46a72fb58e 100644
--- a/ppapi/shared_impl/ppapi_globals.cc
+++ b/ppapi/shared_impl/ppapi_globals.cc
@@ -43,9 +43,9 @@ void PpapiGlobals::SetPpapiGlobalsOnThreadForTest(PpapiGlobals* ptr) {
}
base::MessageLoopProxy* PpapiGlobals::GetMainThreadMessageLoop() {
- CR_DEFINE_STATIC_LOCAL(scoped_refptr<base::MessageLoopProxy>, proxy,
- (base::MessageLoopProxy::current()));
- return proxy.get();
+ if (!message_loop_proxy_.get())
+ message_loop_proxy_ = base::MessageLoopProxy::current();
brettw 2012/07/13 16:36:22 I think you should just set this in the constructo
dmichael (off chromium) 2012/07/13 16:44:58 Agree. The important thing is that base::MessageLo
+ return message_loop_proxy_.get();
}
bool PpapiGlobals::IsHostGlobals() const {
« ppapi/shared_impl/ppapi_globals.h ('K') | « ppapi/shared_impl/ppapi_globals.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698