summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webdevtoolsclient_impl.h
blob: 3309eeb699bea4b1550a7567553b3c56ad46db67 (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
// 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.

#ifndef WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_
#define WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_

#include <string>

#include <wtf/OwnPtr.h>

#include "webkit/glue/cpp_bound_class.h"
#include "webkit/glue/devtools/devtools_rpc.h"
#include "webkit/glue/webdevtoolsclient.h"

namespace WebCore {
class String;
}

class JsDebuggerAgentBoundObj;
class JsDomAgentBoundObj;
class JsNetAgentBoundObj;
class JsToolsAgentBoundObj;
class WebDevToolsClientDelegate;
class WebViewImpl;

class WebDevToolsClientImpl : public WebDevToolsClient,
                              public CppBoundClass,
                              public DevToolsRpc::Delegate {
 public:
  WebDevToolsClientImpl(
      WebViewImpl* web_view_impl,
      WebDevToolsClientDelegate* delegate);
  virtual ~WebDevToolsClientImpl();

  // DevToolsRpc::Delegate implementation.
  virtual void SendRpcMessage(const std::string& raw_msg);

  // WebDevToolsClient implementation.
  virtual void DispatchMessageFromAgent(const std::string& raw_msg);

 private:
  void JsAddSourceToFrame(const CppArgumentList& args, CppVariant* result);
  void JsLoaded(const CppArgumentList& args, CppVariant* result);

  WebViewImpl* web_view_impl_;
  WebDevToolsClientDelegate* delegate_;
  OwnPtr<CppBoundClass> debugger_command_executor_obj_;
  OwnPtr<JsDebuggerAgentBoundObj> debugger_agent_obj_;
  OwnPtr<JsDomAgentBoundObj> dom_agent_obj_;
  OwnPtr<JsNetAgentBoundObj> net_agent_obj_;
  OwnPtr<JsToolsAgentBoundObj> tools_agent_obj_;
  bool loaded_;
  Vector<std::string> pending_incoming_messages_;
  DISALLOW_COPY_AND_ASSIGN(WebDevToolsClientImpl);
};

#endif  // WEBKIT_GLUE_WEBDEVTOOLSCLIENT_IMPL_H_