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

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

Issue 1475433002: Expose RenderFrameHost::GetLastCommittedOrigin(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 if (!parent_node) 304 if (!parent_node)
305 return false; 305 return false;
306 return GetSiteInstance() != 306 return GetSiteInstance() !=
307 parent_node->current_frame_host()->GetSiteInstance(); 307 parent_node->current_frame_host()->GetSiteInstance();
308 } 308 }
309 309
310 GURL RenderFrameHostImpl::GetLastCommittedURL() { 310 GURL RenderFrameHostImpl::GetLastCommittedURL() {
311 return frame_tree_node_->current_url(); 311 return frame_tree_node_->current_url();
312 } 312 }
313 313
314 url::Origin RenderFrameHostImpl::GetLastCommittedOrigin() {
315 // Origin is stored per-FTN, so it's incorrect to call for a non-current RFH.
316 if (this != frame_tree_node_->current_frame_host()) {
317 NOTREACHED() << "Origin information is tracked only for the current host.";
318 return url::Origin();
319 }
320 return frame_tree_node_->current_replication_state().origin;
alexmos 2015/11/24 00:05:49 We can now just do frame_tree_node_->current_origi
ncarter (slow) 2015/11/24 00:35:33 Will do.
321 }
322
314 gfx::NativeView RenderFrameHostImpl::GetNativeView() { 323 gfx::NativeView RenderFrameHostImpl::GetNativeView() {
315 RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView(); 324 RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView();
316 if (!view) 325 if (!view)
317 return NULL; 326 return NULL;
318 return view->GetNativeView(); 327 return view->GetNativeView();
319 } 328 }
320 329
321 void RenderFrameHostImpl::AddMessageToConsole(ConsoleMessageLevel level, 330 void RenderFrameHostImpl::AddMessageToConsole(ConsoleMessageLevel level,
322 const std::string& message) { 331 const std::string& message) {
323 Send(new FrameMsg_AddMessageToConsole(routing_id_, level, message)); 332 Send(new FrameMsg_AddMessageToConsole(routing_id_, level, message));
(...skipping 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after
2378 *dst = src; 2387 *dst = src;
2379 2388
2380 if (src.routing_id != -1) 2389 if (src.routing_id != -1)
2381 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); 2390 dst->tree_id = RoutingIDToAXTreeID(src.routing_id);
2382 2391
2383 if (src.parent_routing_id != -1) 2392 if (src.parent_routing_id != -1)
2384 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); 2393 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id);
2385 } 2394 }
2386 2395
2387 } // namespace content 2396 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698