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

Side by Side Diff: content/browser/devtools/protocol/service_worker_handler.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, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/devtools/protocol/service_worker_handler.h" 5 #include "content/browser/devtools/protocol/service_worker_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/containers/scoped_ptr_hash_map.h" 8 #include "base/containers/scoped_ptr_hash_map.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 return Response::OK(); 541 return Response::OK();
542 } 542 }
543 543
544 void ServiceWorkerHandler::OpenNewDevToolsWindow(int process_id, 544 void ServiceWorkerHandler::OpenNewDevToolsWindow(int process_id,
545 int devtools_agent_route_id) { 545 int devtools_agent_route_id) {
546 scoped_refptr<DevToolsAgentHostImpl> agent_host( 546 scoped_refptr<DevToolsAgentHostImpl> agent_host(
547 ServiceWorkerDevToolsManager::GetInstance() 547 ServiceWorkerDevToolsManager::GetInstance()
548 ->GetDevToolsAgentHostForWorker(process_id, devtools_agent_route_id)); 548 ->GetDevToolsAgentHostForWorker(process_id, devtools_agent_route_id));
549 if (!agent_host.get()) 549 if (!agent_host.get())
550 return; 550 return;
551 agent_host->Inspect(); 551 agent_host->Inspect(nullptr);
552 } 552 }
553 553
554 void ServiceWorkerHandler::OnWorkerRegistrationUpdated( 554 void ServiceWorkerHandler::OnWorkerRegistrationUpdated(
555 const std::vector<ServiceWorkerRegistrationInfo>& registrations) { 555 const std::vector<ServiceWorkerRegistrationInfo>& registrations) {
556 std::vector<scoped_refptr<ServiceWorkerRegistration>> registration_values; 556 std::vector<scoped_refptr<ServiceWorkerRegistration>> registration_values;
557 for (const auto& registration : registrations) { 557 for (const auto& registration : registrations) {
558 registration_values.push_back( 558 registration_values.push_back(
559 CreateRegistrationDictionaryValue(registration)); 559 CreateRegistrationDictionaryValue(registration));
560 } 560 }
561 client_->WorkerRegistrationUpdated( 561 client_->WorkerRegistrationUpdated(
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 } 672 }
673 673
674 void ServiceWorkerHandler::ClearForceUpdate() { 674 void ServiceWorkerHandler::ClearForceUpdate() {
675 if (context_) 675 if (context_)
676 context_->SetForceUpdateOnPageLoad(false); 676 context_->SetForceUpdateOnPageLoad(false);
677 } 677 }
678 678
679 } // namespace service_worker 679 } // namespace service_worker
680 } // namespace devtools 680 } // namespace devtools
681 } // namespace content 681 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698