OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_TARGET_H_ | 5 #ifndef HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_TARGET_H_ |
6 #define HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_TARGET_H_ | 6 #define HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_TARGET_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "headless/public/headless_export.h" | 9 #include "headless/public/headless_export.h" |
10 | 10 |
11 namespace headless { | 11 namespace headless { |
12 class HeadlessDevToolsClient; | 12 class HeadlessDevToolsClient; |
13 | 13 |
14 // A target which can be controlled and inspected using DevTools. | 14 // A target which can be controlled and inspected using DevTools. |
15 class HEADLESS_EXPORT HeadlessDevToolsTarget { | 15 class HEADLESS_EXPORT HeadlessDevToolsTarget { |
16 public: | 16 public: |
17 HeadlessDevToolsTarget() {} | 17 HeadlessDevToolsTarget() {} |
18 virtual ~HeadlessDevToolsTarget() {} | 18 virtual ~HeadlessDevToolsTarget() {} |
19 | 19 |
20 // Attach or detach a client to this target. A client must be attached in | 20 // Attach or detach a client to this target. A client must be attached in |
21 // order to send commands or receive notifications from the target. | 21 // order to send commands or receive notifications from the target. |
22 // | 22 // |
23 // A single client may be attached to at most one target at a time. Note that | 23 // A single client may be attached to at most one target at a time. If |
24 // currently also only one client may be attached to a single target at a | 24 // the target already has a client attached, AttachClient will return false. |
25 // time. | 25 // ForceAttachClient will detach any existing connection before attaching |
26 // |client|. | |
27 // Note that currently also only one client may be attached to a single target | |
28 // at a time. | |
26 // | 29 // |
27 // |client| must outlive this target. | 30 // |client| must outlive this target. |
28 virtual void AttachClient(HeadlessDevToolsClient* client) = 0; | 31 virtual bool AttachClient(HeadlessDevToolsClient* client) = 0; |
32 virtual void ForceAttachClient(HeadlessDevToolsClient* client) = 0; | |
29 virtual void DetachClient(HeadlessDevToolsClient* client) = 0; | 33 virtual void DetachClient(HeadlessDevToolsClient* client) = 0; |
30 | 34 |
35 // Returns true if a devtools client is attaced. | |
Sami
2016/11/28 16:58:13
typo: attached
tmarek
2016/11/29 10:14:59
Done.
| |
36 virtual bool IsAttached() = 0; | |
37 | |
31 private: | 38 private: |
32 DISALLOW_COPY_AND_ASSIGN(HeadlessDevToolsTarget); | 39 DISALLOW_COPY_AND_ASSIGN(HeadlessDevToolsTarget); |
33 }; | 40 }; |
34 | 41 |
35 } // namespace headless | 42 } // namespace headless |
36 | 43 |
37 #endif // HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_TARGET_H_ | 44 #endif // HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_TARGET_H_ |
OLD | NEW |