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

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: add DEPS file 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
« no previous file with comments | « ppapi/shared_impl/ppapi_globals.h ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | 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..0336e0c1c50b3ddb599355dcf3ed0ab6c8d161b7 100644
--- a/ppapi/shared_impl/ppapi_globals.cc
+++ b/ppapi/shared_impl/ppapi_globals.cc
@@ -23,10 +23,12 @@ PpapiGlobals* PpapiGlobals::ppapi_globals_ = NULL;
PpapiGlobals::PpapiGlobals() {
DCHECK(!ppapi_globals_);
ppapi_globals_ = this;
+ message_loop_proxy_ = base::MessageLoopProxy::current();
}
PpapiGlobals::PpapiGlobals(ForTest) {
DCHECK(!ppapi_globals_);
+ message_loop_proxy_ = base::MessageLoopProxy::current();
}
PpapiGlobals::~PpapiGlobals() {
@@ -43,9 +45,7 @@ void PpapiGlobals::SetPpapiGlobalsOnThreadForTest(PpapiGlobals* ptr) {
}
base::MessageLoopProxy* PpapiGlobals::GetMainThreadMessageLoop() {
- CR_DEFINE_STATIC_LOCAL(scoped_refptr<base::MessageLoopProxy>, proxy,
- (base::MessageLoopProxy::current()));
- return proxy.get();
+ return message_loop_proxy_.get();
}
bool PpapiGlobals::IsHostGlobals() const {
« no previous file with comments | « ppapi/shared_impl/ppapi_globals.h ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698