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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2425663002: Add an error page for resources blocked via XSS Auditor. (Closed)
Patch Set: Created 4 years, 2 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/renderer/render_frame_impl.h ('k') | net/base/net_error_list.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2461 matching lines...) Expand 10 before | Expand all | Expand 10 after
2472 #endif 2472 #endif
2473 #endif 2473 #endif
2474 return NULL; 2474 return NULL;
2475 } 2475 }
2476 2476
2477 void RenderFrameImpl::LoadURLExternally(const blink::WebURLRequest& request, 2477 void RenderFrameImpl::LoadURLExternally(const blink::WebURLRequest& request,
2478 blink::WebNavigationPolicy policy) { 2478 blink::WebNavigationPolicy policy) {
2479 loadURLExternally(request, policy, WebString(), false); 2479 loadURLExternally(request, policy, WebString(), false);
2480 } 2480 }
2481 2481
2482 void RenderFrameImpl::loadErrorPage(int reason) {
2483 blink::WebURLError error;
2484 error.unreachableURL = frame_->document().url();
2485 error.domain = WebString::fromUTF8(net::kErrorDomain);
2486 error.reason = reason;
2487
2488 std::string error_html;
2489 GetContentClient()->renderer()->GetNavigationErrorStrings(
2490 this, frame_->dataSource()->request(), error, &error_html, nullptr);
2491
2492 frame_->loadData(error_html, WebString::fromUTF8("text/html"),
2493 WebString::fromUTF8("UTF-8"), GURL(kUnreachableWebDataURL),
Tom Sepez 2016/10/20 18:26:58 Maybe truncate the ? and # portions of the url?
2494 error.unreachableURL, true, blink::WebFrameLoadType::Standard ,
2495 blink::WebHistoryItem(), blink::WebHistoryDifferentDocumentLo ad, true);
2496 }
2497
2482 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { 2498 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) {
2483 OnJavaScriptExecuteRequest(javascript, 0, false); 2499 OnJavaScriptExecuteRequest(javascript, 0, false);
2484 } 2500 }
2485 2501
2486 service_manager::InterfaceRegistry* RenderFrameImpl::GetInterfaceRegistry() { 2502 service_manager::InterfaceRegistry* RenderFrameImpl::GetInterfaceRegistry() {
2487 return interface_registry_.get(); 2503 return interface_registry_.get();
2488 } 2504 }
2489 2505
2490 service_manager::InterfaceProvider* RenderFrameImpl::GetRemoteInterfaces() { 2506 service_manager::InterfaceProvider* RenderFrameImpl::GetRemoteInterfaces() {
2491 return remote_interfaces_.get(); 2507 return remote_interfaces_.get();
(...skipping 4057 matching lines...) Expand 10 before | Expand all | Expand 10 after
6549 // event target. Potentially a Pepper plugin will receive the event. 6565 // event target. Potentially a Pepper plugin will receive the event.
6550 // In order to tell whether a plugin gets the last mouse event and which it 6566 // In order to tell whether a plugin gets the last mouse event and which it
6551 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6567 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6552 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6568 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6553 // |pepper_last_mouse_event_target_|. 6569 // |pepper_last_mouse_event_target_|.
6554 pepper_last_mouse_event_target_ = nullptr; 6570 pepper_last_mouse_event_target_ = nullptr;
6555 #endif 6571 #endif
6556 } 6572 }
6557 6573
6558 } // namespace content 6574 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | net/base/net_error_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698