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

Side by Side Diff: content/renderer/web_frame_utils.cc

Issue 2837603002: Content API changes to improve DOM stitching in ThreatDetails code. (Closed)
Patch Set: Use explicitly-sized int types in IPC definition Created 3 years, 6 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
« no previous file with comments | « content/renderer/web_frame_utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/web_frame_utils.h" 5 #include "content/renderer/web_frame_utils.h"
6 6
7 #include "content/renderer/render_frame_impl.h" 7 #include "content/renderer/render_frame_impl.h"
8 #include "content/renderer/render_frame_proxy.h" 8 #include "content/renderer/render_frame_proxy.h"
9 #include "ipc/ipc_message.h" 9 #include "ipc/ipc_message.h"
10 #include "third_party/WebKit/public/web/WebFrame.h" 10 #include "third_party/WebKit/public/web/WebFrame.h"
11 #include "third_party/WebKit/public/web/WebLocalFrame.h" 11 #include "third_party/WebKit/public/web/WebLocalFrame.h"
12 #include "third_party/WebKit/public/web/WebRemoteFrame.h" 12 #include "third_party/WebKit/public/web/WebRemoteFrame.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 int GetRoutingIdForFrameOrProxy(blink::WebFrame* web_frame) {
17 if (!web_frame)
18 return MSG_ROUTING_NONE;
19 if (web_frame->IsWebRemoteFrame())
20 return RenderFrameProxy::FromWebFrame(web_frame)->routing_id();
21 return RenderFrameImpl::FromWebFrame(web_frame)->GetRoutingID();
22 }
23
24 blink::WebFrame* GetWebFrameFromRoutingIdForFrameOrProxy(int routing_id) { 16 blink::WebFrame* GetWebFrameFromRoutingIdForFrameOrProxy(int routing_id) {
25 auto* render_frame = RenderFrameImpl::FromRoutingID(routing_id); 17 auto* render_frame = RenderFrameImpl::FromRoutingID(routing_id);
26 if (render_frame) 18 if (render_frame)
27 return render_frame->GetWebFrame(); 19 return render_frame->GetWebFrame();
28 20
29 auto* render_frame_proxy = RenderFrameProxy::FromRoutingID(routing_id); 21 auto* render_frame_proxy = RenderFrameProxy::FromRoutingID(routing_id);
30 if (render_frame_proxy) 22 if (render_frame_proxy)
31 return render_frame_proxy->web_frame(); 23 return render_frame_proxy->web_frame();
32 24
33 return nullptr; 25 return nullptr;
34 } 26 }
35 27
36 } // namespace content 28 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/web_frame_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698