summaryrefslogtreecommitdiffstats
path: root/webkit/glue/tools_proxy.h
blob: 88f3ff76637418d834e27e9e462174b56e52aa76 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright (c) 2009 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.

// Developer tools consist of following parts: 
//
// ToolsAgent lives in the renderer of an inspected page and provides access to
// the pages resources, DOM, v8 etc. by means of IPC messages. 
// 
// ToolsClient is a thin delegate that lives in the tools front-end renderer and
// converts IPC messages to frontend methods calls and allows the frontend to 
// send messages to the ToolsAgent.
//
// All the messages are routed through browser process.
//
// Chain of communication between the components may be described by the 
// following diagram:
//  --------------------------
// | (tools frontend          |
// | renderer process)        |
// |                          |            --------------------
// |tools     <--> ToolsClient+<-- IPC -->+ (browser process)  |
// |frontend                  |           |                    |
//  --------------------------             -----------+--------
//                                                    ^
//                                                    |
//                                                   IPC
//                                                    |
//                                                    v
//                          --------------------------+-------
//                         | inspected page <--> ToolsAgent   |
//                         |                                  |
//                         | (inspected page renderer process)|
//                          ----------------------------------
// 
// This file describes interface between tools frontend and ToolsClient in the 
// above diagram.

#ifndef WEBKIT_GLUE_TOOLS_PROXY_H_
#define WEBKIT_GLUE_TOOLS_PROXY_H_

#include "base/basictypes.h"

class ToolsUI;

// Interface for sending messages to remote ToolsAgent.
class ToolsProxy {
 public:
  ToolsProxy() {}
  virtual ~ToolsProxy() {}

  virtual void SetToolsUI(ToolsUI*) = 0;

  virtual void DebugAttach() = 0;
  virtual void DebugDetach() = 0;

 private:
  DISALLOW_COPY_AND_ASSIGN(ToolsProxy);
};


// Interface for accessing tools frontend.
class ToolsUI {
 public:
  ToolsUI() {}
  virtual ~ToolsUI() {}

  virtual void OnDidDebugAttach() = 0;

 private:
  DISALLOW_COPY_AND_ASSIGN(ToolsUI);
};

#endif // WEBKIT_GLUE_TOOLS_PROXY_H_