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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, provider_host_->client_uuid(), |
105 blob_storage_context_, resource_context, request_mode_, credentials_mode_, | 105 blob_storage_context_, resource_context, request_mode_, credentials_mode_, |
106 redirect_mode_, is_main_resource_load_, request_context_type_, | 106 redirect_mode_, resource_type_, request_context_type_, frame_type_, body_, |
107 frame_type_, body_, ServiceWorkerFetchType::FETCH, this)); | 107 ServiceWorkerFetchType::FETCH, this)); |
108 job_ = job->GetWeakPtr(); | 108 job_ = job->GetWeakPtr(); |
109 | 109 |
110 resource_context_ = resource_context; | 110 resource_context_ = resource_context; |
111 | 111 |
112 if (is_main_resource_load_) | 112 if (is_main_resource_load_) |
113 PrepareForMainResource(request); | 113 PrepareForMainResource(request); |
114 else | 114 else |
115 PrepareForSubResource(); | 115 PrepareForSubResource(); |
116 | 116 |
117 if (job_->ShouldFallbackToNetwork()) { | 117 if (job_->ShouldFallbackToNetwork()) { |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 void ServiceWorkerControlleeRequestHandler::ClearJob() { | 455 void ServiceWorkerControlleeRequestHandler::ClearJob() { |
456 job_.reset(); | 456 job_.reset(); |
457 was_fetched_via_service_worker_ = false; | 457 was_fetched_via_service_worker_ = false; |
458 was_fallback_required_ = false; | 458 was_fallback_required_ = false; |
459 original_url_via_service_worker_ = GURL(); | 459 original_url_via_service_worker_ = GURL(); |
460 response_type_via_service_worker_ = | 460 response_type_via_service_worker_ = |
461 blink::WebServiceWorkerResponseTypeDefault; | 461 blink::WebServiceWorkerResponseTypeDefault; |
462 } | 462 } |
463 | 463 |
464 } // namespace content | 464 } // namespace content |
OLD | NEW |