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

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

Issue 2032653003: Limit foreign fetch to only intercept requests made from secure contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 3895 matching lines...) Expand 10 before | Expand all | Expand 10 after
3906 extra_data->set_transferred_request_request_id( 3906 extra_data->set_transferred_request_request_id(
3907 navigation_state->start_params().transferred_request_request_id); 3907 navigation_state->start_params().transferred_request_request_id);
3908 extra_data->set_service_worker_provider_id(provider_id); 3908 extra_data->set_service_worker_provider_id(provider_id);
3909 extra_data->set_stream_override(std::move(stream_override)); 3909 extra_data->set_stream_override(std::move(stream_override));
3910 if (request.getLoFiState() != WebURLRequest::LoFiUnspecified) 3910 if (request.getLoFiState() != WebURLRequest::LoFiUnspecified)
3911 extra_data->set_lofi_state(static_cast<LoFiState>(request.getLoFiState())); 3911 extra_data->set_lofi_state(static_cast<LoFiState>(request.getLoFiState()));
3912 else if (is_main_frame_ && !navigation_state->request_committed()) 3912 else if (is_main_frame_ && !navigation_state->request_committed())
3913 extra_data->set_lofi_state(navigation_state->common_params().lofi_state); 3913 extra_data->set_lofi_state(navigation_state->common_params().lofi_state);
3914 else 3914 else
3915 extra_data->set_lofi_state(is_using_lofi_ ? LOFI_ON : LOFI_OFF); 3915 extra_data->set_lofi_state(is_using_lofi_ ? LOFI_ON : LOFI_OFF);
3916 WebString error;
3917 extra_data->set_initiated_in_secure_context(
3918 frame->document().isSecureContext(error));
3916 request.setExtraData(extra_data); 3919 request.setExtraData(extra_data);
3917 3920
3918 // TODO(creis): Update prefetching to work with out-of-process iframes. 3921 // TODO(creis): Update prefetching to work with out-of-process iframes.
3919 WebFrame* top_frame = frame->top(); 3922 WebFrame* top_frame = frame->top();
3920 if (top_frame && top_frame->isWebLocalFrame()) { 3923 if (top_frame && top_frame->isWebLocalFrame()) {
3921 DocumentState* top_document_state = 3924 DocumentState* top_document_state =
3922 DocumentState::FromDataSource(top_frame->dataSource()); 3925 DocumentState::FromDataSource(top_frame->dataSource());
3923 if (top_document_state) { 3926 if (top_document_state) {
3924 // TODO(gavinp): separate out prefetching and prerender field trials 3927 // TODO(gavinp): separate out prefetching and prerender field trials
3925 // if the rel=prerender rel type is sticking around. 3928 // if the rel=prerender rel type is sticking around.
(...skipping 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after
6154 // event target. Potentially a Pepper plugin will receive the event. 6157 // event target. Potentially a Pepper plugin will receive the event.
6155 // In order to tell whether a plugin gets the last mouse event and which it 6158 // In order to tell whether a plugin gets the last mouse event and which it
6156 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6159 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6157 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6160 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6158 // |pepper_last_mouse_event_target_|. 6161 // |pepper_last_mouse_event_target_|.
6159 pepper_last_mouse_event_target_ = nullptr; 6162 pepper_last_mouse_event_target_ = nullptr;
6160 #endif 6163 #endif
6161 } 6164 }
6162 6165
6163 } // namespace content 6166 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698