summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorscottbyer@chromium.org <scottbyer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 22:28:51 +0000
committerscottbyer@chromium.org <scottbyer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 22:28:51 +0000
commit9dc4794d2759fde611f89b6e808a104fe490d7ef (patch)
treed322b2fcc5843b3f1fcfaeebad4fa974dafc49e6 /ppapi
parent3896409bc0f727bd5c41cd3fe7760023757cfd7e (diff)
downloadchromium_src-9dc4794d2759fde611f89b6e808a104fe490d7ef.zip
chromium_src-9dc4794d2759fde611f89b6e808a104fe490d7ef.tar.gz
chromium_src-9dc4794d2759fde611f89b6e808a104fe490d7ef.tar.bz2
Revert 146670 - Fix unit test to allow repeated successful runs by avoiding a function static variable in tests.
BUG=137145 TEST=run unit_tests with --gtest_filter=ComponentInstallerTest.PepperFlashCheck --gtest_repeat=2 successfully. Review URL: https://chromiumcodereview.appspot.com/10702188 TBR=scottbyer@chromium.org Revert reason: checkdeps fail (passed trybots?) Review URL: https://chromiumcodereview.appspot.com/10788005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146672 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/shared_impl/ppapi_globals.cc6
-rw-r--r--ppapi/shared_impl/ppapi_globals.h3
2 files changed, 3 insertions, 6 deletions
diff --git a/ppapi/shared_impl/ppapi_globals.cc b/ppapi/shared_impl/ppapi_globals.cc
index 0336e0c..80a4ee2 100644
--- a/ppapi/shared_impl/ppapi_globals.cc
+++ b/ppapi/shared_impl/ppapi_globals.cc
@@ -23,12 +23,10 @@ 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() {
@@ -45,7 +43,9 @@ void PpapiGlobals::SetPpapiGlobalsOnThreadForTest(PpapiGlobals* ptr) {
}
base::MessageLoopProxy* PpapiGlobals::GetMainThreadMessageLoop() {
- return message_loop_proxy_.get();
+ CR_DEFINE_STATIC_LOCAL(scoped_refptr<base::MessageLoopProxy>, proxy,
+ (base::MessageLoopProxy::current()));
+ return proxy.get();
}
bool PpapiGlobals::IsHostGlobals() const {
diff --git a/ppapi/shared_impl/ppapi_globals.h b/ppapi/shared_impl/ppapi_globals.h
index e95cf48..00fb9b1 100644
--- a/ppapi/shared_impl/ppapi_globals.h
+++ b/ppapi/shared_impl/ppapi_globals.h
@@ -8,7 +8,6 @@
#include <string>
#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
#include "base/threading/thread_local.h" // For testing purposes only.
#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/pp_instance.h"
@@ -127,8 +126,6 @@ class PPAPI_SHARED_EXPORT PpapiGlobals {
static PpapiGlobals* ppapi_globals_;
- scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
-
DISALLOW_COPY_AND_ASSIGN(PpapiGlobals);
};