summaryrefslogtreecommitdiff
path: root/chromium/headless/public/headless_devtools_target.h
blob: 740595dac70d9aeb0b73eadc1e98d8b21c066521 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_TARGET_H_
#define HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_TARGET_H_

#include "base/macros.h"
#include "headless/public/headless_devtools_channel.h"
#include "headless/public/headless_devtools_client.h"
#include "headless/public/headless_export.h"

namespace headless {

// A target which can be controlled and inspected using DevTools.
// TODO(dgozman): remove this class once all clients switch.
class HEADLESS_EXPORT HeadlessDevToolsTarget {
 public:
  virtual ~HeadlessDevToolsTarget() {}

  // Attach or detach a client to this target. A client must be attached in
  // order to send commands or receive notifications from the target.
  //
  // A single client may be attached to at most one target at a time.
  // |client| must outlive this target.
  virtual void AttachClient(HeadlessDevToolsClient* client) = 0;
  virtual void DetachClient(HeadlessDevToolsClient* client) = 0;

  // Returns true if a devtools client is attached.
  virtual bool IsAttached() = 0;
};

}  // namespace headless

#endif  // HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_TARGET_H_