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

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

Issue 129813006: Move DidReceiveServerRedirectForProvisionalLoad from RenderView to RenderFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
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/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 2184 matching lines...) Expand 10 before | Expand all | Expand 10 after
2195 params.error_description, 2195 params.error_description,
2196 render_frame_host->render_view_host())); 2196 render_frame_host->render_view_host()));
2197 } 2197 }
2198 2198
2199 void WebContentsImpl::NotifyChangedNavigationState( 2199 void WebContentsImpl::NotifyChangedNavigationState(
2200 InvalidateTypes changed_flags) { 2200 InvalidateTypes changed_flags) {
2201 NotifyNavigationStateChanged(changed_flags); 2201 NotifyNavigationStateChanged(changed_flags);
2202 } 2202 }
2203 2203
2204 void WebContentsImpl::DidRedirectProvisionalLoad( 2204 void WebContentsImpl::DidRedirectProvisionalLoad(
2205 RenderViewHost* render_view_host, 2205 RenderFrameHostImpl* render_frame_host,
2206 int32 page_id, 2206 const GURL& validated_target_url) {
2207 const GURL& source_url,
2208 const GURL& target_url) {
2209 // TODO(creis): Remove this method and have the pre-rendering code listen to
2210 // WebContentsObserver::DidGetRedirectForResourceRequest instead.
2211 // See http://crbug.com/78512.
2212 GURL validated_source_url(source_url);
2213 GURL validated_target_url(target_url);
2214 RenderProcessHost* render_process_host =
2215 render_view_host->GetProcess();
2216 render_process_host->FilterURL(false, &validated_source_url);
2217 render_process_host->FilterURL(false, &validated_target_url);
2218 NavigationEntry* entry;
2219 if (page_id == -1) {
2220 entry = controller_.GetPendingEntry();
2221 } else {
2222 entry = controller_.GetEntryWithPageID(render_view_host->GetSiteInstance(),
2223 page_id);
2224 }
2225 if (!entry || entry->GetURL() != validated_source_url)
2226 return;
2227
2228 // Notify observers about the provisional change in the main frame URL. 2207 // Notify observers about the provisional change in the main frame URL.
2229 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2208 FOR_EACH_OBSERVER(
2230 ProvisionalChangeToMainFrameUrl(validated_target_url, 2209 WebContentsObserver,
2231 render_view_host)); 2210 observers_,
2211 ProvisionalChangeToMainFrameUrl(validated_target_url,
2212 render_frame_host->render_view_host()));
jam 2014/01/10 16:19:31 it looks like none of the overrides for this metho
nasko 2014/01/10 19:54:39 Done.
2232 } 2213 }
2233 2214
2234 void WebContentsImpl::OnDidLoadResourceFromMemoryCache( 2215 void WebContentsImpl::OnDidLoadResourceFromMemoryCache(
2235 const GURL& url, 2216 const GURL& url,
2236 const std::string& security_info, 2217 const std::string& security_info,
2237 const std::string& http_method, 2218 const std::string& http_method,
2238 const std::string& mime_type, 2219 const std::string& mime_type,
2239 ResourceType::Type resource_type) { 2220 ResourceType::Type resource_type) {
2240 base::StatsCounter cache("WebKit.CacheHit"); 2221 base::StatsCounter cache("WebKit.CacheHit");
2241 cache.Increment(); 2222 cache.Increment();
(...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after
3863 } 3844 }
3864 3845
3865 void WebContentsImpl::OnFrameRemoved( 3846 void WebContentsImpl::OnFrameRemoved(
3866 RenderViewHostImpl* render_view_host, 3847 RenderViewHostImpl* render_view_host,
3867 int64 frame_id) { 3848 int64 frame_id) {
3868 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3849 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3869 FrameDetached(render_view_host, frame_id)); 3850 FrameDetached(render_view_host, frame_id));
3870 } 3851 }
3871 3852
3872 } // namespace content 3853 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698