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

Side by Side Diff: content/browser/renderer_host/render_widget_helper.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: Created 3 years, 9 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
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 "content/browser/renderer_host/render_widget_helper.h" 5 #include "content/browser/renderer_host/render_widget_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/posix/eintr_wrapper.h" 10 #include "base/posix/eintr_wrapper.h"
11 #include "base/threading/thread.h" 11 #include "base/threading/thread.h"
12 #include "base/threading/thread_restrictions.h" 12 #include "base/threading/thread_restrictions.h"
13 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 13 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
14 #include "content/browser/frame_host/render_frame_host_impl.h" 14 #include "content/browser/frame_host/render_frame_host_impl.h"
15 #include "content/browser/loader/resource_dispatcher_host_impl.h" 15 #include "content/browser/loader/resource_dispatcher_host_impl.h"
16 #include "content/browser/renderer_host/render_process_host_impl.h" 16 #include "content/browser/renderer_host/render_process_host_impl.h"
17 #include "content/browser/renderer_host/render_view_host_impl.h" 17 #include "content/browser/renderer_host/render_view_host_impl.h"
18 #include "content/common/view_messages.h" 18 #include "content/common/view_messages.h"
19 19
20 namespace content { 20 namespace content {
21 namespace { 21 namespace {
22 22
23 typedef std::map<int, RenderWidgetHelper*> WidgetHelperMap; 23 typedef std::map<int, RenderWidgetHelper*> WidgetHelperMap;
24 base::LazyInstance<WidgetHelperMap> g_widget_helpers = 24 base::LazyInstance<WidgetHelperMap>::DestructorAtExit g_widget_helpers =
25 LAZY_INSTANCE_INITIALIZER; 25 LAZY_INSTANCE_INITIALIZER;
26 26
27 void AddWidgetHelper(int render_process_id, 27 void AddWidgetHelper(int render_process_id,
28 const scoped_refptr<RenderWidgetHelper>& widget_helper) { 28 const scoped_refptr<RenderWidgetHelper>& widget_helper) {
29 DCHECK_CURRENTLY_ON(BrowserThread::IO); 29 DCHECK_CURRENTLY_ON(BrowserThread::IO);
30 // We don't care if RenderWidgetHelpers overwrite an existing process_id. Just 30 // We don't care if RenderWidgetHelpers overwrite an existing process_id. Just
31 // want this to be up to date. 31 // want this to be up to date.
32 g_widget_helpers.Get()[render_process_id] = widget_helper.get(); 32 g_widget_helpers.Get()[render_process_id] = widget_helper.get();
33 } 33 }
34 34
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 void RenderWidgetHelper::OnCreateFullscreenWidgetOnUI(int32_t opener_id, 191 void RenderWidgetHelper::OnCreateFullscreenWidgetOnUI(int32_t opener_id,
192 int32_t route_id) { 192 int32_t route_id) {
193 RenderViewHostImpl* host = RenderViewHostImpl::FromID( 193 RenderViewHostImpl* host = RenderViewHostImpl::FromID(
194 render_process_id_, opener_id); 194 render_process_id_, opener_id);
195 if (host) 195 if (host)
196 host->CreateNewFullscreenWidget(route_id); 196 host->CreateNewFullscreenWidget(route_id);
197 } 197 }
198 198
199 } // namespace content 199 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698