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