OLD | NEW |
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/renderer/render_frame_proxy.h" | 5 #include "content/renderer/render_frame_proxy.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include <map> | 9 #include <map> |
8 | 10 |
9 #include "base/command_line.h" | 11 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
11 #include "content/child/webmessageportchannel_impl.h" | 13 #include "content/child/webmessageportchannel_impl.h" |
12 #include "content/common/frame_messages.h" | 14 #include "content/common/frame_messages.h" |
13 #include "content/common/frame_replication_state.h" | 15 #include "content/common/frame_replication_state.h" |
14 #include "content/common/input_messages.h" | 16 #include "content/common/input_messages.h" |
15 #include "content/common/site_isolation_policy.h" | 17 #include "content/common/site_isolation_policy.h" |
16 #include "content/common/swapped_out_messages.h" | 18 #include "content/common/swapped_out_messages.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // mostly redundant, since we already pass the name and sandbox flags in | 111 // mostly redundant, since we already pass the name and sandbox flags in |
110 // createLocalChild(). We should update the Blink interface so it also takes | 112 // createLocalChild(). We should update the Blink interface so it also takes |
111 // the origin. Then it will be clear that the replication call is only needed | 113 // the origin. Then it will be clear that the replication call is only needed |
112 // for the case of setting up a main frame proxy. | 114 // for the case of setting up a main frame proxy. |
113 proxy->SetReplicatedState(replicated_state); | 115 proxy->SetReplicatedState(replicated_state); |
114 | 116 |
115 return proxy.release(); | 117 return proxy.release(); |
116 } | 118 } |
117 | 119 |
118 // static | 120 // static |
119 RenderFrameProxy* RenderFrameProxy::FromRoutingID(int32 routing_id) { | 121 RenderFrameProxy* RenderFrameProxy::FromRoutingID(int32_t routing_id) { |
120 RoutingIDProxyMap* proxies = g_routing_id_proxy_map.Pointer(); | 122 RoutingIDProxyMap* proxies = g_routing_id_proxy_map.Pointer(); |
121 RoutingIDProxyMap::iterator it = proxies->find(routing_id); | 123 RoutingIDProxyMap::iterator it = proxies->find(routing_id); |
122 return it == proxies->end() ? NULL : it->second; | 124 return it == proxies->end() ? NULL : it->second; |
123 } | 125 } |
124 | 126 |
125 // static | 127 // static |
126 RenderFrameProxy* RenderFrameProxy::FromWebFrame(blink::WebFrame* web_frame) { | 128 RenderFrameProxy* RenderFrameProxy::FromWebFrame(blink::WebFrame* web_frame) { |
127 FrameMap::iterator iter = g_frame_map.Get().find(web_frame); | 129 FrameMap::iterator iter = g_frame_map.Get().find(web_frame); |
128 if (iter != g_frame_map.Get().end()) { | 130 if (iter != g_frame_map.Get().end()) { |
129 RenderFrameProxy* proxy = iter->second; | 131 RenderFrameProxy* proxy = iter->second; |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 blink::WebLocalFrame* source) { | 470 blink::WebLocalFrame* source) { |
469 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); | 471 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); |
470 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); | 472 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); |
471 } | 473 } |
472 | 474 |
473 void RenderFrameProxy::frameFocused() { | 475 void RenderFrameProxy::frameFocused() { |
474 Send(new FrameHostMsg_FrameFocused(routing_id_)); | 476 Send(new FrameHostMsg_FrameFocused(routing_id_)); |
475 } | 477 } |
476 | 478 |
477 } // namespace | 479 } // namespace |
OLD | NEW |