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

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

Issue 895933007: [Storage] Blob items are now shared between blobs. Ready for disk swap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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_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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698