| 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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 "serviceworker.onOperationComplete", | 560 "serviceworker.onOperationComplete", |
| 561 std::vector<const Value*>(original_args_->begin(), | 561 std::vector<const Value*>(original_args_->begin(), |
| 562 original_args_->end())); | 562 original_args_->end())); |
| 563 } | 563 } |
| 564 | 564 |
| 565 void ServiceWorkerInternalsUI::OperationProxy::StartActiveWorker( | 565 void ServiceWorkerInternalsUI::OperationProxy::StartActiveWorker( |
| 566 ServiceWorkerStatusCode status, | 566 ServiceWorkerStatusCode status, |
| 567 const scoped_refptr<ServiceWorkerRegistration>& registration) { | 567 const scoped_refptr<ServiceWorkerRegistration>& registration) { |
| 568 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 568 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 569 if (status == SERVICE_WORKER_OK) { | 569 if (status == SERVICE_WORKER_OK) { |
| 570 registration->active_version()->StartWorker(base::Bind( | 570 registration->active_version()->StartWorker( |
| 571 &ServiceWorkerInternalsUI::OperationProxy::OperationComplete, this)); | 571 base::Bind(&ServiceWorkerInternalsUI::OperationProxy::OperationComplete, |
| 572 this), |
| 573 std::vector<int>()); |
| 572 return; | 574 return; |
| 573 } | 575 } |
| 574 | 576 |
| 575 OperationComplete(status); | 577 OperationComplete(status); |
| 576 } | 578 } |
| 577 | 579 |
| 578 void ServiceWorkerInternalsUI::OperationProxy::StopActiveWorker( | 580 void ServiceWorkerInternalsUI::OperationProxy::StopActiveWorker( |
| 579 ServiceWorkerStatusCode status, | 581 ServiceWorkerStatusCode status, |
| 580 const scoped_refptr<ServiceWorkerRegistration>& registration) { | 582 const scoped_refptr<ServiceWorkerRegistration>& registration) { |
| 581 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 583 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 597 ServiceWorkerVersion::ACTIVE) { | 599 ServiceWorkerVersion::ACTIVE) { |
| 598 registration->active_version()->DispatchSyncEvent(base::Bind( | 600 registration->active_version()->DispatchSyncEvent(base::Bind( |
| 599 &ServiceWorkerInternalsUI::OperationProxy::OperationComplete, this)); | 601 &ServiceWorkerInternalsUI::OperationProxy::OperationComplete, this)); |
| 600 return; | 602 return; |
| 601 } | 603 } |
| 602 | 604 |
| 603 OperationComplete(SERVICE_WORKER_ERROR_FAILED); | 605 OperationComplete(SERVICE_WORKER_ERROR_FAILED); |
| 604 } | 606 } |
| 605 | 607 |
| 606 } // namespace content | 608 } // namespace content |
| OLD | NEW |