| 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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 scoped_ptr<MatchContext> match_context) { | 780 scoped_ptr<MatchContext> match_context) { |
| 781 if (!match_context->blob_storage_context) { | 781 if (!match_context->blob_storage_context) { |
| 782 match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeStorage, | 782 match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeStorage, |
| 783 scoped_ptr<ServiceWorkerResponse>(), | 783 scoped_ptr<ServiceWorkerResponse>(), |
| 784 scoped_ptr<storage::BlobDataHandle>()); | 784 scoped_ptr<storage::BlobDataHandle>()); |
| 785 return; | 785 return; |
| 786 } | 786 } |
| 787 | 787 |
| 788 scoped_ptr<storage::BlobDataHandle> blob_data_handle( | 788 scoped_ptr<storage::BlobDataHandle> blob_data_handle( |
| 789 match_context->blob_storage_context->AddFinishedBlob( | 789 match_context->blob_storage_context->AddFinishedBlob( |
| 790 *match_context->blob_data.get())); | 790 match_context->blob_data.get())); |
| 791 | 791 |
| 792 match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeOK, | 792 match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeOK, |
| 793 match_context->response.Pass(), | 793 match_context->response.Pass(), |
| 794 blob_data_handle.Pass()); | 794 blob_data_handle.Pass()); |
| 795 } | 795 } |
| 796 | 796 |
| 797 void ServiceWorkerCache::PutImpl(scoped_ptr<PutContext> put_context) { | 797 void ServiceWorkerCache::PutImpl(scoped_ptr<PutContext> put_context) { |
| 798 DCHECK(backend_state_ != BACKEND_UNINITIALIZED); | 798 DCHECK(backend_state_ != BACKEND_UNINITIALIZED); |
| 799 if (backend_state_ != BACKEND_OPEN) { | 799 if (backend_state_ != BACKEND_OPEN) { |
| 800 put_context->callback.Run(ErrorTypeStorage, | 800 put_context->callback.Run(ErrorTypeStorage, |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 | 1270 |
| 1271 void ServiceWorkerCache::PendingRequestsCallback( | 1271 void ServiceWorkerCache::PendingRequestsCallback( |
| 1272 const RequestsCallback& callback, | 1272 const RequestsCallback& callback, |
| 1273 ErrorType error, | 1273 ErrorType error, |
| 1274 scoped_ptr<Requests> requests) { | 1274 scoped_ptr<Requests> requests) { |
| 1275 callback.Run(error, requests.Pass()); | 1275 callback.Run(error, requests.Pass()); |
| 1276 CompleteOperationAndRunNext(); | 1276 CompleteOperationAndRunNext(); |
| 1277 } | 1277 } |
| 1278 | 1278 |
| 1279 } // namespace content | 1279 } // namespace content |
| OLD | NEW |