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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 136203009: Support auto-reload on errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Rebase? Created 6 years, 9 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
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 "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 return false; 977 return false;
978 } 978 }
979 979
980 *error_domain = LocalizedError::kHttpErrorDomain; 980 *error_domain = LocalizedError::kHttpErrorDomain;
981 return true; 981 return true;
982 } 982 }
983 983
984 bool ChromeContentRendererClient::ShouldSuppressErrorPage( 984 bool ChromeContentRendererClient::ShouldSuppressErrorPage(
985 content::RenderFrame* render_frame, 985 content::RenderFrame* render_frame,
986 const GURL& url) { 986 const GURL& url) {
987 // Unit tests for ChromeContentRendererClient pass a NULL RenderFrame here.
988 // Unfortunately it's very difficult to construct a mock RenderView, so skip
989 // this functionality in this case.
990 if (render_frame) {
991 content::RenderView* render_view = render_frame->GetRenderView();
992 content::RenderFrame* main_render_frame = render_view->GetMainRenderFrame();
993 blink::WebFrame* web_frame = render_frame->GetWebFrame();
994 NetErrorHelper* net_error_helper = NetErrorHelper::Get(main_render_frame);
995 if (net_error_helper->ShouldSuppressErrorPage(web_frame, url))
996 return true;
997 }
987 // Do not flash an error page if the Instant new tab page fails to load. 998 // Do not flash an error page if the Instant new tab page fails to load.
988 return search_bouncer_.get() && search_bouncer_->IsNewTabPage(url); 999 return search_bouncer_.get() && search_bouncer_->IsNewTabPage(url);
989 } 1000 }
990 1001
991 void ChromeContentRendererClient::GetNavigationErrorStrings( 1002 void ChromeContentRendererClient::GetNavigationErrorStrings(
992 content::RenderView* render_view, 1003 content::RenderView* render_view,
993 blink::WebFrame* frame, 1004 blink::WebFrame* frame,
994 const blink::WebURLRequest& failed_request, 1005 const blink::WebURLRequest& failed_request,
995 const blink::WebURLError& error, 1006 const blink::WebURLError& error,
996 std::string* error_html, 1007 std::string* error_html,
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 CommandLine* command_line = CommandLine::ForCurrentProcess(); 1439 CommandLine* command_line = CommandLine::ForCurrentProcess();
1429 return !command_line->HasSwitch(extensions::switches::kExtensionProcess); 1440 return !command_line->HasSwitch(extensions::switches::kExtensionProcess);
1430 } 1441 }
1431 1442
1432 blink::WebWorkerPermissionClientProxy* 1443 blink::WebWorkerPermissionClientProxy*
1433 ChromeContentRendererClient::CreateWorkerPermissionClientProxy( 1444 ChromeContentRendererClient::CreateWorkerPermissionClientProxy(
1434 content::RenderFrame* render_frame, 1445 content::RenderFrame* render_frame,
1435 blink::WebFrame* frame) { 1446 blink::WebFrame* frame) {
1436 return new WorkerPermissionClientProxy(render_frame, frame); 1447 return new WorkerPermissionClientProxy(render_frame, frame);
1437 } 1448 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698