| 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_internals_ui.h" | 5 #include "content/browser/service_worker/service_worker_internals_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 partition_id, | 397 partition_id, |
| 398 context_path)); | 398 context_path)); |
| 399 } | 399 } |
| 400 | 400 |
| 401 void ServiceWorkerInternalsUI::OperationProxy::UnregisterOnIOThread( | 401 void ServiceWorkerInternalsUI::OperationProxy::UnregisterOnIOThread( |
| 402 scoped_refptr<ServiceWorkerContextWrapper> context, | 402 scoped_refptr<ServiceWorkerContextWrapper> context, |
| 403 const GURL& scope) { | 403 const GURL& scope) { |
| 404 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 404 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 405 context->context()->UnregisterServiceWorker( | 405 context->context()->UnregisterServiceWorker( |
| 406 scope, | 406 scope, |
| 407 0, // render process id? | |
| 408 NULL, // provider_host | |
| 409 base::Bind(&ServiceWorkerInternalsUI::OperationProxy::OperationComplete, | 407 base::Bind(&ServiceWorkerInternalsUI::OperationProxy::OperationComplete, |
| 410 this)); | 408 this)); |
| 411 } | 409 } |
| 412 | 410 |
| 413 void ServiceWorkerInternalsUI::OperationProxy::StartWorkerOnIOThread( | 411 void ServiceWorkerInternalsUI::OperationProxy::StartWorkerOnIOThread( |
| 414 scoped_refptr<ServiceWorkerContextWrapper> context, | 412 scoped_refptr<ServiceWorkerContextWrapper> context, |
| 415 const GURL& scope) { | 413 const GURL& scope) { |
| 416 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 414 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 417 // TODO(alecflett): Add support for starting/stopping workers for | 415 // TODO(alecflett): Add support for starting/stopping workers for |
| 418 // pending versions too. | 416 // pending versions too. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 ServiceWorkerVersion::ACTIVE) { | 595 ServiceWorkerVersion::ACTIVE) { |
| 598 registration->active_version()->DispatchSyncEvent(base::Bind( | 596 registration->active_version()->DispatchSyncEvent(base::Bind( |
| 599 &ServiceWorkerInternalsUI::OperationProxy::OperationComplete, this)); | 597 &ServiceWorkerInternalsUI::OperationProxy::OperationComplete, this)); |
| 600 return; | 598 return; |
| 601 } | 599 } |
| 602 | 600 |
| 603 OperationComplete(SERVICE_WORKER_ERROR_FAILED); | 601 OperationComplete(SERVICE_WORKER_ERROR_FAILED); |
| 604 } | 602 } |
| 605 | 603 |
| 606 } // namespace content | 604 } // namespace content |
| OLD | NEW |