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

Side by Side Diff: components/devtools_service/devtools_service.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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 "components/devtools_service/devtools_service.h" 5 #include "components/devtools_service/devtools_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "components/devtools_service/devtools_http_server.h" 10 #include "components/devtools_service/devtools_http_server.h"
11 #include "mojo/shell/public/cpp/application_impl.h" 11 #include "mojo/shell/public/cpp/shell.h"
12 12
13 namespace devtools_service { 13 namespace devtools_service {
14 14
15 DevToolsService::DevToolsService(mojo::ApplicationImpl* application) 15 DevToolsService::DevToolsService(mojo::Shell* shell)
16 : application_(application), registry_(this) { 16 : shell_(shell), registry_(this) {
17 DCHECK(application_); 17 DCHECK(shell_);
18 } 18 }
19 19
20 DevToolsService::~DevToolsService() { 20 DevToolsService::~DevToolsService() {
21 } 21 }
22 22
23 void DevToolsService::BindToCoordinatorRequest( 23 void DevToolsService::BindToCoordinatorRequest(
24 mojo::InterfaceRequest<DevToolsCoordinator> request) { 24 mojo::InterfaceRequest<DevToolsCoordinator> request) {
25 coordinator_bindings_.AddBinding(this, std::move(request)); 25 coordinator_bindings_.AddBinding(this, std::move(request));
26 } 26 }
27 27
28 void DevToolsService::Initialize(uint16_t remote_debugging_port) { 28 void DevToolsService::Initialize(uint16_t remote_debugging_port) {
29 if (http_server_) { 29 if (http_server_) {
30 LOG(WARNING) << "DevTools service receives a " 30 LOG(WARNING) << "DevTools service receives a "
31 << "DevToolsCoordinator.Initialize() call while it has " 31 << "DevToolsCoordinator.Initialize() call while it has "
32 << "already been initialized."; 32 << "already been initialized.";
33 return; 33 return;
34 } 34 }
35 35
36 http_server_.reset(new DevToolsHttpServer(this, remote_debugging_port)); 36 http_server_.reset(new DevToolsHttpServer(this, remote_debugging_port));
37 } 37 }
38 38
39 } // namespace devtools_service 39 } // namespace devtools_service
OLDNEW
« no previous file with comments | « components/devtools_service/devtools_service.h ('k') | components/devtools_service/devtools_service_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698