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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2837603002: Content API changes to improve DOM stitching in ThreatDetails code. (Closed)
Patch Set: Remove unnecessary deps Created 3 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after
3374 frame_tree_node_->current_url().SchemeIs(kChromeDevToolsScheme) || 3374 frame_tree_node_->current_url().SchemeIs(kChromeDevToolsScheme) ||
3375 ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( 3375 ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
3376 GetProcess()->GetID()) || 3376 GetProcess()->GetID()) ||
3377 // It's possible to load about:blank in a Web UI renderer. 3377 // It's possible to load about:blank in a Web UI renderer.
3378 // See http://crbug.com/42547 3378 // See http://crbug.com/42547
3379 (frame_tree_node_->current_url().spec() == url::kAboutBlankURL) || 3379 (frame_tree_node_->current_url().spec() == url::kAboutBlankURL) ||
3380 // InterstitialPageImpl should be the only case matching this. 3380 // InterstitialPageImpl should be the only case matching this.
3381 (delegate_->GetAsWebContents() == nullptr); 3381 (delegate_->GetAsWebContents() == nullptr);
3382 } 3382 }
3383 3383
3384 // static
3385 int RenderFrameHost::LookupOtherFrameTreeNodeId(int process_id,
3386 int routing_id) {
3387 // Note: this code is copied/modified from RoutingIDToAXTreeID (below).
dmazzoni 2017/05/01 20:10:07 Let's try to share this and come up with a cleaner
lpz 2017/05/02 19:36:24 Done.
3388 RenderFrameProxyHost* rfph =
3389 RenderFrameProxyHost::FromID(process_id, routing_id);
3390 if (rfph) {
3391 return rfph->frame_tree_node()->frame_tree_node_id();
3392 } else {
3393 RenderFrameHost* rfh = RenderFrameHost::FromID(process_id, routing_id);
3394 if (rfh)
3395 return rfh->GetFrameTreeNodeId();
3396 }
3397 return -1;
dmazzoni 2017/05/01 20:10:07 Is there a constant somewhere like kNoFrameTreeNod
lpz 2017/05/02 19:36:24 Couldn't find one so added it.
3398 }
3399
3384 ui::AXTreeIDRegistry::AXTreeID RenderFrameHostImpl::RoutingIDToAXTreeID( 3400 ui::AXTreeIDRegistry::AXTreeID RenderFrameHostImpl::RoutingIDToAXTreeID(
3385 int routing_id) { 3401 int routing_id) {
3386 RenderFrameHostImpl* rfh = nullptr; 3402 RenderFrameHostImpl* rfh = nullptr;
3387 RenderFrameProxyHost* rfph = RenderFrameProxyHost::FromID( 3403 RenderFrameProxyHost* rfph = RenderFrameProxyHost::FromID(
3388 GetProcess()->GetID(), routing_id); 3404 GetProcess()->GetID(), routing_id);
3389 if (rfph) { 3405 if (rfph) {
3390 FrameTree* frame_tree = rfph->frame_tree_node()->frame_tree(); 3406 FrameTree* frame_tree = rfph->frame_tree_node()->frame_tree();
3391 FrameTreeNode* frame_tree_node = frame_tree->FindByRoutingID( 3407 FrameTreeNode* frame_tree_node = frame_tree->FindByRoutingID(
3392 GetProcess()->GetID(), routing_id); 3408 GetProcess()->GetID(), routing_id);
3393 rfh = frame_tree_node->render_manager()->current_frame_host(); 3409 rfh = frame_tree_node->render_manager()->current_frame_host();
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
3681 } 3697 }
3682 3698
3683 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( 3699 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame(
3684 const std::string& interface_name, 3700 const std::string& interface_name,
3685 mojo::ScopedMessagePipeHandle pipe) { 3701 mojo::ScopedMessagePipeHandle pipe) {
3686 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); 3702 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe));
3687 } 3703 }
3688 #endif 3704 #endif
3689 3705
3690 } // namespace content 3706 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698