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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 -1 /* render_frame_id */, resource_type == RESOURCE_TYPE_MAIN_FRAME, | 139 -1 /* render_frame_id */, resource_type == RESOURCE_TYPE_MAIN_FRAME, |
140 false /* parent_is_main_frame */, true /* allow_download */, | 140 false /* parent_is_main_frame */, true /* allow_download */, |
141 true /* is_async */, PREVIEWS_OFF /* previews_state */); | 141 true /* is_async */, PREVIEWS_OFF /* previews_state */); |
142 ResourceRequestInfoImpl::ForRequest(request.get()) | 142 ResourceRequestInfoImpl::ForRequest(request.get()) |
143 ->set_initiated_in_secure_context_for_testing(true); | 143 ->set_initiated_in_secure_context_for_testing(true); |
144 | 144 |
145 ServiceWorkerRequestHandler::InitializeHandler( | 145 ServiceWorkerRequestHandler::InitializeHandler( |
146 request.get(), context_wrapper(), &blob_storage_context_, | 146 request.get(), context_wrapper(), &blob_storage_context_, |
147 render_process_id(), provider_id, false /* skip_service_worker */, | 147 render_process_id(), provider_id, false /* skip_service_worker */, |
148 FETCH_REQUEST_MODE_NO_CORS, FETCH_CREDENTIALS_MODE_OMIT, | 148 FETCH_REQUEST_MODE_NO_CORS, FETCH_CREDENTIALS_MODE_OMIT, |
149 FetchRedirectMode::FOLLOW_MODE, resource_type, | 149 FetchRedirectMode::FOLLOW_MODE, "" /*integrity*/, resource_type, |
falken
2017/07/07 00:56:10
ditto
xiaofengzhang
2017/07/12 09:13:52
Done.
| |
150 REQUEST_CONTEXT_TYPE_HYPERLINK, REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, | 150 REQUEST_CONTEXT_TYPE_HYPERLINK, REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, |
151 nullptr); | 151 nullptr); |
152 | 152 |
153 return request; | 153 return request; |
154 } | 154 } |
155 | 155 |
156 std::unique_ptr<net::URLRequest> CreateSubresourceRequest( | 156 std::unique_ptr<net::URLRequest> CreateSubresourceRequest( |
157 const GURL& request_url, | 157 const GURL& request_url, |
158 int provider_id) { | 158 int provider_id) { |
159 return CreateRequest(request_url, RESOURCE_TYPE_SCRIPT, provider_id); | 159 return CreateRequest(request_url, RESOURCE_TYPE_SCRIPT, provider_id); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
442 provider_host()->provider_id()) | 442 provider_host()->provider_id()) |
443 .get(), | 443 .get(), |
444 "<../foo.js>; rel=serviceworker", context_wrapper()); | 444 "<../foo.js>; rel=serviceworker", context_wrapper()); |
445 base::RunLoop().RunUntilIdle(); | 445 base::RunLoop().RunUntilIdle(); |
446 | 446 |
447 std::vector<ServiceWorkerRegistrationInfo> registrations = GetRegistrations(); | 447 std::vector<ServiceWorkerRegistrationInfo> registrations = GetRegistrations(); |
448 ASSERT_EQ(1u, registrations.size()); | 448 ASSERT_EQ(1u, registrations.size()); |
449 } | 449 } |
450 | 450 |
451 } // namespace content | 451 } // namespace content |
OLD | NEW |