OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browser/service_worker/link_header_support.h" | 5 #include "content/browser/service_worker/link_header_support.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "content/browser/loader/resource_request_info_impl.h" | 10 #include "content/browser/loader/resource_request_info_impl.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 -1 /* render_frame_id */, resource_type == RESOURCE_TYPE_MAIN_FRAME, | 140 -1 /* render_frame_id */, resource_type == RESOURCE_TYPE_MAIN_FRAME, |
141 false /* parent_is_main_frame */, true /* allow_download */, | 141 false /* parent_is_main_frame */, true /* allow_download */, |
142 true /* is_async */, PREVIEWS_OFF /* previews_state */); | 142 true /* is_async */, PREVIEWS_OFF /* previews_state */); |
143 ResourceRequestInfoImpl::ForRequest(request.get()) | 143 ResourceRequestInfoImpl::ForRequest(request.get()) |
144 ->set_initiated_in_secure_context_for_testing(true); | 144 ->set_initiated_in_secure_context_for_testing(true); |
145 | 145 |
146 ServiceWorkerRequestHandler::InitializeHandler( | 146 ServiceWorkerRequestHandler::InitializeHandler( |
147 request.get(), context_wrapper(), &blob_storage_context_, | 147 request.get(), context_wrapper(), &blob_storage_context_, |
148 render_process_id(), provider_id, false /* skip_service_worker */, | 148 render_process_id(), provider_id, false /* skip_service_worker */, |
149 FETCH_REQUEST_MODE_NO_CORS, FETCH_CREDENTIALS_MODE_OMIT, | 149 FETCH_REQUEST_MODE_NO_CORS, FETCH_CREDENTIALS_MODE_OMIT, |
150 FetchRedirectMode::FOLLOW_MODE, resource_type, | 150 FetchRedirectMode::FOLLOW_MODE, std::string() /* integrity */, |
151 REQUEST_CONTEXT_TYPE_HYPERLINK, REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, | 151 resource_type, REQUEST_CONTEXT_TYPE_HYPERLINK, |
152 nullptr); | 152 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, nullptr); |
153 | 153 |
154 return request; | 154 return request; |
155 } | 155 } |
156 | 156 |
157 std::unique_ptr<net::URLRequest> CreateSubresourceRequest( | 157 std::unique_ptr<net::URLRequest> CreateSubresourceRequest( |
158 const GURL& request_url, | 158 const GURL& request_url, |
159 int provider_id) { | 159 int provider_id) { |
160 return CreateRequest(request_url, RESOURCE_TYPE_SCRIPT, provider_id); | 160 return CreateRequest(request_url, RESOURCE_TYPE_SCRIPT, provider_id); |
161 } | 161 } |
162 | 162 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 provider_host()->provider_id()) | 443 provider_host()->provider_id()) |
444 .get(), | 444 .get(), |
445 "<../foo.js>; rel=serviceworker", context_wrapper()); | 445 "<../foo.js>; rel=serviceworker", context_wrapper()); |
446 base::RunLoop().RunUntilIdle(); | 446 base::RunLoop().RunUntilIdle(); |
447 | 447 |
448 std::vector<ServiceWorkerRegistrationInfo> registrations = GetRegistrations(); | 448 std::vector<ServiceWorkerRegistrationInfo> registrations = GetRegistrations(); |
449 ASSERT_EQ(1u, registrations.size()); | 449 ASSERT_EQ(1u, registrations.size()); |
450 } | 450 } |
451 | 451 |
452 } // namespace content | 452 } // namespace content |
OLD | NEW |