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

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

Issue 2488743003: (Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. (Closed)
Patch Set: Addressed comments (@alexmos #2) 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 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 std::string error_html; 2365 std::string error_html;
2366 GetContentClient()->renderer()->GetNavigationErrorStrings( 2366 GetContentClient()->renderer()->GetNavigationErrorStrings(
2367 this, failed_request, error, &error_html, nullptr); 2367 this, failed_request, error, &error_html, nullptr);
2368 2368
2369 blink::WebFrameLoadType frame_load_type = 2369 blink::WebFrameLoadType frame_load_type =
2370 entry ? blink::WebFrameLoadType::BackForward 2370 entry ? blink::WebFrameLoadType::BackForward
2371 : blink::WebFrameLoadType::Standard; 2371 : blink::WebFrameLoadType::Standard;
2372 const blink::WebHistoryItem& history_item = 2372 const blink::WebHistoryItem& history_item =
2373 entry ? entry->root() : blink::WebHistoryItem(); 2373 entry ? entry->root() : blink::WebHistoryItem();
2374 2374
2375 // Requests blocked by the X-Frame-Options HTTP response header don't display
2376 // error pages but a blank page instead.
2377 // TODO(alexmos, mkwst, arthursonzogni): This block can be removed once error
2378 // pages are refactored. See crbug.com/588314 and crbug.com/622385.
2379 if (error.reason == net::ERR_BLOCKED_BY_RESPONSE) {
2380 frame_->loadData("", WebString::fromUTF8("text/html"),
2381 WebString::fromUTF8("UTF-8"), GURL("data:,"), WebURL(),
2382 replace, frame_load_type, history_item,
2383 blink::WebHistoryDifferentDocumentLoad, false);
2384 return;
2385 }
2386
2375 frame_->loadData(error_html, WebString::fromUTF8("text/html"), 2387 frame_->loadData(error_html, WebString::fromUTF8("text/html"),
2376 WebString::fromUTF8("UTF-8"), GURL(kUnreachableWebDataURL), 2388 WebString::fromUTF8("UTF-8"), GURL(kUnreachableWebDataURL),
2377 error.unreachableURL, replace, frame_load_type, history_item, 2389 error.unreachableURL, replace, frame_load_type, history_item,
2378 blink::WebHistoryDifferentDocumentLoad, false); 2390 blink::WebHistoryDifferentDocumentLoad, false);
2379 } 2391 }
2380 2392
2381 void RenderFrameImpl::DidMeaningfulLayout( 2393 void RenderFrameImpl::DidMeaningfulLayout(
2382 blink::WebMeaningfulLayout layout_type) { 2394 blink::WebMeaningfulLayout layout_type) {
2383 for (auto& observer : observers_) 2395 for (auto& observer : observers_)
2384 observer.DidMeaningfulLayout(layout_type); 2396 observer.DidMeaningfulLayout(layout_type);
(...skipping 4307 matching lines...) Expand 10 before | Expand all | Expand 10 after
6692 // event target. Potentially a Pepper plugin will receive the event. 6704 // event target. Potentially a Pepper plugin will receive the event.
6693 // In order to tell whether a plugin gets the last mouse event and which it 6705 // In order to tell whether a plugin gets the last mouse event and which it
6694 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6706 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6695 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6707 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6696 // |pepper_last_mouse_event_target_|. 6708 // |pepper_last_mouse_event_target_|.
6697 pepper_last_mouse_event_target_ = nullptr; 6709 pepper_last_mouse_event_target_ = nullptr;
6698 #endif 6710 #endif
6699 } 6711 }
6700 6712
6701 } // namespace content 6713 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698