Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: content/browser/service_worker/service_worker_context_request_handler.cc

Issue 293083002: Add a blob field to ServiceWorkerFetchResponse and read the blob (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix merge conflict Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_context_request_handler. h" 5 #include "content/browser/service_worker/service_worker_context_request_handler. h"
6 6
7 #include "content/browser/service_worker/service_worker_context_core.h" 7 #include "content/browser/service_worker/service_worker_context_core.h"
8 #include "content/browser/service_worker/service_worker_provider_host.h" 8 #include "content/browser/service_worker/service_worker_provider_host.h"
9 #include "content/browser/service_worker/service_worker_read_from_cache_job.h" 9 #include "content/browser/service_worker/service_worker_read_from_cache_job.h"
10 #include "content/browser/service_worker/service_worker_storage.h" 10 #include "content/browser/service_worker/service_worker_storage.h"
11 #include "content/browser/service_worker/service_worker_version.h" 11 #include "content/browser/service_worker/service_worker_version.h"
12 #include "content/browser/service_worker/service_worker_write_to_cache_job.h" 12 #include "content/browser/service_worker/service_worker_write_to_cache_job.h"
13 #include "net/url_request/url_request.h" 13 #include "net/url_request/url_request.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 ServiceWorkerContextRequestHandler::ServiceWorkerContextRequestHandler( 17 ServiceWorkerContextRequestHandler::ServiceWorkerContextRequestHandler(
18 base::WeakPtr<ServiceWorkerContextCore> context, 18 base::WeakPtr<ServiceWorkerContextCore> context,
19 base::WeakPtr<ServiceWorkerProviderHost> provider_host, 19 base::WeakPtr<ServiceWorkerProviderHost> provider_host,
20 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context,
20 ResourceType::Type resource_type) 21 ResourceType::Type resource_type)
21 : ServiceWorkerRequestHandler(context, provider_host, resource_type), 22 : ServiceWorkerRequestHandler(context,
23 provider_host,
24 blob_storage_context,
25 resource_type),
22 version_(provider_host_->running_hosted_version()) { 26 version_(provider_host_->running_hosted_version()) {
23 DCHECK(provider_host_->IsHostToRunningServiceWorker()); 27 DCHECK(provider_host_->IsHostToRunningServiceWorker());
24 } 28 }
25 29
26 ServiceWorkerContextRequestHandler::~ServiceWorkerContextRequestHandler() { 30 ServiceWorkerContextRequestHandler::~ServiceWorkerContextRequestHandler() {
27 } 31 }
28 32
29 net::URLRequestJob* ServiceWorkerContextRequestHandler::MaybeCreateJob( 33 net::URLRequestJob* ServiceWorkerContextRequestHandler::MaybeCreateJob(
30 net::URLRequest* request, 34 net::URLRequest* request,
31 net::NetworkDelegate* network_delegate) { 35 net::NetworkDelegate* network_delegate) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 const GURL& url, int64* response_id_out) { 81 const GURL& url, int64* response_id_out) {
78 // We don't read from the script cache until the version is INSTALLED. 82 // We don't read from the script cache until the version is INSTALLED.
79 if (version_->status() == ServiceWorkerVersion::NEW || 83 if (version_->status() == ServiceWorkerVersion::NEW ||
80 version_->status() == ServiceWorkerVersion::INSTALLING) 84 version_->status() == ServiceWorkerVersion::INSTALLING)
81 return false; 85 return false;
82 *response_id_out = version_->script_cache_map()->Lookup(url); 86 *response_id_out = version_->script_cache_map()->Lookup(url);
83 return *response_id_out != kInvalidServiceWorkerResponseId; 87 return *response_id_out != kInvalidServiceWorkerResponseId;
84 } 88 }
85 89
86 } // namespace content 90 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698