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

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

Issue 2546533007: Store the last committed origin in RenderFrameHostImpl. (Closed)
Patch Set: Rebase (and remove DCHECK) Created 4 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 bool RenderFrameHostImpl::IsCrossProcessSubframe() { 468 bool RenderFrameHostImpl::IsCrossProcessSubframe() {
469 if (!parent_) 469 if (!parent_)
470 return false; 470 return false;
471 return GetSiteInstance() != parent_->GetSiteInstance(); 471 return GetSiteInstance() != parent_->GetSiteInstance();
472 } 472 }
473 473
474 const GURL& RenderFrameHostImpl::GetLastCommittedURL() { 474 const GURL& RenderFrameHostImpl::GetLastCommittedURL() {
475 return last_committed_url(); 475 return last_committed_url();
476 } 476 }
477 477
478 url::Origin RenderFrameHostImpl::GetLastCommittedOrigin() { 478 const url::Origin& RenderFrameHostImpl::GetLastCommittedOrigin() {
479 // Origin is stored per-FTN, so it's incorrect to call for a non-current RFH. 479 return last_committed_origin_;
480 CHECK(this == frame_tree_node_->current_frame_host());
481 return frame_tree_node_->current_origin();
482 } 480 }
483 481
484 gfx::NativeView RenderFrameHostImpl::GetNativeView() { 482 gfx::NativeView RenderFrameHostImpl::GetNativeView() {
485 RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView(); 483 RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView();
486 if (!view) 484 if (!view)
487 return NULL; 485 return NULL;
488 return view->GetNativeView(); 486 return view->GetNativeView();
489 } 487 }
490 488
491 void RenderFrameHostImpl::AddMessageToConsole(ConsoleMessageLevel level, 489 void RenderFrameHostImpl::AddMessageToConsole(ConsoleMessageLevel level,
(...skipping 2830 matching lines...) Expand 10 before | Expand all | Expand 10 after
3322 // pending_nav_entry_id. If the previous handle was a prematurely aborted 3320 // pending_nav_entry_id. If the previous handle was a prematurely aborted
3323 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. 3321 // navigation loaded via LoadDataWithBaseURL, propagate the entry id.
3324 return NavigationHandleImpl::Create( 3322 return NavigationHandleImpl::Create(
3325 params.url, frame_tree_node_, is_renderer_initiated, 3323 params.url, frame_tree_node_, is_renderer_initiated,
3326 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(), 3324 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(),
3327 entry_id_for_data_nav, params.gesture, 3325 entry_id_for_data_nav, params.gesture,
3328 false); // started_from_context_menu 3326 false); // started_from_context_menu
3329 } 3327 }
3330 3328
3331 } // namespace content 3329 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698