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

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

Issue 2488743003: (Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. (Closed)
Patch Set: Rebase Created 4 years 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 2356 matching lines...) Expand 10 before | Expand all | Expand 10 after
2367 std::string error_html; 2367 std::string error_html;
2368 GetContentClient()->renderer()->GetNavigationErrorStrings( 2368 GetContentClient()->renderer()->GetNavigationErrorStrings(
2369 this, failed_request, error, &error_html, nullptr); 2369 this, failed_request, error, &error_html, nullptr);
2370 2370
2371 blink::WebFrameLoadType frame_load_type = 2371 blink::WebFrameLoadType frame_load_type =
2372 entry ? blink::WebFrameLoadType::BackForward 2372 entry ? blink::WebFrameLoadType::BackForward
2373 : blink::WebFrameLoadType::Standard; 2373 : blink::WebFrameLoadType::Standard;
2374 const blink::WebHistoryItem& history_item = 2374 const blink::WebHistoryItem& history_item =
2375 entry ? entry->root() : blink::WebHistoryItem(); 2375 entry ? entry->root() : blink::WebHistoryItem();
2376 2376
2377 // Requests blocked by the X-Frame-Options HTTP response header doesn't
2378 // display error pages but a blank pages instead.
clamy 2016/12/06 17:09:44 nit:s/pages/page
2379 // TODO(alexmos, mkwst, arthursonzogni): This block can be removed once error
2380 // pages are refactored. See crbug.com/588314 and crbug.com/622385.
2381 if (error.reason == net::ERR_BLOCKED_BY_RESPONSE) {
2382 frame_->loadData("", WebString::fromUTF8("text/html"),
2383 WebString::fromUTF8("UTF-8"), GURL("data:,"), WebURL(),
2384 replace, frame_load_type, history_item,
2385 blink::WebHistoryDifferentDocumentLoad, false);
2386 return;
2387 }
2388
2377 frame_->loadData(error_html, WebString::fromUTF8("text/html"), 2389 frame_->loadData(error_html, WebString::fromUTF8("text/html"),
2378 WebString::fromUTF8("UTF-8"), GURL(kUnreachableWebDataURL), 2390 WebString::fromUTF8("UTF-8"), GURL(kUnreachableWebDataURL),
2379 error.unreachableURL, replace, frame_load_type, history_item, 2391 error.unreachableURL, replace, frame_load_type, history_item,
2380 blink::WebHistoryDifferentDocumentLoad, false); 2392 blink::WebHistoryDifferentDocumentLoad, false);
2381 } 2393 }
2382 2394
2383 void RenderFrameImpl::DidMeaningfulLayout( 2395 void RenderFrameImpl::DidMeaningfulLayout(
2384 blink::WebMeaningfulLayout layout_type) { 2396 blink::WebMeaningfulLayout layout_type) {
2385 for (auto& observer : observers_) 2397 for (auto& observer : observers_)
2386 observer.DidMeaningfulLayout(layout_type); 2398 observer.DidMeaningfulLayout(layout_type);
(...skipping 4284 matching lines...) Expand 10 before | Expand all | Expand 10 after
6671 // event target. Potentially a Pepper plugin will receive the event. 6683 // event target. Potentially a Pepper plugin will receive the event.
6672 // In order to tell whether a plugin gets the last mouse event and which it 6684 // In order to tell whether a plugin gets the last mouse event and which it
6673 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6685 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6674 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6686 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6675 // |pepper_last_mouse_event_target_|. 6687 // |pepper_last_mouse_event_target_|.
6676 pepper_last_mouse_event_target_ = nullptr; 6688 pepper_last_mouse_event_target_ = nullptr;
6677 #endif 6689 #endif
6678 } 6690 }
6679 6691
6680 } // namespace content 6692 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698