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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2036463002: Use nav_entry_id in UpdateTitle for OOPIF-enabled modes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 4433 matching lines...) Expand 10 before | Expand all | Expand 10 after
4444 base::i18n::TextDirection title_direction) { 4444 base::i18n::TextDirection title_direction) {
4445 // If we have a title, that's a pretty good indication that we've started 4445 // If we have a title, that's a pretty good indication that we've started
4446 // getting useful data. 4446 // getting useful data.
4447 SetNotWaitingForResponse(); 4447 SetNotWaitingForResponse();
4448 4448
4449 // Try to find the navigation entry, which might not be the current one. 4449 // Try to find the navigation entry, which might not be the current one.
4450 // For example, it might be from a recently swapped out RFH. 4450 // For example, it might be from a recently swapped out RFH.
4451 NavigationEntryImpl* entry = controller_.GetEntryWithPageID( 4451 NavigationEntryImpl* entry = controller_.GetEntryWithPageID(
4452 render_frame_host->GetSiteInstance(), page_id); 4452 render_frame_host->GetSiteInstance(), page_id);
4453 4453
4454 // TODO(creis): Switch to use this as the default.
4455 NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID( 4454 NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID(
4456 static_cast<RenderFrameHostImpl*>(render_frame_host)->nav_entry_id()); 4455 static_cast<RenderFrameHostImpl*>(render_frame_host)->nav_entry_id());
4457 DCHECK_EQ(entry, new_entry); 4456 if (SiteIsolationPolicy::AreCrossProcessFramesPossible()) {
4457 // In out-of-process iframe enabled modes, page_id can't keep track of
4458 // navigations in other processes, so we must use nav_entry_id.
4459 // TODO(creis): Switch to use this as the default.
4460 entry = new_entry;
4461 } else {
4462 // In modes that have no out-of-process iframes, nav_entry_id and page_id
4463 // should agree on which entry to update.
4464 DCHECK_EQ(entry, new_entry);
4465 }
4458 4466
4459 // We can handle title updates when we don't have an entry in 4467 // We can handle title updates when we don't have an entry in
4460 // UpdateTitleForEntry, but only if the update is from the current RVH. 4468 // UpdateTitleForEntry, but only if the update is from the current RVH.
4461 // TODO(avi): Change to make decisions based on the RenderFrameHost. 4469 // TODO(avi): Change to make decisions based on the RenderFrameHost.
4462 if (!entry && render_frame_host != GetMainFrame()) 4470 if (!entry && render_frame_host != GetMainFrame())
4463 return; 4471 return;
4464 4472
4465 // TODO(evan): make use of title_direction. 4473 // TODO(evan): make use of title_direction.
4466 // http://code.google.com/p/chromium/issues/detail?id=27094 4474 // http://code.google.com/p/chromium/issues/detail?id=27094
4467 if (!UpdateTitleForEntry(entry, title)) 4475 if (!UpdateTitleForEntry(entry, title))
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
5063 for (RenderViewHost* render_view_host : render_view_host_set) 5071 for (RenderViewHost* render_view_host : render_view_host_set)
5064 render_view_host->OnWebkitPreferencesChanged(); 5072 render_view_host->OnWebkitPreferencesChanged();
5065 } 5073 }
5066 5074
5067 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( 5075 void WebContentsImpl::SetJavaScriptDialogManagerForTesting(
5068 JavaScriptDialogManager* dialog_manager) { 5076 JavaScriptDialogManager* dialog_manager) {
5069 dialog_manager_ = dialog_manager; 5077 dialog_manager_ = dialog_manager;
5070 } 5078 }
5071 5079
5072 } // namespace content 5080 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698