| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 base::Callback<void(ServiceWorkerStatusCode)> callback = | 536 base::Callback<void(ServiceWorkerStatusCode)> callback = |
| 537 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); | 537 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); |
| 538 scoped_refptr<DevToolsAgentHostImpl> agent_host( | 538 scoped_refptr<DevToolsAgentHostImpl> agent_host( |
| 539 ServiceWorkerDevToolsManager::GetInstance() | 539 ServiceWorkerDevToolsManager::GetInstance() |
| 540 ->GetDevToolsAgentHostForWorker(process_host_id, | 540 ->GetDevToolsAgentHostForWorker(process_host_id, |
| 541 devtools_agent_route_id)); | 541 devtools_agent_route_id)); |
| 542 if (!agent_host.get()) { | 542 if (!agent_host.get()) { |
| 543 callback.Run(SERVICE_WORKER_ERROR_NOT_FOUND); | 543 callback.Run(SERVICE_WORKER_ERROR_NOT_FOUND); |
| 544 return; | 544 return; |
| 545 } | 545 } |
| 546 agent_host->Inspect(); | 546 agent_host->Inspect(nullptr); |
| 547 callback.Run(SERVICE_WORKER_OK); | 547 callback.Run(SERVICE_WORKER_OK); |
| 548 } | 548 } |
| 549 | 549 |
| 550 void ServiceWorkerInternalsUI::Unregister(const ListValue* args) { | 550 void ServiceWorkerInternalsUI::Unregister(const ListValue* args) { |
| 551 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 551 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 552 int callback_id; | 552 int callback_id; |
| 553 int partition_id; | 553 int partition_id; |
| 554 std::string scope_string; | 554 std::string scope_string; |
| 555 const DictionaryValue* cmd_args = NULL; | 555 const DictionaryValue* cmd_args = NULL; |
| 556 scoped_refptr<ServiceWorkerContextWrapper> context; | 556 scoped_refptr<ServiceWorkerContextWrapper> context; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 callback.Run(SERVICE_WORKER_ERROR_ABORT); | 602 callback.Run(SERVICE_WORKER_ERROR_ABORT); |
| 603 return; | 603 return; |
| 604 } | 604 } |
| 605 | 605 |
| 606 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here | 606 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here |
| 607 // because that reduces a status code to boolean. | 607 // because that reduces a status code to boolean. |
| 608 context->context()->UnregisterServiceWorker(scope, callback); | 608 context->context()->UnregisterServiceWorker(scope, callback); |
| 609 } | 609 } |
| 610 | 610 |
| 611 } // namespace content | 611 } // namespace content |
| OLD | NEW |