| OLD | NEW |
| 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 4262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4273 provider_id = provider->provider_id(); | 4273 provider_id = provider->provider_id(); |
| 4274 } | 4274 } |
| 4275 } else if (frame->dataSource()) { | 4275 } else if (frame->dataSource()) { |
| 4276 ServiceWorkerNetworkProvider* provider = | 4276 ServiceWorkerNetworkProvider* provider = |
| 4277 ServiceWorkerNetworkProvider::FromDocumentState( | 4277 ServiceWorkerNetworkProvider::FromDocumentState( |
| 4278 DocumentState::FromDataSource(frame->dataSource())); | 4278 DocumentState::FromDataSource(frame->dataSource())); |
| 4279 DCHECK(provider); | 4279 DCHECK(provider); |
| 4280 provider_id = provider->provider_id(); | 4280 provider_id = provider->provider_id(); |
| 4281 // If the provider does not have a controller at this point, the renderer | 4281 // If the provider does not have a controller at this point, the renderer |
| 4282 // expects the request to never be handled by a controlling service worker, | 4282 // expects the request to never be handled by a controlling service worker, |
| 4283 // so set the SkipServiceWorker flag here. Otherwise, a service worker that | 4283 // so set the ServiceWorkerMode to skip local workers here. Otherwise, a |
| 4284 // is in the process of becoming the controller (i.e., via claim()) on the | 4284 // service worker that is in the process of becoming the controller (i.e., |
| 4285 // browser-side could handle the request and break the assumptions of the | 4285 // via claim()) on the browser-side could handle the request and break |
| 4286 // renderer. | 4286 // the assumptions of the renderer. |
| 4287 if (!provider->IsControlledByServiceWorker() && | 4287 if (!provider->IsControlledByServiceWorker() && |
| 4288 request.skipServiceWorker() != | 4288 request.getServiceWorkerMode() != |
| 4289 blink::WebURLRequest::SkipServiceWorker::All) { | 4289 blink::WebURLRequest::ServiceWorkerMode::None) { |
| 4290 request.setSkipServiceWorker( | 4290 request.setServiceWorkerMode( |
| 4291 blink::WebURLRequest::SkipServiceWorker::Controlling); | 4291 blink::WebURLRequest::ServiceWorkerMode::Foreign); |
| 4292 } | 4292 } |
| 4293 } | 4293 } |
| 4294 | 4294 |
| 4295 WebFrame* parent = frame->parent(); | 4295 WebFrame* parent = frame->parent(); |
| 4296 int parent_routing_id = parent ? GetRoutingIdForFrameOrProxy(parent) : -1; | 4296 int parent_routing_id = parent ? GetRoutingIdForFrameOrProxy(parent) : -1; |
| 4297 | 4297 |
| 4298 RequestExtraData* extra_data = new RequestExtraData(); | 4298 RequestExtraData* extra_data = new RequestExtraData(); |
| 4299 extra_data->set_visibility_state(visibilityState()); | 4299 extra_data->set_visibility_state(visibilityState()); |
| 4300 extra_data->set_custom_user_agent(custom_user_agent); | 4300 extra_data->set_custom_user_agent(custom_user_agent); |
| 4301 extra_data->set_requested_with(requested_with); | 4301 extra_data->set_requested_with(requested_with); |
| (...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6271 // Requests initiated via devtools can have caching disabled. | 6271 // Requests initiated via devtools can have caching disabled. |
| 6272 if (info.isCacheDisabled) { | 6272 if (info.isCacheDisabled) { |
| 6273 // Turn off all caching related flags and set LOAD_BYPASS_CACHE. | 6273 // Turn off all caching related flags and set LOAD_BYPASS_CACHE. |
| 6274 load_flags &= ~(net::LOAD_VALIDATE_CACHE | net::LOAD_SKIP_CACHE_VALIDATION | | 6274 load_flags &= ~(net::LOAD_VALIDATE_CACHE | net::LOAD_SKIP_CACHE_VALIDATION | |
| 6275 net::LOAD_ONLY_FROM_CACHE | net::LOAD_DISABLE_CACHE); | 6275 net::LOAD_ONLY_FROM_CACHE | net::LOAD_DISABLE_CACHE); |
| 6276 load_flags |= net::LOAD_BYPASS_CACHE; | 6276 load_flags |= net::LOAD_BYPASS_CACHE; |
| 6277 } | 6277 } |
| 6278 BeginNavigationParams begin_navigation_params( | 6278 BeginNavigationParams begin_navigation_params( |
| 6279 GetWebURLRequestHeaders(info.urlRequest), load_flags, | 6279 GetWebURLRequestHeaders(info.urlRequest), load_flags, |
| 6280 info.urlRequest.hasUserGesture(), | 6280 info.urlRequest.hasUserGesture(), |
| 6281 info.urlRequest.skipServiceWorker() != | 6281 info.urlRequest.getServiceWorkerMode() != |
| 6282 blink::WebURLRequest::SkipServiceWorker::None, | 6282 blink::WebURLRequest::ServiceWorkerMode::All, |
| 6283 GetRequestContextTypeForWebURLRequest(info.urlRequest), | 6283 GetRequestContextTypeForWebURLRequest(info.urlRequest), |
| 6284 GetMixedContentContextTypeForWebURLRequest(info.urlRequest), | 6284 GetMixedContentContextTypeForWebURLRequest(info.urlRequest), |
| 6285 initiator_origin); | 6285 initiator_origin); |
| 6286 | 6286 |
| 6287 if (!info.form.isNull()) { | 6287 if (!info.form.isNull()) { |
| 6288 WebSearchableFormData web_searchable_form_data(info.form); | 6288 WebSearchableFormData web_searchable_form_data(info.form); |
| 6289 begin_navigation_params.searchable_form_url = | 6289 begin_navigation_params.searchable_form_url = |
| 6290 web_searchable_form_data.url(); | 6290 web_searchable_form_data.url(); |
| 6291 begin_navigation_params.searchable_form_encoding = | 6291 begin_navigation_params.searchable_form_encoding = |
| 6292 web_searchable_form_data.encoding().utf8(); | 6292 web_searchable_form_data.encoding().utf8(); |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6841 // event target. Potentially a Pepper plugin will receive the event. | 6841 // event target. Potentially a Pepper plugin will receive the event. |
| 6842 // In order to tell whether a plugin gets the last mouse event and which it | 6842 // In order to tell whether a plugin gets the last mouse event and which it |
| 6843 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6843 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6844 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6844 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6845 // |pepper_last_mouse_event_target_|. | 6845 // |pepper_last_mouse_event_target_|. |
| 6846 pepper_last_mouse_event_target_ = nullptr; | 6846 pepper_last_mouse_event_target_ = nullptr; |
| 6847 #endif | 6847 #endif |
| 6848 } | 6848 } |
| 6849 | 6849 |
| 6850 } // namespace content | 6850 } // namespace content |
| OLD | NEW |