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

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: properly initialize new ResourceRequest member 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 4007 matching lines...) Expand 10 before | Expand all | Expand 10 after
4018 extra_data->set_transferred_request_request_id( 4018 extra_data->set_transferred_request_request_id(
4019 navigation_state->start_params().transferred_request_request_id); 4019 navigation_state->start_params().transferred_request_request_id);
4020 extra_data->set_service_worker_provider_id(provider_id); 4020 extra_data->set_service_worker_provider_id(provider_id);
4021 extra_data->set_stream_override(std::move(stream_override)); 4021 extra_data->set_stream_override(std::move(stream_override));
4022 if (request.getLoFiState() != WebURLRequest::LoFiUnspecified) 4022 if (request.getLoFiState() != WebURLRequest::LoFiUnspecified)
4023 extra_data->set_lofi_state(static_cast<LoFiState>(request.getLoFiState())); 4023 extra_data->set_lofi_state(static_cast<LoFiState>(request.getLoFiState()));
4024 else if (is_main_frame_ && !navigation_state->request_committed()) 4024 else if (is_main_frame_ && !navigation_state->request_committed())
4025 extra_data->set_lofi_state(navigation_state->common_params().lofi_state); 4025 extra_data->set_lofi_state(navigation_state->common_params().lofi_state);
4026 else 4026 else
4027 extra_data->set_lofi_state(is_using_lofi_ ? LOFI_ON : LOFI_OFF); 4027 extra_data->set_lofi_state(is_using_lofi_ ? LOFI_ON : LOFI_OFF);
4028 WebString error;
4029 extra_data->set_initiated_in_secure_context(
4030 frame->document().isSecureContext(error));
4028 request.setExtraData(extra_data); 4031 request.setExtraData(extra_data);
4029 4032
4030 // TODO(creis): Update prefetching to work with out-of-process iframes. 4033 // TODO(creis): Update prefetching to work with out-of-process iframes.
4031 WebFrame* top_frame = frame->top(); 4034 WebFrame* top_frame = frame->top();
4032 if (top_frame && top_frame->isWebLocalFrame()) { 4035 if (top_frame && top_frame->isWebLocalFrame()) {
4033 DocumentState* top_document_state = 4036 DocumentState* top_document_state =
4034 DocumentState::FromDataSource(top_frame->dataSource()); 4037 DocumentState::FromDataSource(top_frame->dataSource());
4035 if (top_document_state) { 4038 if (top_document_state) {
4036 // TODO(gavinp): separate out prefetching and prerender field trials 4039 // TODO(gavinp): separate out prefetching and prerender field trials
4037 // if the rel=prerender rel type is sticking around. 4040 // if the rel=prerender rel type is sticking around.
(...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after
6235 // event target. Potentially a Pepper plugin will receive the event. 6238 // event target. Potentially a Pepper plugin will receive the event.
6236 // In order to tell whether a plugin gets the last mouse event and which it 6239 // In order to tell whether a plugin gets the last mouse event and which it
6237 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6240 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6238 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6241 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6239 // |pepper_last_mouse_event_target_|. 6242 // |pepper_last_mouse_event_target_|.
6240 pepper_last_mouse_event_target_ = nullptr; 6243 pepper_last_mouse_event_target_ = nullptr;
6241 #endif 6244 #endif
6242 } 6245 }
6243 6246
6244 } // namespace content 6247 } // namespace content
OLDNEW
« no previous file with comments | « content/common/resource_request.h ('k') | third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-basics.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698