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, provider_host_->client_uuid(), | 104 request, network_delegate, blob_storage_context_, resource_context, |
105 blob_storage_context_, resource_context, request_mode_, credentials_mode_, | 105 request_mode_, credentials_mode_, redirect_mode_, is_main_resource_load_, |
106 redirect_mode_, is_main_resource_load_, request_context_type_, | 106 request_context_type_, frame_type_, body_, this)); |
107 frame_type_, body_, this)); | |
108 job_ = job->GetWeakPtr(); | 107 job_ = job->GetWeakPtr(); |
109 | 108 |
110 resource_context_ = resource_context; | 109 resource_context_ = resource_context; |
111 | 110 |
112 if (is_main_resource_load_) | 111 if (is_main_resource_load_) |
113 PrepareForMainResource(request); | 112 PrepareForMainResource(request); |
114 else | 113 else |
115 PrepareForSubResource(); | 114 PrepareForSubResource(); |
116 | 115 |
117 if (job_->ShouldFallbackToNetwork()) { | 116 if (job_->ShouldFallbackToNetwork()) { |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 void ServiceWorkerControlleeRequestHandler::ClearJob() { | 440 void ServiceWorkerControlleeRequestHandler::ClearJob() { |
442 job_.reset(); | 441 job_.reset(); |
443 was_fetched_via_service_worker_ = false; | 442 was_fetched_via_service_worker_ = false; |
444 was_fallback_required_ = false; | 443 was_fallback_required_ = false; |
445 original_url_via_service_worker_ = GURL(); | 444 original_url_via_service_worker_ = GURL(); |
446 response_type_via_service_worker_ = | 445 response_type_via_service_worker_ = |
447 blink::WebServiceWorkerResponseTypeDefault; | 446 blink::WebServiceWorkerResponseTypeDefault; |
448 } | 447 } |
449 | 448 |
450 } // namespace content | 449 } // namespace content |
OLD | NEW |