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

Unified Diff: content/browser/service_worker/service_worker_context_core.cc

Issue 654323003: Revert of Added quota client for serviceworker. Enables 'clear past <time> data'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_context_core.cc
diff --git a/content/browser/service_worker/service_worker_context_core.cc b/content/browser/service_worker/service_worker_context_core.cc
index 54a275f44f8af0157dc6702bc60ca7ed00fcba9c..cdd0efe95460427504af86d3e19059a089cfc828 100644
--- a/content/browser/service_worker/service_worker_context_core.cc
+++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -4,9 +4,6 @@
#include "content/browser/service_worker/service_worker_context_core.h"
-#include "base/barrier_closure.h"
-#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/files/file_path.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
@@ -25,25 +22,6 @@
#include "url/gurl.h"
namespace content {
-namespace {
-void SuccessCollectorCallback(const base::Closure& done_closure,
- bool* overall_success,
- ServiceWorkerStatusCode status) {
- if (status != ServiceWorkerStatusCode::SERVICE_WORKER_OK) {
- *overall_success = false;
- }
- done_closure.Run();
-}
-
-void SuccessReportingCallback(
- const bool* success,
- const ServiceWorkerContextCore::UnregistrationCallback& callback) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- bool result = *success;
- callback.Run(result ? ServiceWorkerStatusCode::SERVICE_WORKER_OK
- : ServiceWorkerStatusCode::SERVICE_WORKER_ERROR_FAILED);
-}
-} // namespace
const base::FilePath::CharType
ServiceWorkerContextCore::kServiceWorkerDirectory[] =
@@ -233,45 +211,6 @@
callback));
}
-void ServiceWorkerContextCore::UnregisterServiceWorkers(
- const GURL& origin,
- const UnregistrationCallback& callback) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- if (storage()->IsDisabled()) {
- // Not posting as new task to match implementations above.
- callback.Run(SERVICE_WORKER_ERROR_ABORT);
- return;
- }
-
- storage()->GetAllRegistrations(base::Bind(
- &ServiceWorkerContextCore::DidGetAllRegistrationsForUnregisterForOrigin,
- AsWeakPtr(),
- callback,
- origin));
-}
-
-void ServiceWorkerContextCore::DidGetAllRegistrationsForUnregisterForOrigin(
- const UnregistrationCallback& result,
- const GURL& origin,
- const std::vector<ServiceWorkerRegistrationInfo>& registrations) {
- std::set<GURL> scopes;
- for (const auto& registration_info : registrations) {
- if (origin == registration_info.pattern.GetOrigin()) {
- scopes.insert(registration_info.pattern);
- }
- }
- bool* overall_success = new bool(true);
- base::Closure barrier = base::BarrierClosure(
- scopes.size(),
- base::Bind(
- &SuccessReportingCallback, base::Owned(overall_success), result));
-
- for (const GURL& scope : scopes) {
- UnregisterServiceWorker(
- scope, base::Bind(&SuccessCollectorCallback, barrier, overall_success));
- }
-}
-
void ServiceWorkerContextCore::UpdateServiceWorker(
ServiceWorkerRegistration* registration) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);

Powered by Google App Engine
This is Rietveld 408576698