diff options
author | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-26 01:56:19 +0000 |
---|---|---|
committer | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-26 01:56:19 +0000 |
commit | 67f92bc3e4a932b3a12693c0517653f08af87a83 (patch) | |
tree | a0715e22db3af318f69ceb02abf5c07983b4ac1d /content | |
parent | 0f23fd7440d40e701c1dc455f41dc3127f71cb02 (diff) | |
download | chromium_src-67f92bc3e4a932b3a12693c0517653f08af87a83.zip chromium_src-67f92bc3e4a932b3a12693c0517653f08af87a83.tar.gz chromium_src-67f92bc3e4a932b3a12693c0517653f08af87a83.tar.bz2 |
Convert all remaining explicit LeakyLazyInstanceTraits users to ::Leaky
and hide LeakyLazyInstanceTraits in base::internal to discourage cargo-culting
new users.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/9117038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119173 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/browser_thread_impl.cc | 3 | ||||
-rw-r--r-- | content/browser/browsing_instance.cc | 7 | ||||
-rw-r--r-- | content/browser/browsing_instance.h | 8 | ||||
-rw-r--r-- | content/browser/debugger/devtools_http_handler_impl.cc | 18 | ||||
-rw-r--r-- | content/browser/debugger/render_view_devtools_agent_host.cc | 7 | ||||
-rw-r--r-- | content/browser/net/url_request_slow_download_job.cc | 7 | ||||
-rw-r--r-- | content/browser/net/url_request_slow_download_job.h | 6 | ||||
-rw-r--r-- | content/browser/renderer_host/java/java_method.cc | 3 | ||||
-rw-r--r-- | content/browser/renderer_host/render_process_host_impl.cc | 6 | ||||
-rw-r--r-- | content/common/np_channel_base.cc | 8 | ||||
-rw-r--r-- | content/common/socket_stream_dispatcher.cc | 14 | ||||
-rw-r--r-- | content/renderer/devtools_agent.cc | 4 | ||||
-rw-r--r-- | content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc | 3 | ||||
-rw-r--r-- | content/renderer/indexed_db/indexed_db_dispatcher.cc | 7 |
14 files changed, 36 insertions, 65 deletions
diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc index bd6aff9..0814a3c 100644 --- a/content/browser/browser_thread_impl.cc +++ b/content/browser/browser_thread_impl.cc @@ -56,8 +56,7 @@ struct BrowserThreadGlobals { base::SequencedWorkerPool* blocking_pool; }; -base::LazyInstance<BrowserThreadGlobals, - base::LeakyLazyInstanceTraits<BrowserThreadGlobals> > +base::LazyInstance<BrowserThreadGlobals>::Leaky g_globals = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/content/browser/browsing_instance.cc b/content/browser/browsing_instance.cc index a03d873..b82ef96 100644 --- a/content/browser/browsing_instance.cc +++ b/content/browser/browsing_instance.cc @@ -16,11 +16,8 @@ using content::SiteInstance; // static -base::LazyInstance< - BrowsingInstance::ContextSiteInstanceMap, - base::LeakyLazyInstanceTraits<BrowsingInstance::ContextSiteInstanceMap> > - BrowsingInstance::context_site_instance_map_ = - LAZY_INSTANCE_INITIALIZER; +base::LazyInstance<BrowsingInstance::ContextSiteInstanceMap>::Leaky + BrowsingInstance::context_site_instance_map_ = LAZY_INSTANCE_INITIALIZER; BrowsingInstance::BrowsingInstance(content::BrowserContext* browser_context) : browser_context_(browser_context) { diff --git a/content/browser/browsing_instance.h b/content/browser/browsing_instance.h index f32b3d5..9347c90 100644 --- a/content/browser/browsing_instance.h +++ b/content/browser/browsing_instance.h @@ -10,12 +10,12 @@ #include "base/lazy_instance.h" #include "base/memory/ref_counted.h" #include "content/common/content_export.h" +#include "content/public/browser/browser_context.h" class GURL; class SiteInstanceImpl; namespace content { -class BrowserContext; class SiteInstance; } @@ -137,10 +137,8 @@ class CONTENT_EXPORT BrowsingInstance SiteInstanceMap site_instance_map_; // Global map of BrowserContext to SiteInstanceMap, for process-per-site. - static base::LazyInstance< - ContextSiteInstanceMap, - base::LeakyLazyInstanceTraits<ContextSiteInstanceMap> > - context_site_instance_map_; + static base::LazyInstance<ContextSiteInstanceMap>::Leaky + context_site_instance_map_; DISALLOW_COPY_AND_ASSIGN(BrowsingInstance); }; diff --git a/content/browser/debugger/devtools_http_handler_impl.cc b/content/browser/debugger/devtools_http_handler_impl.cc index 6661e94..6d0bc99 100644 --- a/content/browser/debugger/devtools_http_handler_impl.cc +++ b/content/browser/debugger/devtools_http_handler_impl.cc @@ -116,23 +116,17 @@ class TabContentsIDHelper : public content::WebContentsObserver { int id_; typedef std::map<int, TabContents*> IdToTabContentsMap; - static base::LazyInstance<IdToTabContentsMap, - base::LeakyLazyInstanceTraits<IdToTabContentsMap> > + static base::LazyInstance<IdToTabContentsMap>::Leaky id_to_tabcontents_; typedef std::map<TabContents*, int> TabContentsToIdMap; - static base::LazyInstance<TabContentsToIdMap, - base::LeakyLazyInstanceTraits<TabContentsToIdMap> > + static base::LazyInstance<TabContentsToIdMap>::Leaky tabcontents_to_id_; }; -base::LazyInstance< - TabContentsIDHelper::IdToTabContentsMap, - base::LeakyLazyInstanceTraits<TabContentsIDHelper::IdToTabContentsMap> > - TabContentsIDHelper::id_to_tabcontents_ = LAZY_INSTANCE_INITIALIZER; -base::LazyInstance< - TabContentsIDHelper::TabContentsToIdMap, - base::LeakyLazyInstanceTraits<TabContentsIDHelper::TabContentsToIdMap> > - TabContentsIDHelper::tabcontents_to_id_ = LAZY_INSTANCE_INITIALIZER; +base::LazyInstance<TabContentsIDHelper::IdToTabContentsMap>::Leaky + TabContentsIDHelper::id_to_tabcontents_ = LAZY_INSTANCE_INITIALIZER; +base::LazyInstance<TabContentsIDHelper::TabContentsToIdMap>::Leaky + TabContentsIDHelper::tabcontents_to_id_ = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/content/browser/debugger/render_view_devtools_agent_host.cc b/content/browser/debugger/render_view_devtools_agent_host.cc index 943930f..54e4c79 100644 --- a/content/browser/debugger/render_view_devtools_agent_host.cc +++ b/content/browser/debugger/render_view_devtools_agent_host.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -23,9 +23,7 @@ namespace content { typedef std::map<RenderViewHost*, RenderViewDevToolsAgentHost*> Instances; namespace { -base::LazyInstance<Instances, - base::LeakyLazyInstanceTraits<Instances> > - g_instances = LAZY_INSTANCE_INITIALIZER; +base::LazyInstance<Instances>::Leaky g_instances = LAZY_INSTANCE_INITIALIZER; } // namespace // static @@ -142,4 +140,3 @@ void RenderViewDevToolsAgentHost::OnClearBrowserCookies() { } } // namespace content - diff --git a/content/browser/net/url_request_slow_download_job.cc b/content/browser/net/url_request_slow_download_job.cc index 3f01cdf..0ac85b4 100644 --- a/content/browser/net/url_request_slow_download_job.cc +++ b/content/browser/net/url_request_slow_download_job.cc @@ -30,11 +30,8 @@ const int URLRequestSlowDownloadJob::kFirstDownloadSize = 1024 * 35; const int URLRequestSlowDownloadJob::kSecondDownloadSize = 1024 * 10; // static -base::LazyInstance< - URLRequestSlowDownloadJob::SlowJobsSet, - base::LeakyLazyInstanceTraits<URLRequestSlowDownloadJob::SlowJobsSet> > - URLRequestSlowDownloadJob::pending_requests_ = - LAZY_INSTANCE_INITIALIZER; +base::LazyInstance<URLRequestSlowDownloadJob::SlowJobsSet>::Leaky + URLRequestSlowDownloadJob::pending_requests_ = LAZY_INSTANCE_INITIALIZER; void URLRequestSlowDownloadJob::Start() { MessageLoop::current()->PostTask( diff --git a/content/browser/net/url_request_slow_download_job.h b/content/browser/net/url_request_slow_download_job.h index 5ee6980..842ac9b 100644 --- a/content/browser/net/url_request_slow_download_job.h +++ b/content/browser/net/url_request_slow_download_job.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This class simulates a slow download. This used in a UI test to test the @@ -80,9 +80,7 @@ class URLRequestSlowDownloadJob : public net::URLRequestJob { // requests in |pending_requests_|. static void FinishPendingRequests(); typedef std::set<URLRequestSlowDownloadJob*> SlowJobsSet; - static base::LazyInstance<SlowJobsSet, - base::LeakyLazyInstanceTraits<SlowJobsSet> > - pending_requests_; + static base::LazyInstance<SlowJobsSet>::Leaky pending_requests_; void StartAsync(); diff --git a/content/browser/renderer_host/java/java_method.cc b/content/browser/renderer_host/java/java_method.cc index fb4ef80..ee65b87 100644 --- a/content/browser/renderer_host/java/java_method.cc +++ b/content/browser/renderer_host/java/java_method.cc @@ -36,7 +36,8 @@ const char kReturningJavaLangClassArray[] = "()[Ljava/lang/Class;"; const char kReturningJavaLangString[] = "()Ljava/lang/String;"; struct ModifierClassTraits : - public base::LeakyLazyInstanceTraits<ScopedJavaGlobalRef<jclass> > { + public base::internal::LeakyLazyInstanceTraits<ScopedJavaGlobalRef< + jclass> > { static ScopedJavaGlobalRef<jclass>* New(void* instance) { JNIEnv* env = AttachCurrentThread(); // Use placement new to initialize our instance in our preallocated space. diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index e2e921a..38103c9 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -245,10 +245,8 @@ size_t GetMaxRendererProcessCount() { } // the global list of all renderer processes -base::LazyInstance< - IDMap<content::RenderProcessHost>, - base::LeakyLazyInstanceTraits<IDMap<content::RenderProcessHost> > > - g_all_hosts = LAZY_INSTANCE_INITIALIZER; +base::LazyInstance<IDMap<content::RenderProcessHost> >::Leaky + g_all_hosts = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/content/common/np_channel_base.cc b/content/common/np_channel_base.cc index d830295..4209b0c 100644 --- a/content/common/np_channel_base.cc +++ b/content/common/np_channel_base.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -17,13 +17,11 @@ #endif typedef base::hash_map<std::string, scoped_refptr<NPChannelBase> > ChannelMap; -static base::LazyInstance<ChannelMap, - base::LeakyLazyInstanceTraits<ChannelMap> > +static base::LazyInstance<ChannelMap>::Leaky g_channels = LAZY_INSTANCE_INITIALIZER; typedef std::stack<scoped_refptr<NPChannelBase> > NPChannelRefStack; -static base::LazyInstance<NPChannelRefStack, - base::LeakyLazyInstanceTraits<NPChannelRefStack> > +static base::LazyInstance<NPChannelRefStack>::Leaky g_lazy_channel_stack = LAZY_INSTANCE_INITIALIZER; static int next_pipe_id = 0; diff --git a/content/common/socket_stream_dispatcher.cc b/content/common/socket_stream_dispatcher.cc index a45a3f5..d2a332f 100644 --- a/content/common/socket_stream_dispatcher.cc +++ b/content/common/socket_stream_dispatcher.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -57,17 +57,13 @@ class IPCWebSocketStreamHandleBridge WebKit::WebSocketStreamHandle* handle_; webkit_glue::WebSocketStreamHandleDelegate* delegate_; - static base::LazyInstance< - IDMap<IPCWebSocketStreamHandleBridge>, - base::LeakyLazyInstanceTraits<IDMap<IPCWebSocketStreamHandleBridge> > > - all_bridges; + static base::LazyInstance<IDMap<IPCWebSocketStreamHandleBridge> >::Leaky + all_bridges; }; // static -base::LazyInstance< - IDMap<IPCWebSocketStreamHandleBridge>, - base::LeakyLazyInstanceTraits<IDMap<IPCWebSocketStreamHandleBridge> > > - IPCWebSocketStreamHandleBridge::all_bridges = LAZY_INSTANCE_INITIALIZER; +base::LazyInstance<IDMap<IPCWebSocketStreamHandleBridge> >::Leaky + IPCWebSocketStreamHandleBridge::all_bridges = LAZY_INSTANCE_INITIALIZER; /* static */ IPCWebSocketStreamHandleBridge* IPCWebSocketStreamHandleBridge::FromSocketId( diff --git a/content/renderer/devtools_agent.cc b/content/renderer/devtools_agent.cc index 68a4b0e..c596a83 100644 --- a/content/renderer/devtools_agent.cc +++ b/content/renderer/devtools_agent.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -51,7 +51,7 @@ class WebKitClientMessageLoopImpl }; typedef std::map<int, DevToolsAgent*> IdToAgentMap; -base::LazyInstance<IdToAgentMap, base::LeakyLazyInstanceTraits<IdToAgentMap> > +base::LazyInstance<IdToAgentMap>::Leaky g_agent_for_routing_id = LAZY_INSTANCE_INITIALIZER; } // namespace diff --git a/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc b/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc index 2f3b51f..37ab0fe 100644 --- a/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc +++ b/content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc @@ -37,8 +37,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "webkit/glue/gl_bindings_skia_cmd_buffer.h" -static base::LazyInstance<base::Lock, - base::LeakyLazyInstanceTraits<base::Lock> > +static base::LazyInstance<base::Lock>::Leaky g_all_shared_contexts_lock = LAZY_INSTANCE_INITIALIZER; static base::LazyInstance<std::set<WebGraphicsContext3DCommandBufferImpl*> > g_all_shared_contexts = LAZY_INSTANCE_INITIALIZER; diff --git a/content/renderer/indexed_db/indexed_db_dispatcher.cc b/content/renderer/indexed_db/indexed_db_dispatcher.cc index 7ec0703..2770fbb 100644 --- a/content/renderer/indexed_db/indexed_db_dispatcher.cc +++ b/content/renderer/indexed_db/indexed_db_dispatcher.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -33,9 +33,8 @@ using WebKit::WebIDBTransaction; using WebKit::WebIDBTransactionCallbacks; using webkit_glue::WorkerTaskRunner; -static base::LazyInstance<ThreadLocalPointer<IndexedDBDispatcher>, - base::LeakyLazyInstanceTraits<ThreadLocalPointer<IndexedDBDispatcher> > > - g_idb_dispatcher_tls = LAZY_INSTANCE_INITIALIZER; +static base::LazyInstance<ThreadLocalPointer<IndexedDBDispatcher> >::Leaky + g_idb_dispatcher_tls = LAZY_INSTANCE_INITIALIZER; namespace { |