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

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

Issue 14066022: Use the last committed entry in DidStopLoading, not the pending entry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl_browsertest.cc » ('j') | 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 <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 2831 matching lines...) Expand 10 before | Expand all | Expand 10 after
2842 OnUpdateContentRestrictions(0); 2842 OnUpdateContentRestrictions(0);
2843 2843
2844 // Notify observers about navigation. 2844 // Notify observers about navigation.
2845 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2845 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2846 DidStartLoading(render_view_host)); 2846 DidStartLoading(render_view_host));
2847 } 2847 }
2848 2848
2849 void WebContentsImpl::DidStopLoading(RenderViewHost* render_view_host) { 2849 void WebContentsImpl::DidStopLoading(RenderViewHost* render_view_host) {
2850 scoped_ptr<LoadNotificationDetails> details; 2850 scoped_ptr<LoadNotificationDetails> details;
2851 2851
2852 NavigationEntry* entry = controller_.GetActiveEntry(); 2852 // Use the last committed entry rather than the active one, in case a
2853 // pending entry has been created.
2854 NavigationEntry* entry = controller_.GetLastCommittedEntry();
2855
2853 // An entry may not exist for a stop when loading an initial blank page or 2856 // An entry may not exist for a stop when loading an initial blank page or
2854 // if an iframe injected by script into a blank page finishes loading. 2857 // if an iframe injected by script into a blank page finishes loading.
2855 if (entry) { 2858 if (entry) {
2856 base::TimeDelta elapsed = base::TimeTicks::Now() - current_load_start_; 2859 base::TimeDelta elapsed = base::TimeTicks::Now() - current_load_start_;
2857 2860
2858 details.reset(new LoadNotificationDetails( 2861 details.reset(new LoadNotificationDetails(
2859 entry->GetVirtualURL(), 2862 entry->GetVirtualURL(),
2860 entry->GetTransitionType(), 2863 entry->GetTransitionType(),
2861 elapsed, 2864 elapsed,
2862 &controller_, 2865 &controller_,
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
3406 } 3409 }
3407 3410
3408 BrowserPluginGuestManager* 3411 BrowserPluginGuestManager*
3409 WebContentsImpl::GetBrowserPluginGuestManager() const { 3412 WebContentsImpl::GetBrowserPluginGuestManager() const {
3410 return static_cast<BrowserPluginGuestManager*>( 3413 return static_cast<BrowserPluginGuestManager*>(
3411 GetBrowserContext()->GetUserData( 3414 GetBrowserContext()->GetUserData(
3412 browser_plugin::kBrowserPluginGuestManagerKeyName)); 3415 browser_plugin::kBrowserPluginGuestManagerKeyName));
3413 } 3416 }
3414 3417
3415 } // namespace content 3418 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698