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

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

Issue 307503003: ServiceWorker: Print error message when failed to open diskcache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use net::ErrorToString() Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_storage.h" 5 #include "content/browser/service_worker/service_worker_storage.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 base::Bind(&ServiceWorkerStorage::OnDiskCacheInitialized, 687 base::Bind(&ServiceWorkerStorage::OnDiskCacheInitialized,
688 weak_factory_.GetWeakPtr())); 688 weak_factory_.GetWeakPtr()));
689 if (rv != net::ERR_IO_PENDING) 689 if (rv != net::ERR_IO_PENDING)
690 OnDiskCacheInitialized(rv); 690 OnDiskCacheInitialized(rv);
691 691
692 return disk_cache_.get(); 692 return disk_cache_.get();
693 } 693 }
694 694
695 void ServiceWorkerStorage::OnDiskCacheInitialized(int rv) { 695 void ServiceWorkerStorage::OnDiskCacheInitialized(int rv) {
696 if (rv != net::OK) { 696 if (rv != net::OK) {
697 LOG(ERROR) << "Failed to open the serviceworker diskcache."; 697 LOG(ERROR) << "Failed to open the serviceworker diskcache: "
698 << net::ErrorToString(rv);
698 // TODO(michaeln): DeleteAndStartOver() 699 // TODO(michaeln): DeleteAndStartOver()
699 disk_cache_->Disable(); 700 disk_cache_->Disable();
700 state_ = DISABLED; 701 state_ = DISABLED;
701 } 702 }
702 } 703 }
703 704
704 void ServiceWorkerStorage::StartPurgingResources( 705 void ServiceWorkerStorage::StartPurgingResources(
705 const std::vector<int64>& ids) { 706 const std::vector<int64>& ids) {
706 for (size_t i = 0; i < ids.size(); ++i) 707 for (size_t i = 0; i < ids.size(); ++i)
707 purgeable_reource_ids_.push_back(ids[i]); 708 purgeable_reource_ids_.push_back(ids[i]);
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 const FindInDBCallback& callback) { 901 const FindInDBCallback& callback) {
901 ServiceWorkerDatabase::RegistrationData data; 902 ServiceWorkerDatabase::RegistrationData data;
902 ResourceList resources; 903 ResourceList resources;
903 ServiceWorkerDatabase::Status status = 904 ServiceWorkerDatabase::Status status =
904 database->ReadRegistration(registration_id, origin, &data, &resources); 905 database->ReadRegistration(registration_id, origin, &data, &resources);
905 original_task_runner->PostTask( 906 original_task_runner->PostTask(
906 FROM_HERE, base::Bind(callback, data, resources, status)); 907 FROM_HERE, base::Bind(callback, data, resources, status));
907 } 908 }
908 909
909 } // namespace content 910 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698