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

Side by Side Diff: ppapi/shared_impl/ppapi_globals.cc

Issue 9034035: Make it possible to have 1 PpapiGlobals per thread. Update unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove perftest stuff from this CL Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/shared_impl/ppapi_globals.h" 5 #include "ppapi/shared_impl/ppapi_globals.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace ppapi { 9 namespace ppapi {
10 10
11 PpapiGlobals* PpapiGlobals::ppapi_globals_ = NULL; 11 PpapiGlobals* PpapiGlobals::ppapi_globals_ = NULL;
12 base::ThreadLocalPointer<PpapiGlobals> PpapiGlobals::ppapi_globals_for_test_;
12 13
13 PpapiGlobals::PpapiGlobals() { 14 PpapiGlobals::PpapiGlobals() {
14 DCHECK(!ppapi_globals_); 15 // TODO(dmichael): Re-enable this check for when we're not testing.
16 //DCHECK(!ppapi_globals_);
15 ppapi_globals_ = this; 17 ppapi_globals_ = this;
16 } 18 }
17 19
18 PpapiGlobals::~PpapiGlobals() { 20 PpapiGlobals::~PpapiGlobals() {
19 DCHECK(ppapi_globals_ == this); 21 // TODO(dmichael): Re-enable this check for when we're not testing.
22 //DCHECK(ppapi_globals_ == this);
20 ppapi_globals_ = NULL; 23 ppapi_globals_ = NULL;
21 } 24 }
22 25
23 } // namespace ppapi 26 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698