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

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

Issue 9117038: Convert all remaining explicit LeakyLazyInstanceTraits users to ::Leaky (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
« no previous file with comments | « net/url_request/url_request_test_job.cc ('k') | remoting/client/plugin/chromoting_instance.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/lazy_instance.h" // For testing purposes only. 7 #include "base/lazy_instance.h" // For testing purposes only.
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/threading/thread_local.h" // For testing purposes only. 9 #include "base/threading/thread_local.h" // For testing purposes only.
10 10
11 namespace ppapi { 11 namespace ppapi {
12 12
13 namespace { 13 namespace {
14 // Thread-local globals for testing. See SetPpapiGlobalsOnThreadForTest for more 14 // Thread-local globals for testing. See SetPpapiGlobalsOnThreadForTest for more
15 // information. 15 // information.
16 base::LazyInstance< 16 base::LazyInstance<base::ThreadLocalPointer<PpapiGlobals> >::Leaky
17 base::ThreadLocalPointer<PpapiGlobals>, 17 tls_ppapi_globals_for_test = LAZY_INSTANCE_INITIALIZER;
18 base::LeakyLazyInstanceTraits<base::ThreadLocalPointer<PpapiGlobals> > >
19 tls_ppapi_globals_for_test = LAZY_INSTANCE_INITIALIZER;
20 } // namespace 18 } // namespace
21 19
22 PpapiGlobals* PpapiGlobals::ppapi_globals_ = NULL; 20 PpapiGlobals* PpapiGlobals::ppapi_globals_ = NULL;
23 21
24 PpapiGlobals::PpapiGlobals() { 22 PpapiGlobals::PpapiGlobals() {
25 DCHECK(!ppapi_globals_); 23 DCHECK(!ppapi_globals_);
26 ppapi_globals_ = this; 24 ppapi_globals_ = this;
27 } 25 }
28 26
29 PpapiGlobals::PpapiGlobals(ForTest) { 27 PpapiGlobals::PpapiGlobals(ForTest) {
(...skipping 20 matching lines...) Expand all
50 bool PpapiGlobals::IsPluginGlobals() const { 48 bool PpapiGlobals::IsPluginGlobals() const {
51 return false; 49 return false;
52 } 50 }
53 51
54 // static 52 // static
55 PpapiGlobals* PpapiGlobals::GetThreadLocalPointer() { 53 PpapiGlobals* PpapiGlobals::GetThreadLocalPointer() {
56 return tls_ppapi_globals_for_test.Pointer()->Get(); 54 return tls_ppapi_globals_for_test.Pointer()->Get();
57 } 55 }
58 56
59 } // namespace ppapi 57 } // namespace ppapi
OLDNEW
« no previous file with comments | « net/url_request/url_request_test_job.cc ('k') | remoting/client/plugin/chromoting_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698