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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 base::Callback<void(ServiceWorkerStatusCode)> callback = | 524 base::Callback<void(ServiceWorkerStatusCode)> callback = |
525 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); | 525 base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id); |
526 scoped_refptr<DevToolsAgentHostImpl> agent_host( | 526 scoped_refptr<DevToolsAgentHostImpl> agent_host( |
527 ServiceWorkerDevToolsManager::GetInstance() | 527 ServiceWorkerDevToolsManager::GetInstance() |
528 ->GetDevToolsAgentHostForWorker(process_host_id, | 528 ->GetDevToolsAgentHostForWorker(process_host_id, |
529 devtools_agent_route_id)); | 529 devtools_agent_route_id)); |
530 if (!agent_host.get()) { | 530 if (!agent_host.get()) { |
531 callback.Run(SERVICE_WORKER_ERROR_NOT_FOUND); | 531 callback.Run(SERVICE_WORKER_ERROR_NOT_FOUND); |
532 return; | 532 return; |
533 } | 533 } |
534 agent_host->Inspect(); | 534 agent_host->Inspect(web_ui()->GetWebContents()->GetBrowserContext()); |
535 callback.Run(SERVICE_WORKER_OK); | 535 callback.Run(SERVICE_WORKER_OK); |
536 } | 536 } |
537 | 537 |
538 void ServiceWorkerInternalsUI::Unregister(const ListValue* args) { | 538 void ServiceWorkerInternalsUI::Unregister(const ListValue* args) { |
539 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 539 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
540 int callback_id; | 540 int callback_id; |
541 int partition_id; | 541 int partition_id; |
542 std::string scope_string; | 542 std::string scope_string; |
543 const DictionaryValue* cmd_args = NULL; | 543 const DictionaryValue* cmd_args = NULL; |
544 scoped_refptr<ServiceWorkerContextWrapper> context; | 544 scoped_refptr<ServiceWorkerContextWrapper> context; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 callback.Run(SERVICE_WORKER_ERROR_ABORT); | 590 callback.Run(SERVICE_WORKER_ERROR_ABORT); |
591 return; | 591 return; |
592 } | 592 } |
593 | 593 |
594 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here | 594 // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here |
595 // because that reduces a status code to boolean. | 595 // because that reduces a status code to boolean. |
596 context->context()->UnregisterServiceWorker(scope, callback); | 596 context->context()->UnregisterServiceWorker(scope, callback); |
597 } | 597 } |
598 | 598 |
599 } // namespace content | 599 } // namespace content |
OLD | NEW |