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

Side by Side Diff: content/browser/frame_host/render_frame_proxy_host.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/frame_host/render_frame_proxy_host.h" 5 #include "content/browser/frame_host/render_frame_proxy_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "content/browser/bad_message.h" 10 #include "content/browser/bad_message.h"
(...skipping 12 matching lines...) Expand all
23 #include "ipc/ipc_message.h" 23 #include "ipc/ipc_message.h"
24 24
25 namespace content { 25 namespace content {
26 26
27 namespace { 27 namespace {
28 28
29 // The (process id, routing id) pair that identifies one RenderFrameProxy. 29 // The (process id, routing id) pair that identifies one RenderFrameProxy.
30 typedef std::pair<int32_t, int32_t> RenderFrameProxyHostID; 30 typedef std::pair<int32_t, int32_t> RenderFrameProxyHostID;
31 typedef base::hash_map<RenderFrameProxyHostID, RenderFrameProxyHost*> 31 typedef base::hash_map<RenderFrameProxyHostID, RenderFrameProxyHost*>
32 RoutingIDFrameProxyMap; 32 RoutingIDFrameProxyMap;
33 base::LazyInstance<RoutingIDFrameProxyMap> g_routing_id_frame_proxy_map = 33 base::LazyInstance<RoutingIDFrameProxyMap>::DestructorAtExit
34 LAZY_INSTANCE_INITIALIZER; 34 g_routing_id_frame_proxy_map = LAZY_INSTANCE_INITIALIZER;
35
36 } 35 }
37 36
38 // static 37 // static
39 RenderFrameProxyHost* RenderFrameProxyHost::FromID(int process_id, 38 RenderFrameProxyHost* RenderFrameProxyHost::FromID(int process_id,
40 int routing_id) { 39 int routing_id) {
41 DCHECK_CURRENTLY_ON(BrowserThread::UI); 40 DCHECK_CURRENTLY_ON(BrowserThread::UI);
42 RoutingIDFrameProxyMap* frames = g_routing_id_frame_proxy_map.Pointer(); 41 RoutingIDFrameProxyMap* frames = g_routing_id_frame_proxy_map.Pointer();
43 RoutingIDFrameProxyMap::iterator it = frames->find( 42 RoutingIDFrameProxyMap::iterator it = frames->find(
44 RenderFrameProxyHostID(process_id, routing_id)); 43 RenderFrameProxyHostID(process_id, routing_id));
45 return it == frames->end() ? NULL : it->second; 44 return it == frames->end() ? NULL : it->second;
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 346
348 target_rfh->AdvanceFocus(type, source_proxy); 347 target_rfh->AdvanceFocus(type, source_proxy);
349 } 348 }
350 349
351 void RenderFrameProxyHost::OnFrameFocused() { 350 void RenderFrameProxyHost::OnFrameFocused() {
352 frame_tree_node_->current_frame_host()->delegate()->SetFocusedFrame( 351 frame_tree_node_->current_frame_host()->delegate()->SetFocusedFrame(
353 frame_tree_node_, GetSiteInstance()); 352 frame_tree_node_, GetSiteInstance());
354 } 353 }
355 354
356 } // namespace content 355 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698