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

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

Issue 1635873003: Replicating WebFrame::uniqueName across renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dump-render-tree3
Patch Set: Fixing fallout from the new assert in FrameTree.cpp. Created 4 years, 10 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 logging::LogMessage("CONSOLE", line_no, resolved_level).stream() 806 logging::LogMessage("CONSOLE", line_no, resolved_level).stream()
807 << "\"" << message << "\", source: " << source_id << " (" << line_no 807 << "\"" << message << "\", source: " << source_id << " (" << line_no
808 << ")"; 808 << ")";
809 } 809 }
810 } 810 }
811 811
812 void RenderFrameHostImpl::OnCreateChildFrame( 812 void RenderFrameHostImpl::OnCreateChildFrame(
813 int new_routing_id, 813 int new_routing_id,
814 blink::WebTreeScopeType scope, 814 blink::WebTreeScopeType scope,
815 const std::string& frame_name, 815 const std::string& frame_name,
816 const std::string& frame_unique_name,
816 blink::WebSandboxFlags sandbox_flags, 817 blink::WebSandboxFlags sandbox_flags,
817 const blink::WebFrameOwnerProperties& frame_owner_properties) { 818 const blink::WebFrameOwnerProperties& frame_owner_properties) {
819 // TODO(lukasza): Call ReceivedBadMessage when |frame_unique_name| is empty?
Charlie Reis 2016/02/11 22:02:14 Yep, that'll be useful down the road. You can mak
Łukasz Anforowicz 2016/02/11 23:23:56 Done.
820 DCHECK(!frame_unique_name.empty());
821
818 // It is possible that while a new RenderFrameHost was committed, the 822 // It is possible that while a new RenderFrameHost was committed, the
819 // RenderFrame corresponding to this host sent an IPC message to create a 823 // RenderFrame corresponding to this host sent an IPC message to create a
820 // frame and it is delivered after this host is swapped out. 824 // frame and it is delivered after this host is swapped out.
821 // Ignore such messages, as we know this RenderFrameHost is going away. 825 // Ignore such messages, as we know this RenderFrameHost is going away.
822 if (rfh_state_ != RenderFrameHostImpl::STATE_DEFAULT || 826 if (rfh_state_ != RenderFrameHostImpl::STATE_DEFAULT ||
823 frame_tree_node_->current_frame_host() != this) 827 frame_tree_node_->current_frame_host() != this)
824 return; 828 return;
825 829
826 frame_tree_->AddFrame(frame_tree_node_, GetProcess()->GetID(), new_routing_id, 830 frame_tree_->AddFrame(frame_tree_node_, GetProcess()->GetID(), new_routing_id,
827 scope, frame_name, sandbox_flags, 831 scope, frame_name, frame_unique_name, sandbox_flags,
828 frame_owner_properties); 832 frame_owner_properties);
829 } 833 }
830 834
831 void RenderFrameHostImpl::OnDetach() { 835 void RenderFrameHostImpl::OnDetach() {
832 frame_tree_->RemoveFrame(frame_tree_node_); 836 frame_tree_->RemoveFrame(frame_tree_node_);
833 } 837 }
834 838
835 void RenderFrameHostImpl::OnFrameFocused() { 839 void RenderFrameHostImpl::OnFrameFocused() {
836 frame_tree_->SetFocusedFrame(frame_tree_node_, GetSiteInstance()); 840 frame_tree_->SetFocusedFrame(frame_tree_node_, GetSiteInstance());
837 } 841 }
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 1408
1405 void RenderFrameHostImpl::OnDidAccessInitialDocument() { 1409 void RenderFrameHostImpl::OnDidAccessInitialDocument() {
1406 delegate_->DidAccessInitialDocument(); 1410 delegate_->DidAccessInitialDocument();
1407 } 1411 }
1408 1412
1409 void RenderFrameHostImpl::OnDidChangeOpener(int32_t opener_routing_id) { 1413 void RenderFrameHostImpl::OnDidChangeOpener(int32_t opener_routing_id) {
1410 frame_tree_node_->render_manager()->DidChangeOpener(opener_routing_id, 1414 frame_tree_node_->render_manager()->DidChangeOpener(opener_routing_id,
1411 GetSiteInstance()); 1415 GetSiteInstance());
1412 } 1416 }
1413 1417
1414 void RenderFrameHostImpl::OnDidChangeName(const std::string& name) { 1418 void RenderFrameHostImpl::OnDidChangeName(const std::string& name,
1419 const std::string& unique_name) {
1415 std::string old_name = frame_tree_node()->frame_name(); 1420 std::string old_name = frame_tree_node()->frame_name();
1416 frame_tree_node()->SetFrameName(name); 1421 frame_tree_node()->SetFrameName(name, unique_name);
Charlie Reis 2016/02/11 22:02:14 Same TODO about BadMessageReceived?
Łukasz Anforowicz 2016/02/11 23:23:55 Hmmm... maybe I should add DCHECKs here to make it
1417 if (old_name.empty() && !name.empty()) 1422 if (old_name.empty() && !name.empty())
1418 frame_tree_node_->render_manager()->CreateProxiesForNewNamedFrame(); 1423 frame_tree_node_->render_manager()->CreateProxiesForNewNamedFrame();
1419 delegate_->DidChangeName(this, name); 1424 delegate_->DidChangeName(this, name);
1420 } 1425 }
1421 1426
1422 void RenderFrameHostImpl::OnEnforceStrictMixedContentChecking() { 1427 void RenderFrameHostImpl::OnEnforceStrictMixedContentChecking() {
1423 frame_tree_node()->SetEnforceStrictMixedContentChecking(true); 1428 frame_tree_node()->SetEnforceStrictMixedContentChecking(true);
1424 } 1429 }
1425 1430
1426 void RenderFrameHostImpl::OnDidAssignPageId(int32_t page_id) { 1431 void RenderFrameHostImpl::OnDidAssignPageId(int32_t page_id) {
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
2553 *dst = src; 2558 *dst = src;
2554 2559
2555 if (src.routing_id != -1) 2560 if (src.routing_id != -1)
2556 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); 2561 dst->tree_id = RoutingIDToAXTreeID(src.routing_id);
2557 2562
2558 if (src.parent_routing_id != -1) 2563 if (src.parent_routing_id != -1)
2559 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); 2564 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id);
2560 } 2565 }
2561 2566
2562 } // namespace content 2567 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698