OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/service_worker_controllee_request_handl
er.h" | 5 #include "content/browser/service_worker/service_worker_controllee_request_handl
er.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // Once a subresource request has fallen back to the network once, it will | 94 // Once a subresource request has fallen back to the network once, it will |
95 // never be handled by a service worker. This is not true of main frame | 95 // never be handled by a service worker. This is not true of main frame |
96 // requests. | 96 // requests. |
97 if (is_main_resource_load_) | 97 if (is_main_resource_load_) |
98 use_network_ = false; | 98 use_network_ = false; |
99 return NULL; | 99 return NULL; |
100 } | 100 } |
101 | 101 |
102 // It's for original request (A) or redirect case (B-a or B-b). | 102 // It's for original request (A) or redirect case (B-a or B-b). |
103 scoped_ptr<ServiceWorkerURLRequestJob> job(new ServiceWorkerURLRequestJob( | 103 scoped_ptr<ServiceWorkerURLRequestJob> job(new ServiceWorkerURLRequestJob( |
104 request, network_delegate, blob_storage_context_, resource_context, | 104 request, network_delegate, provider_host_->client_uuid(), |
105 request_mode_, credentials_mode_, redirect_mode_, is_main_resource_load_, | 105 blob_storage_context_, resource_context, request_mode_, credentials_mode_, |
106 request_context_type_, frame_type_, body_, this)); | 106 redirect_mode_, is_main_resource_load_, request_context_type_, |
| 107 frame_type_, body_, this)); |
107 job_ = job->GetWeakPtr(); | 108 job_ = job->GetWeakPtr(); |
108 | 109 |
109 resource_context_ = resource_context; | 110 resource_context_ = resource_context; |
110 | 111 |
111 if (is_main_resource_load_) | 112 if (is_main_resource_load_) |
112 PrepareForMainResource(request); | 113 PrepareForMainResource(request); |
113 else | 114 else |
114 PrepareForSubResource(); | 115 PrepareForSubResource(); |
115 | 116 |
116 if (job_->ShouldFallbackToNetwork()) { | 117 if (job_->ShouldFallbackToNetwork()) { |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 void ServiceWorkerControlleeRequestHandler::ClearJob() { | 441 void ServiceWorkerControlleeRequestHandler::ClearJob() { |
441 job_.reset(); | 442 job_.reset(); |
442 was_fetched_via_service_worker_ = false; | 443 was_fetched_via_service_worker_ = false; |
443 was_fallback_required_ = false; | 444 was_fallback_required_ = false; |
444 original_url_via_service_worker_ = GURL(); | 445 original_url_via_service_worker_ = GURL(); |
445 response_type_via_service_worker_ = | 446 response_type_via_service_worker_ = |
446 blink::WebServiceWorkerResponseTypeDefault; | 447 blink::WebServiceWorkerResponseTypeDefault; |
447 } | 448 } |
448 | 449 |
449 } // namespace content | 450 } // namespace content |
OLD | NEW |