| Index: content/browser/tab_contents/tab_contents.cc
|
| diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
|
| index ea19f2090366690848463ef51f1207066999af0a..81283ef8ed2bc6ca9517dd67ff1055ad281d673b 100644
|
| --- a/content/browser/tab_contents/tab_contents.cc
|
| +++ b/content/browser/tab_contents/tab_contents.cc
|
| @@ -14,10 +14,12 @@
|
| #include "base/time.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "content/browser/browser_context.h"
|
| +#include "content/browser/browsing_instance_frame_id.h"
|
| #include "content/browser/child_process_security_policy.h"
|
| #include "content/browser/debugger/devtools_manager.h"
|
| #include "content/browser/download/download_manager.h"
|
| #include "content/browser/download/download_stats.h"
|
| +#include "content/browser/frame_mapper.h"
|
| #include "content/browser/host_zoom_map.h"
|
| #include "content/browser/in_process_webkit/session_storage_namespace.h"
|
| #include "content/browser/load_from_memory_cache_details.h"
|
| @@ -162,6 +164,8 @@ void MakeNavigateParams(const NavigationEntry& entry,
|
| GetNavigationType(controller.browser_context(), entry, reload_type);
|
| params->request_time = base::Time::Now();
|
| params->extra_headers = entry.extra_headers();
|
| + params->opener_browsing_instance_frame_id =
|
| + entry.opener_browsing_instance_frame_id();
|
|
|
| if (delegate)
|
| delegate->AddNavigationHeaders(params->url, ¶ms->extra_headers);
|
| @@ -208,9 +212,18 @@ TabContents::TabContents(content::BrowserContext* browser_context,
|
| static_cast<int>(content::kMaximumZoomFactor * 100)),
|
| temporary_zoom_settings_(false),
|
| content_restrictions_(0),
|
| - view_type_(content::VIEW_TYPE_TAB_CONTENTS) {
|
| + view_type_(content::VIEW_TYPE_TAB_CONTENTS),
|
| + browsing_instance_frame_(
|
| + browser_context->frame_mapper().AllocateNewTopLevelFrameId()) {
|
| render_manager_.Init(browser_context, site_instance, routing_id);
|
|
|
| + // TODO(supersat): This is a hack and should be removed.
|
| + if (routing_id > 0) {
|
| + browser_context->frame_mapper().UpdateFrame(
|
| + browsing_instance_frame_, render_view_host()->process()->GetID(),
|
| + routing_id, -1 /* We don't know the frame id yet */);
|
| + }
|
| +
|
| // We have the initial size of the view be based on the size of the passed in
|
| // tab contents (normally a tab from the same window).
|
| view_->CreateView(base_tab_contents ?
|
| @@ -254,6 +267,8 @@ TabContents::~TabContents() {
|
| base::TimeTicks::Now() - tab_close_start_time_);
|
| }
|
|
|
| + delete browsing_instance_frame_;
|
| +
|
| FOR_EACH_OBSERVER(TabContentsObserver, observers_, TabContentsDestroyed());
|
|
|
| set_delegate(NULL);
|
| @@ -1305,6 +1320,14 @@ void TabContents::DidNavigateMainFramePostCommit(
|
| displayed_insecure_content_ = false;
|
| }
|
|
|
| + DLOG(WARNING) << "DidNavigateMainFramePostCommit: " <<
|
| + params.url << ", " << params.frame_id;
|
| + content::FrameMapper& mapper = browser_context()->frame_mapper();
|
| + mapper.UpdateFrame(browsing_instance_frame_,
|
| + render_view_host()->process()->GetID(),
|
| + render_view_host()->routing_id(),
|
| + params.frame_id);
|
| +
|
| // Notify observers about navigation.
|
| FOR_EACH_OBSERVER(TabContentsObserver, observers_,
|
| DidNavigateMainFrame(details, params));
|
| @@ -1322,6 +1345,13 @@ void TabContents::DidNavigateAnyFramePostCommit(
|
| dialog_creator_ = NULL;
|
| }
|
|
|
| + // TODO(supersat): Logging for debugging purposes only.
|
| + DLOG(WARNING) << "DidNavigateAnyFramePostCommit: "
|
| + << "bifi = " << browsing_instance_frame_->id()
|
| + << ", process id = " << render_view_host->process()->GetID()
|
| + << ", rvh route = " << render_view_host->routing_id()
|
| + << ", frame_id = " << params.frame_id << ", url = " <<
|
| + params.url;
|
| // Notify observers about navigation.
|
| FOR_EACH_OBSERVER(TabContentsObserver, observers_,
|
| DidNavigateAnyFrame(details, params));
|
| @@ -1743,7 +1773,8 @@ void TabContents::DocumentOnLoadCompletedInMainFrame(
|
| void TabContents::RequestOpenURL(const GURL& url,
|
| const GURL& referrer,
|
| WindowOpenDisposition disposition,
|
| - int64 source_frame_id) {
|
| + int64 source_frame_id,
|
| + int64 opener_browsing_instance_frame_id) {
|
| TabContents* new_contents = NULL;
|
| content::PageTransition transition_type = content::PAGE_TRANSITION_LINK;
|
| if (render_manager_.web_ui()) {
|
| @@ -1761,7 +1792,7 @@ void TabContents::RequestOpenURL(const GURL& url,
|
| } else {
|
| new_contents = OpenURL(OpenURLParams(
|
| url, referrer, disposition, content::PAGE_TRANSITION_LINK,
|
| - true /* is_renderer_initiated */));
|
| + true /* is_renderer_initiated */, opener_browsing_instance_frame_id));
|
| }
|
| if (new_contents) {
|
| // Notify observers.
|
|
|