| 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_cache.h" | 5 #include "content/browser/service_worker/service_worker_cache.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/guid.h" | 10 #include "base/guid.h" |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 scoped_ptr<MatchContext> match_context) { | 768 scoped_ptr<MatchContext> match_context) { |
| 769 if (!match_context->blob_storage_context) { | 769 if (!match_context->blob_storage_context) { |
| 770 match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeStorage, | 770 match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeStorage, |
| 771 scoped_ptr<ServiceWorkerResponse>(), | 771 scoped_ptr<ServiceWorkerResponse>(), |
| 772 scoped_ptr<storage::BlobDataHandle>()); | 772 scoped_ptr<storage::BlobDataHandle>()); |
| 773 return; | 773 return; |
| 774 } | 774 } |
| 775 | 775 |
| 776 scoped_ptr<storage::BlobDataHandle> blob_data_handle( | 776 scoped_ptr<storage::BlobDataHandle> blob_data_handle( |
| 777 match_context->blob_storage_context->AddFinishedBlob( | 777 match_context->blob_storage_context->AddFinishedBlob( |
| 778 *match_context->blob_data.get())); | 778 match_context->blob_data.get())); |
| 779 | 779 |
| 780 match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeOK, | 780 match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeOK, |
| 781 match_context->response.Pass(), | 781 match_context->response.Pass(), |
| 782 blob_data_handle.Pass()); | 782 blob_data_handle.Pass()); |
| 783 } | 783 } |
| 784 | 784 |
| 785 void ServiceWorkerCache::PutImpl(scoped_ptr<PutContext> put_context) { | 785 void ServiceWorkerCache::PutImpl(scoped_ptr<PutContext> put_context) { |
| 786 DCHECK(backend_state_ != BACKEND_UNINITIALIZED); | 786 DCHECK(backend_state_ != BACKEND_UNINITIALIZED); |
| 787 if (backend_state_ != BACKEND_OPEN) { | 787 if (backend_state_ != BACKEND_OPEN) { |
| 788 put_context->callback.Run(ErrorTypeStorage, | 788 put_context->callback.Run(ErrorTypeStorage, |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1248 ErrorType error, | 1248 ErrorType error, |
| 1249 scoped_ptr<Requests> requests) { | 1249 scoped_ptr<Requests> requests) { |
| 1250 base::WeakPtr<ServiceWorkerCache> cache = weak_ptr_factory_.GetWeakPtr(); | 1250 base::WeakPtr<ServiceWorkerCache> cache = weak_ptr_factory_.GetWeakPtr(); |
| 1251 | 1251 |
| 1252 callback.Run(error, requests.Pass()); | 1252 callback.Run(error, requests.Pass()); |
| 1253 if (cache) | 1253 if (cache) |
| 1254 scheduler_->CompleteOperationAndRunNext(); | 1254 scheduler_->CompleteOperationAndRunNext(); |
| 1255 } | 1255 } |
| 1256 | 1256 |
| 1257 } // namespace content | 1257 } // namespace content |
| OLD | NEW |