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

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

Issue 118553006: Move DidFailProvisionalLoad handling from RenderView(Host) to RenderFrame(Host). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Huh? 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 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 2157
2158 if (is_main_frame) { 2158 if (is_main_frame) {
2159 FOR_EACH_OBSERVER( 2159 FOR_EACH_OBSERVER(
2160 WebContentsObserver, 2160 WebContentsObserver,
2161 observers_, 2161 observers_,
2162 ProvisionalChangeToMainFrameUrl(validated_url, 2162 ProvisionalChangeToMainFrameUrl(validated_url,
2163 render_frame_host->render_view_host())); 2163 render_frame_host->render_view_host()));
2164 } 2164 }
2165 } 2165 }
2166 2166
2167 void WebContentsImpl::DidFailProvisionalLoadWithError(
2168 RenderFrameHostImpl* render_frame_host,
2169 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {
2170 GURL validated_url(params.url);
2171 FOR_EACH_OBSERVER(
2172 WebContentsObserver,
2173 observers_,
2174 DidFailProvisionalLoad(params.frame_id,
2175 params.frame_unique_name,
2176 params.is_main_frame,
2177 validated_url,
2178 params.error_code,
2179 params.error_description,
2180 render_frame_host->render_view_host()));
2181 }
2182
2167 void WebContentsImpl::NotifyChangedNavigationState( 2183 void WebContentsImpl::NotifyChangedNavigationState(
2168 InvalidateTypes changed_flags) { 2184 InvalidateTypes changed_flags) {
2169 NotifyNavigationStateChanged(changed_flags); 2185 NotifyNavigationStateChanged(changed_flags);
2170 } 2186 }
2171 2187
2172 void WebContentsImpl::DidRedirectProvisionalLoad( 2188 void WebContentsImpl::DidRedirectProvisionalLoad(
2173 RenderViewHost* render_view_host, 2189 RenderViewHost* render_view_host,
2174 int32 page_id, 2190 int32 page_id,
2175 const GURL& source_url, 2191 const GURL& source_url,
2176 const GURL& target_url) { 2192 const GURL& target_url) {
(...skipping 15 matching lines...) Expand all
2192 } 2208 }
2193 if (!entry || entry->GetURL() != validated_source_url) 2209 if (!entry || entry->GetURL() != validated_source_url)
2194 return; 2210 return;
2195 2211
2196 // Notify observers about the provisional change in the main frame URL. 2212 // Notify observers about the provisional change in the main frame URL.
2197 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2213 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2198 ProvisionalChangeToMainFrameUrl(validated_target_url, 2214 ProvisionalChangeToMainFrameUrl(validated_target_url,
2199 render_view_host)); 2215 render_view_host));
2200 } 2216 }
2201 2217
2218 /*
Charlie Reis 2014/01/06 18:13:35 Don't forget to delete this now that it's moved.
nasko 2014/01/06 18:47:03 Done.
2202 void WebContentsImpl::DidFailProvisionalLoadWithError( 2219 void WebContentsImpl::DidFailProvisionalLoadWithError(
2203 RenderViewHost* render_view_host, 2220 RenderViewHost* render_view_host,
2204 const ViewHostMsg_DidFailProvisionalLoadWithError_Params& params) { 2221 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {
2205 VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec() 2222 VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec()
2206 << ", error_code: " << params.error_code 2223 << ", error_code: " << params.error_code
2207 << ", error_description: " << params.error_description 2224 << ", error_description: " << params.error_description
2208 << ", is_main_frame: " << params.is_main_frame 2225 << ", is_main_frame: " << params.is_main_frame
2209 << ", showing_repost_interstitial: " << 2226 << ", showing_repost_interstitial: " <<
2210 params.showing_repost_interstitial 2227 params.showing_repost_interstitial
2211 << ", frame_id: " << params.frame_id; 2228 << ", frame_id: " << params.frame_id;
2212 GURL validated_url(params.url); 2229 GURL validated_url(params.url);
2213 RenderProcessHost* render_process_host = 2230 RenderProcessHost* render_process_host =
2214 render_view_host->GetProcess(); 2231 render_view_host->GetProcess();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
2256 FOR_EACH_OBSERVER(WebContentsObserver, 2273 FOR_EACH_OBSERVER(WebContentsObserver,
2257 observers_, 2274 observers_,
2258 DidFailProvisionalLoad(params.frame_id, 2275 DidFailProvisionalLoad(params.frame_id,
2259 params.frame_unique_name, 2276 params.frame_unique_name,
2260 params.is_main_frame, 2277 params.is_main_frame,
2261 validated_url, 2278 validated_url,
2262 params.error_code, 2279 params.error_code,
2263 params.error_description, 2280 params.error_description,
2264 render_view_host)); 2281 render_view_host));
2265 } 2282 }
2283 */
2266 2284
2267 void WebContentsImpl::OnDidLoadResourceFromMemoryCache( 2285 void WebContentsImpl::OnDidLoadResourceFromMemoryCache(
2268 const GURL& url, 2286 const GURL& url,
2269 const std::string& security_info, 2287 const std::string& security_info,
2270 const std::string& http_method, 2288 const std::string& http_method,
2271 const std::string& mime_type, 2289 const std::string& mime_type,
2272 ResourceType::Type resource_type) { 2290 ResourceType::Type resource_type) {
2273 base::StatsCounter cache("WebKit.CacheHit"); 2291 base::StatsCounter cache("WebKit.CacheHit");
2274 cache.Increment(); 2292 cache.Increment();
2275 2293
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after
3896 } 3914 }
3897 3915
3898 void WebContentsImpl::OnFrameRemoved( 3916 void WebContentsImpl::OnFrameRemoved(
3899 RenderViewHostImpl* render_view_host, 3917 RenderViewHostImpl* render_view_host,
3900 int64 frame_id) { 3918 int64 frame_id) {
3901 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3919 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3902 FrameDetached(render_view_host, frame_id)); 3920 FrameDetached(render_view_host, frame_id));
3903 } 3921 }
3904 3922
3905 } // namespace content 3923 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698