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