| OLD | NEW |
| 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 #ifndef COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_H_ | 5 #ifndef COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_H_ |
| 6 #define COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_H_ | 6 #define COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "components/devtools_service/devtools_registry_impl.h" | 12 #include "components/devtools_service/devtools_registry_impl.h" |
| 13 #include "components/devtools_service/public/interfaces/devtools_service.mojom.h
" | 13 #include "components/devtools_service/public/interfaces/devtools_service.mojom.h
" |
| 14 #include "mojo/common/weak_binding_set.h" | 14 #include "mojo/common/weak_binding_set.h" |
| 15 | 15 |
| 16 namespace mojo { | 16 namespace mojo { |
| 17 class ApplicationImpl; | 17 class Shell; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace devtools_service { | 20 namespace devtools_service { |
| 21 | 21 |
| 22 class DevToolsHttpServer; | 22 class DevToolsHttpServer; |
| 23 | 23 |
| 24 // DevToolsService is the central control. It manages the communication with | 24 // DevToolsService is the central control. It manages the communication with |
| 25 // DevTools agents (e.g., Web page renderers). It also starts an HTTP server to | 25 // DevTools agents (e.g., Web page renderers). It also starts an HTTP server to |
| 26 // speak the Chrome remote debugging protocol. | 26 // speak the Chrome remote debugging protocol. |
| 27 class DevToolsService : public DevToolsCoordinator { | 27 class DevToolsService : public DevToolsCoordinator { |
| 28 public: | 28 public: |
| 29 // Doesn't take ownership of |application|, which must outlive this object. | 29 // Doesn't take ownership of |application|, which must outlive this object. |
| 30 explicit DevToolsService(mojo::ApplicationImpl* application); | 30 explicit DevToolsService(mojo::Shell* shell); |
| 31 ~DevToolsService() override; | 31 ~DevToolsService() override; |
| 32 | 32 |
| 33 void BindToCoordinatorRequest( | 33 void BindToCoordinatorRequest( |
| 34 mojo::InterfaceRequest<DevToolsCoordinator> request); | 34 mojo::InterfaceRequest<DevToolsCoordinator> request); |
| 35 | 35 |
| 36 mojo::ApplicationImpl* application() { return application_; } | 36 mojo::Shell* shell() { return shell_; } |
| 37 | 37 |
| 38 DevToolsRegistryImpl* registry() { return ®istry_; } | 38 DevToolsRegistryImpl* registry() { return ®istry_; } |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 // DevToolsCoordinator implementation. | 41 // DevToolsCoordinator implementation. |
| 42 void Initialize(uint16_t remote_debugging_port) override; | 42 void Initialize(uint16_t remote_debugging_port) override; |
| 43 | 43 |
| 44 // Not owned by this object. | 44 // Not owned by this object. |
| 45 mojo::ApplicationImpl* const application_; | 45 mojo::Shell* const shell_; |
| 46 | 46 |
| 47 mojo::WeakBindingSet<DevToolsCoordinator> coordinator_bindings_; | 47 mojo::WeakBindingSet<DevToolsCoordinator> coordinator_bindings_; |
| 48 | 48 |
| 49 scoped_ptr<DevToolsHttpServer> http_server_; | 49 scoped_ptr<DevToolsHttpServer> http_server_; |
| 50 DevToolsRegistryImpl registry_; | 50 DevToolsRegistryImpl registry_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(DevToolsService); | 52 DISALLOW_COPY_AND_ASSIGN(DevToolsService); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace devtools_service | 55 } // namespace devtools_service |
| 56 | 56 |
| 57 #endif // COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_H_ | 57 #endif // COMPONENTS_DEVTOOLS_SERVICE_DEVTOOLS_SERVICE_H_ |
| OLD | NEW |