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

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: Cleanup and added one more histogram 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 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698