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

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

Issue 2689653003: PlzNavigate: Enforce 'form-action' CSP on the browser-side. (Closed)
Patch Set: Rebase. Created 3 years, 10 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 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 6266 matching lines...) Expand 10 before | Expand all | Expand 10 after
6277 6277
6278 int load_flags = GetLoadFlagsForWebURLRequest(info.urlRequest); 6278 int load_flags = GetLoadFlagsForWebURLRequest(info.urlRequest);
6279 6279
6280 // Requests initiated via devtools can have caching disabled. 6280 // Requests initiated via devtools can have caching disabled.
6281 if (info.isCacheDisabled) { 6281 if (info.isCacheDisabled) {
6282 // Turn off all caching related flags and set LOAD_BYPASS_CACHE. 6282 // Turn off all caching related flags and set LOAD_BYPASS_CACHE.
6283 load_flags &= ~(net::LOAD_VALIDATE_CACHE | net::LOAD_SKIP_CACHE_VALIDATION | 6283 load_flags &= ~(net::LOAD_VALIDATE_CACHE | net::LOAD_SKIP_CACHE_VALIDATION |
6284 net::LOAD_ONLY_FROM_CACHE | net::LOAD_DISABLE_CACHE); 6284 net::LOAD_ONLY_FROM_CACHE | net::LOAD_DISABLE_CACHE);
6285 load_flags |= net::LOAD_BYPASS_CACHE; 6285 load_flags |= net::LOAD_BYPASS_CACHE;
6286 } 6286 }
6287
6288 bool is_form_submission =
6289 info.navigationType == blink::WebNavigationTypeFormSubmitted ||
6290 info.navigationType == blink::WebNavigationTypeFormResubmitted;
6291
6287 BeginNavigationParams begin_navigation_params( 6292 BeginNavigationParams begin_navigation_params(
6288 GetWebURLRequestHeaders(info.urlRequest), load_flags, 6293 GetWebURLRequestHeaders(info.urlRequest), load_flags,
6289 info.urlRequest.hasUserGesture(), 6294 info.urlRequest.hasUserGesture(),
6290 info.urlRequest.skipServiceWorker() != 6295 info.urlRequest.skipServiceWorker() !=
6291 blink::WebURLRequest::SkipServiceWorker::None, 6296 blink::WebURLRequest::SkipServiceWorker::None,
6292 GetRequestContextTypeForWebURLRequest(info.urlRequest), 6297 GetRequestContextTypeForWebURLRequest(info.urlRequest),
6293 GetMixedContentContextTypeForWebURLRequest(info.urlRequest), 6298 GetMixedContentContextTypeForWebURLRequest(info.urlRequest),
6294 initiator_origin); 6299 is_form_submission, initiator_origin);
6295 6300
6296 if (!info.form.isNull()) { 6301 if (!info.form.isNull()) {
6297 WebSearchableFormData web_searchable_form_data(info.form); 6302 WebSearchableFormData web_searchable_form_data(info.form);
6298 begin_navigation_params.searchable_form_url = 6303 begin_navigation_params.searchable_form_url =
6299 web_searchable_form_data.url(); 6304 web_searchable_form_data.url();
6300 begin_navigation_params.searchable_form_encoding = 6305 begin_navigation_params.searchable_form_encoding =
6301 web_searchable_form_data.encoding().utf8(); 6306 web_searchable_form_data.encoding().utf8();
6302 } 6307 }
6303 6308
6304 if (info.isClientRedirect) 6309 if (info.isClientRedirect)
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
6850 // event target. Potentially a Pepper plugin will receive the event. 6855 // event target. Potentially a Pepper plugin will receive the event.
6851 // In order to tell whether a plugin gets the last mouse event and which it 6856 // In order to tell whether a plugin gets the last mouse event and which it
6852 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6857 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6853 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6858 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6854 // |pepper_last_mouse_event_target_|. 6859 // |pepper_last_mouse_event_target_|.
6855 pepper_last_mouse_event_target_ = nullptr; 6860 pepper_last_mouse_event_target_ = nullptr;
6856 #endif 6861 #endif
6857 } 6862 }
6858 6863
6859 } // namespace content 6864 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698