Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: content/browser/service_worker/service_worker_internals_ui.cc

Issue 2361613002: DevTools: untangle device discovery request from the devtools android bridge. (Closed)
Patch Set: make device hosts profile-independent, plump browser context for inspect. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698