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

Unified Diff: content/browser/tab_contents/navigation_controller.cc

Issue 8760024: Cross-process postMessage (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Current checkpoint Created 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/tab_contents/navigation_controller.cc
diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller.cc
index b3e80ceb799738678687026ffd67438d120282a7..3a3d1b83d069f1c8d4e8ba56766d0658ea84d6f5 100644
--- a/content/browser/tab_contents/navigation_controller.cc
+++ b/content/browser/tab_contents/navigation_controller.cc
@@ -12,6 +12,7 @@
#include "base/utf_string_conversions.h"
#include "content/browser/browser_url_handler.h"
#include "content/browser/child_process_security_policy.h"
+#include "content/browser/content_frame.h"
#include "content/browser/in_process_webkit/session_storage_namespace.h"
#include "content/browser/renderer_host/render_view_host.h" // Temporary
#include "content/browser/site_instance.h"
@@ -230,7 +231,8 @@ NavigationEntry* NavigationController::CreateNavigationEntry(
const GURL& url, const content::Referrer& referrer,
content::PageTransition transition,
bool is_renderer_initiated, const std::string& extra_headers,
- content::BrowserContext* browser_context) {
+ content::BrowserContext* browser_context,
+ content::ContentFrame* opener) {
// Allow the browser URL handler to rewrite the URL. This will, for example,
// remove "view-source:" from the beginning of the URL to get the URL that
// will actually be loaded. This real URL won't be shown to the user, just
@@ -253,6 +255,10 @@ NavigationEntry* NavigationController::CreateNavigationEntry(
entry->set_user_typed_url(url);
entry->set_update_virtual_url_with_url(reverse_on_redirect);
entry->set_extra_headers(extra_headers);
+
+ if (opener)
+ entry->set_opener_content_frame_id(opener->id());
+
return entry;
}
@@ -508,15 +514,15 @@ void NavigationController::TransferURL(
const content::Referrer& referrer,
content::PageTransition transition,
const std::string& extra_headers,
+ content::ContentFrame* opener,
const GlobalRequestID& transferred_global_request_id,
bool is_renderer_initiated) {
// The user initiated a load, we don't need to reload anymore.
needs_reload_ = false;
- NavigationEntry* entry = CreateNavigationEntry(url, referrer, transition,
- is_renderer_initiated,
- extra_headers,
- browser_context_);
+ NavigationEntry* entry = CreateNavigationEntry(
+ url, referrer, transition, is_renderer_initiated, extra_headers,
+ browser_context_, opener);
entry->set_transferred_global_request_id(transferred_global_request_id);
LoadEntry(entry);
@@ -542,14 +548,16 @@ void NavigationController::LoadURLFromRenderer(
const GURL& url,
const content::Referrer& referrer,
content::PageTransition transition,
- const std::string& extra_headers) {
+ const std::string& extra_headers,
+ content::ContentFrame* opener) {
// The user initiated a load, we don't need to reload anymore.
needs_reload_ = false;
NavigationEntry* entry = CreateNavigationEntry(url, referrer, transition,
true,
extra_headers,
- browser_context_);
+ browser_context_,
+ opener);
LoadEntry(entry);
}
« no previous file with comments | « content/browser/tab_contents/navigation_controller.h ('k') | content/browser/tab_contents/navigation_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698