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

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: Words. Created 4 years, 1 month 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 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 2493 matching lines...) Expand 10 before | Expand all | Expand 10 after
2504 #endif 2504 #endif
2505 #endif 2505 #endif
2506 return NULL; 2506 return NULL;
2507 } 2507 }
2508 2508
2509 void RenderFrameImpl::LoadURLExternally(const blink::WebURLRequest& request, 2509 void RenderFrameImpl::LoadURLExternally(const blink::WebURLRequest& request,
2510 blink::WebNavigationPolicy policy) { 2510 blink::WebNavigationPolicy policy) {
2511 loadURLExternally(request, policy, WebString(), false); 2511 loadURLExternally(request, policy, WebString(), false);
2512 } 2512 }
2513 2513
2514 void RenderFrameImpl::loadErrorPage(int reason) {
2515 blink::WebURLError error;
2516 error.unreachableURL = frame_->document().url();
2517 error.domain = WebString::fromUTF8(net::kErrorDomain);
2518 error.reason = reason;
2519
2520 std::string error_html;
2521 GetContentClient()->renderer()->GetNavigationErrorStrings(
2522 this, frame_->dataSource()->request(), error, &error_html, nullptr);
2523
2524 frame_->loadData(error_html, WebString::fromUTF8("text/html"),
2525 WebString::fromUTF8("UTF-8"), GURL(kUnreachableWebDataURL),
2526 error.unreachableURL, true,
2527 blink::WebFrameLoadType::Standard, blink::WebHistoryItem(),
2528 blink::WebHistoryDifferentDocumentLoad, true);
2529 }
2530
2514 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { 2531 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) {
2515 OnJavaScriptExecuteRequest(javascript, 0, false); 2532 OnJavaScriptExecuteRequest(javascript, 0, false);
2516 } 2533 }
2517 2534
2518 service_manager::InterfaceRegistry* RenderFrameImpl::GetInterfaceRegistry() { 2535 service_manager::InterfaceRegistry* RenderFrameImpl::GetInterfaceRegistry() {
2519 return interface_registry_.get(); 2536 return interface_registry_.get();
2520 } 2537 }
2521 2538
2522 service_manager::InterfaceProvider* RenderFrameImpl::GetRemoteInterfaces() { 2539 service_manager::InterfaceProvider* RenderFrameImpl::GetRemoteInterfaces() {
2523 return remote_interfaces_.get(); 2540 return remote_interfaces_.get();
(...skipping 4107 matching lines...) Expand 10 before | Expand all | Expand 10 after
6631 // event target. Potentially a Pepper plugin will receive the event. 6648 // event target. Potentially a Pepper plugin will receive the event.
6632 // In order to tell whether a plugin gets the last mouse event and which it 6649 // In order to tell whether a plugin gets the last mouse event and which it
6633 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6650 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6634 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6651 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6635 // |pepper_last_mouse_event_target_|. 6652 // |pepper_last_mouse_event_target_|.
6636 pepper_last_mouse_event_target_ = nullptr; 6653 pepper_last_mouse_event_target_ = nullptr;
6637 #endif 6654 #endif
6638 } 6655 }
6639 6656
6640 } // namespace content 6657 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698