summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-23 10:58:51 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-23 10:58:51 +0000
commit0b093c9568e7d15c050dd770002850704df2417b (patch)
treec128112072d53ae1bf7d639bd59a1fe07a211dc9
parent7aa27fdf4e135daef7f49a37a61e506c165ce214 (diff)
downloadchromium_src-0b093c9568e7d15c050dd770002850704df2417b.zip
chromium_src-0b093c9568e7d15c050dd770002850704df2417b.tar.gz
chromium_src-0b093c9568e7d15c050dd770002850704df2417b.tar.bz2
DevToolsClient frontend improvements:
1. Move callbacks processing to the frontend 2. Dispatch calls directly to Javascript 3. Create CppBoundObject per agent flavor and wire it to IPC 4. Introduce Remote*Agent abstraction in the frontend Review URL: http://codereview.chromium.org/42486 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12275 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/SConscript1
-rw-r--r--webkit/glue/devtools/devtools_rpc.cc13
-rw-r--r--webkit/glue/devtools/devtools_rpc.h11
-rw-r--r--webkit/glue/devtools/devtools_rpc_js.h206
-rw-r--r--webkit/glue/devtools/dom_agent.h4
-rw-r--r--webkit/glue/devtools/dom_agent_impl.cc13
-rw-r--r--webkit/glue/devtools/dom_agent_impl.h2
-rw-r--r--webkit/glue/devtools/dom_agent_unittest.cc9
-rw-r--r--webkit/glue/devtools/js/devtools.html5
-rw-r--r--webkit/glue/devtools/js/devtools.js56
-rw-r--r--webkit/glue/devtools/js/devtools_callback.js57
-rw-r--r--webkit/glue/devtools/js/devtools_host_stub.js62
-rw-r--r--webkit/glue/devtools/js/dom_agent.js (renamed from webkit/glue/devtools/js/dom.js)153
-rw-r--r--webkit/glue/devtools/js/inspector_controller.js3
-rw-r--r--webkit/glue/devtools/js/inspector_controller_impl.js20
-rw-r--r--webkit/glue/devtools/js/net_agent.js (renamed from webkit/glue/devtools/js/net.js)76
-rw-r--r--webkit/glue/glue.vcproj1934
-rw-r--r--webkit/glue/webdevtoolsclient_impl.cc238
-rw-r--r--webkit/glue/webdevtoolsclient_impl.h110
-rw-r--r--webkit/webkit.gyp1
20 files changed, 1586 insertions, 1388 deletions
diff --git a/webkit/glue/SConscript b/webkit/glue/SConscript
index cd42a67..124b7fa 100644
--- a/webkit/glue/SConscript
+++ b/webkit/glue/SConscript
@@ -45,6 +45,7 @@ input_files = [
'debugger_bridge.cc',
'devtools/devtools_rpc.cc',
'devtools/devtools_rpc.h',
+ 'devtools/devtools_rpc_js.h',
'devtools/dom_agent.h',
'devtools/dom_agent_impl.cc',
'devtools/dom_agent_impl.h',
diff --git a/webkit/glue/devtools/devtools_rpc.cc b/webkit/glue/devtools/devtools_rpc.cc
index c19e373..b3d09d8 100644
--- a/webkit/glue/devtools/devtools_rpc.cc
+++ b/webkit/glue/devtools/devtools_rpc.cc
@@ -20,10 +20,8 @@ DevToolsRpc::DevToolsRpc(Delegate* delegate) : delegate_(delegate) {
DevToolsRpc::~DevToolsRpc() {
}
-void DevToolsRpc::SendValueMessage(const Value* value) {
- std::string json;
- JSONWriter::Write(value, false, &json);
- delegate_->SendRpcMessage(json);
+void DevToolsRpc::SendValueMessage(const Value& value) {
+ delegate_->SendRpcMessage(Serialize(value));
}
// static
@@ -32,6 +30,13 @@ Value* DevToolsRpc::ParseMessage(const std::string& raw_msg) {
}
// static
+std::string DevToolsRpc::Serialize(const Value& value) {
+ std::string json;
+ JSONWriter::Write(&value, false, &json);
+ return json;
+}
+
+// static
void DevToolsRpc::GetListValue(
const ListValue& message,
int index,
diff --git a/webkit/glue/devtools/devtools_rpc.h b/webkit/glue/devtools/devtools_rpc.h
index 56d5266..6f134ba 100644
--- a/webkit/glue/devtools/devtools_rpc.h
+++ b/webkit/glue/devtools/devtools_rpc.h
@@ -315,7 +315,7 @@ class DevToolsRpc {
ListValue message;
message.Append(CreateValue(&class_id));
message.Append(CreateValue(&method));
- SendValueMessage(&message);
+ SendValueMessage(message);
}
template<class T1>
void InvokeAsync(int class_id, int method, T1 t1) {
@@ -323,7 +323,7 @@ class DevToolsRpc {
message.Append(CreateValue(&class_id));
message.Append(CreateValue(&method));
message.Append(CreateValue(t1));
- SendValueMessage(&message);
+ SendValueMessage(message);
}
template<class T1, class T2>
void InvokeAsync(int class_id, int method, T1 t1, T2 t2) {
@@ -332,7 +332,7 @@ class DevToolsRpc {
message.Append(CreateValue(&method));
message.Append(CreateValue(t1));
message.Append(CreateValue(t2));
- SendValueMessage(&message);
+ SendValueMessage(message);
}
template<class T1, class T2, class T3>
void InvokeAsync(int class_id, int method, T1 t1, T2 t2, T3 t3) {
@@ -342,10 +342,11 @@ class DevToolsRpc {
message.Append(CreateValue(t1));
message.Append(CreateValue(t2));
message.Append(CreateValue(t3));
- SendValueMessage(&message);
+ SendValueMessage(message);
}
static Value* ParseMessage(const std::string& raw_msg);
+ static std::string Serialize(const Value& value);
static void GetListValue(const ListValue& message, int index, bool* value);
static void GetListValue(const ListValue& message, int index, int* value);
static void GetListValue(
@@ -370,7 +371,7 @@ class DevToolsRpc {
static Value* CreateValue(bool* value);
static Value* CreateValue(const Value* value);
- void SendValueMessage(const Value* value);
+ void SendValueMessage(const Value& value);
Delegate* delegate_;
DISALLOW_COPY_AND_ASSIGN(DevToolsRpc);
diff --git a/webkit/glue/devtools/devtools_rpc_js.h b/webkit/glue/devtools/devtools_rpc_js.h
new file mode 100644
index 0000000..45b34c7
--- /dev/null
+++ b/webkit/glue/devtools/devtools_rpc_js.h
@@ -0,0 +1,206 @@
+// 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.
+
+// Additional set of macros for the JS RPC.
+
+#ifndef WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_JS_H_
+#define WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_JS_H_
+
+#include <string>
+
+#include <wtf/OwnPtr.h>
+
+#include "base/basictypes.h"
+#include "base/logging.h"
+#include "base/values.h"
+#include "webkit/glue/cpp_bound_class.h"
+#include "webkit/glue/devtools/devtools_rpc.h"
+#include "webkit/glue/glue_util.h"
+#include "webkit/glue/webframe.h"
+
+///////////////////////////////////////////////////////
+// JS RPC binds and stubs
+
+template<typename T>
+struct RpcJsTypeTrait {
+};
+
+template<>
+struct RpcJsTypeTrait<bool> {
+ static bool Pass(const CppVariant& var) {
+ return var.ToBoolean();
+ }
+};
+
+template<>
+struct RpcJsTypeTrait<int> {
+ static int Pass(const CppVariant& var) {
+ return var.ToInt32();
+ }
+};
+
+template<>
+struct RpcJsTypeTrait<String> {
+ static String Pass(const CppVariant& var) {
+ return webkit_glue::StdStringToString(var.ToString());
+ }
+};
+
+template<>
+struct RpcJsTypeTrait<std::string> {
+ static std::string Pass(const CppVariant& var) {
+ return var.ToString();
+ }
+};
+
+#define TOOLS_RPC_JS_BIND_METHOD0(Method) \
+ BindMethod(#Method, &OCLASS::Js##Method);
+
+#define TOOLS_RPC_JS_BIND_METHOD1(Method, T1) \
+ BindMethod(#Method, &OCLASS::Js##Method);
+
+#define TOOLS_RPC_JS_BIND_METHOD2(Method, T1, T2) \
+ BindMethod(#Method, &OCLASS::Js##Method);
+
+#define TOOLS_RPC_JS_BIND_METHOD3(Method, T1, T2, T3) \
+ BindMethod(#Method, &OCLASS::Js##Method);
+
+#define TOOLS_RPC_JS_STUB_METHOD0(Method) \
+ void Js##Method(const CppArgumentList& args, CppVariant* result) { \
+ InvokeAsync(RpcTypeToNumber<CLASS>::number, METHOD_##Method); \
+ result->SetNull(); \
+ }
+
+#define TOOLS_RPC_JS_STUB_METHOD1(Method, T1) \
+ void Js##Method(const CppArgumentList& args, CppVariant* result) { \
+ T1 t1 = RpcJsTypeTrait<T1>::Pass(args[0]); \
+ InvokeAsync(RpcTypeToNumber<CLASS>::number, METHOD_##Method, &t1); \
+ result->SetNull(); \
+ }
+
+#define TOOLS_RPC_JS_STUB_METHOD2(Method, T1, T2) \
+ void Js##Method(const CppArgumentList& args, CppVariant* result) { \
+ T1 t1 = RpcJsTypeTrait<T1>::Pass(args[0]); \
+ T2 t2 = RpcJsTypeTrait<T2>::Pass(args[1]); \
+ InvokeAsync(RpcTypeToNumber<CLASS>::number, METHOD_##Method, &t1, &t2); \
+ result->SetNull(); \
+ }
+
+#define TOOLS_RPC_JS_STUB_METHOD3(Method, T1, T2, T3) \
+ void Js##Method(const CppArgumentList& args, CppVariant* result) { \
+ T1 t1 = RpcJsTypeTrait<T1>::Pass(args[0]); \
+ T2 t2 = RpcJsTypeTrait<T2>::Pass(args[1]); \
+ T3 t3 = RpcJsTypeTrait<T3>::Pass(args[2]); \
+ InvokeAsync(RpcTypeToNumber<CLASS>::number, METHOD_##Method, &t1, &t2, \
+ &t3); \
+ result->SetNull(); \
+ }
+
+///////////////////////////////////////////////////////
+// JS RPC dispatch method implementations
+
+#define TOOLS_RPC_JS_DISPATCH0(Method) \
+case CLASS::METHOD_##Method: { \
+ *expr = StringPrintf("%s.%s()", js_obj.c_str(), #Method); \
+ return true; \
+}
+
+#define TOOLS_RPC_JS_DISPATCH1(Method, T1) \
+case CLASS::METHOD_##Method: { \
+ Value* t1; \
+ message.Get(2, &t1); \
+ *expr = StringPrintf("%s.%s(%s)", js_obj.c_str(), #Method, \
+ DevToolsRpc::Serialize(*t1).c_str()); \
+ return true; \
+}
+
+#define TOOLS_RPC_JS_DISPATCH2(Method, T1, T2) \
+case CLASS::METHOD_##Method: { \
+ Value* t1; \
+ Value* t2; \
+ message.Get(2, &t1); \
+ message.Get(3, &t2); \
+ *expr = StringPrintf("%s.%s(%s, %s)", js_obj.c_str(), #Method, \
+ DevToolsRpc::Serialize(*t1).c_str(), \
+ DevToolsRpc::Serialize(*t2).c_str()); \
+ return true; \
+}
+
+#define TOOLS_RPC_JS_DISPATCH3(Method, T1, T2, T3) \
+case CLASS::METHOD_##Method: { \
+ Value* t1; \
+ Value* t2; \
+ Value* t3; \
+ message.Get(2, &t1); \
+ message.Get(3, &t2); \
+ message.Get(4, &t3); \
+ *expr = StringPrintf("%s.%s(%s, %s, %s)", js_obj.c_str(), #Method, \
+ DevToolsRpc::Serialize(*t1).c_str(), \
+ DevToolsRpc::Serialize(*t2).c_str(), \
+ DevToolsRpc::Serialize(*t3).c_str()); \
+ return true; \
+}
+
+#define DEFINE_RPC_JS_DISPATCH(Class, STRUCT) \
+class Js##Class##Dispatch { \
+ public: \
+ explicit Js##Class##Dispatch(const std::wstring& classname) \
+ : js_obj(WideToUTF8(classname)) {} \
+ virtual ~Js##Class##Dispatch() {} \
+ \
+ bool Dispatch(const ListValue& message, std::string* expr) { \
+ int class_id; \
+ message.GetInteger(0, &class_id); \
+ if (class_id != RpcTypeToNumber<Class>::number) { \
+ return false; \
+ } \
+ int method; \
+ message.GetInteger(1, &method); \
+ typedef Class CLASS; \
+ switch (method) { \
+ STRUCT( \
+ TOOLS_RPC_JS_DISPATCH0, \
+ TOOLS_RPC_JS_DISPATCH1, \
+ TOOLS_RPC_JS_DISPATCH2, \
+ TOOLS_RPC_JS_DISPATCH3) \
+ default: return false; \
+ } \
+ } \
+ private: \
+ std::string js_obj; \
+ DISALLOW_COPY_AND_ASSIGN(Js##Class##Dispatch); \
+};
+
+///////////////////////////////////////////////////////
+// JS RPC main obj macro
+
+#define DEFINE_RPC_JS_BOUND_OBJ(Class, STRUCT, DClass, DELEGATE_STRUCT) \
+DEFINE_RPC_JS_DISPATCH(DClass, DELEGATE_STRUCT) \
+class Js##Class##BoundObj : public Class##Stub, \
+ public CppBoundClass, \
+ public Js##DClass##Dispatch { \
+ public: \
+ Js##Class##BoundObj(Delegate* rpc_delegate, WebFrame* frame, \
+ const std::wstring& classname) \
+ : Class##Stub(rpc_delegate), \
+ Js##DClass##Dispatch(classname) { \
+ BindToJavascript(frame, classname); \
+ STRUCT( \
+ TOOLS_RPC_JS_BIND_METHOD0, \
+ TOOLS_RPC_JS_BIND_METHOD1, \
+ TOOLS_RPC_JS_BIND_METHOD2, \
+ TOOLS_RPC_JS_BIND_METHOD3) \
+ } \
+ virtual ~Js##Class##BoundObj() {} \
+ typedef Js##Class##BoundObj OCLASS; \
+ STRUCT( \
+ TOOLS_RPC_JS_STUB_METHOD0, \
+ TOOLS_RPC_JS_STUB_METHOD1, \
+ TOOLS_RPC_JS_STUB_METHOD2, \
+ TOOLS_RPC_JS_STUB_METHOD3) \
+ private: \
+ DISALLOW_COPY_AND_ASSIGN(Js##Class##BoundObj); \
+};
+
+#endif // WEBKIT_GLUE_DEVTOOLS_DEVTOOLS_RPC_JS_H_
diff --git a/webkit/glue/devtools/dom_agent.h b/webkit/glue/devtools/dom_agent.h
index 491adb8..3aebf8c 100644
--- a/webkit/glue/devtools/dom_agent.h
+++ b/webkit/glue/devtools/dom_agent.h
@@ -36,10 +36,10 @@ DEFINE_RPC_CLASS(DomAgent, DOM_AGENT_STRUCT)
#define DOM_AGENT_DELEGATE_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3) \
/* Response to GetDocumentElement. */ \
- METHOD2(GetDocumentElementResult, int /* call_id */, std::string /* json */) \
+ METHOD2(GetDocumentElementResult, int /* call_id */, Value /* node */) \
\
/* Response to GetChildNodes. */ \
- METHOD2(GetChildNodesResult, int /* call_id */, std::string /* json */) \
+ METHOD2(GetChildNodesResult, int /* call_id */, Value /* nodes */) \
\
/* Notifies the delegate that element's attributes are updated. */ \
METHOD2(AttributesUpdated, int /* id */, Value /* attributes */) \
diff --git a/webkit/glue/devtools/dom_agent_impl.cc b/webkit/glue/devtools/dom_agent_impl.cc
index 28b11da..0170db9 100644
--- a/webkit/glue/devtools/dom_agent_impl.cc
+++ b/webkit/glue/devtools/dom_agent_impl.cc
@@ -20,7 +20,6 @@
#include <wtf/Vector.h>
#undef LOG
-#include "base/json_writer.h"
#include "base/values.h"
#include "webkit/glue/devtools/dom_agent_impl.h"
#include "webkit/glue/glue_util.h"
@@ -213,9 +212,7 @@ void DomAgentImpl::GetDocumentElement(int call_id) {
if (documents_.size() > 0) {
OwnPtr<Value> value(
BuildValueForNode((*documents_.begin())->documentElement(), 0));
- std::string json;
- ToJson(value.get(), &json);
- delegate_->GetDocumentElementResult(call_id, json);
+ delegate_->GetDocumentElementResult(call_id, *value.get());
} else {
document_element_call_id_ = call_id;
}
@@ -229,9 +226,7 @@ void DomAgentImpl::GetChildNodes(int call_id, int element_id) {
Element* element = static_cast<Element*>(node);
OwnPtr<Value> children(BuildValueForElementChildren(element, 1));
children_requested_.add(element_id);
- std::string json;
- ToJson(children.get(), &json);
- delegate_->GetChildNodesResult(call_id, json);
+ delegate_->GetChildNodesResult(call_id, *children.get());
}
int DomAgentImpl::GetPathToNode(Node* node_to_select) {
@@ -407,7 +402,3 @@ Element* DomAgentImpl::InnerParentElement(Node* node) {
}
return element;
}
-
-void DomAgentImpl::ToJson(const Value* value, std::string* json) {
- JSONWriter::Write(value, false, json);
-}
diff --git a/webkit/glue/devtools/dom_agent_impl.h b/webkit/glue/devtools/dom_agent_impl.h
index 51e5ffa..6bc130e 100644
--- a/webkit/glue/devtools/dom_agent_impl.h
+++ b/webkit/glue/devtools/dom_agent_impl.h
@@ -103,8 +103,6 @@ class DomAgentImpl : public DomAgent {
int InnerChildNodeCount(WebCore::Node* node);
WebCore::Element* InnerParentElement(WebCore::Node* node);
- void ToJson(const Value* value, std::string* json);
-
DomAgentDelegate* delegate_;
HashMap<WebCore::Node*, int> node_to_id_;
HashMap<int, WebCore::Node*> id_to_node_;
diff --git a/webkit/glue/devtools/dom_agent_unittest.cc b/webkit/glue/devtools/dom_agent_unittest.cc
index ce2f544..99cbc2c 100644
--- a/webkit/glue/devtools/dom_agent_unittest.cc
+++ b/webkit/glue/devtools/dom_agent_unittest.cc
@@ -96,7 +96,8 @@ class DomAgentTests : public TestShellTest {
// Requests document node and tests that the callback with the serialized
// version is called.
TEST_F(DomAgentTests, GetDocumentElement) {
- mock_delegate_->GetDocumentElementResult(kCallId1, "[1,1,\"HTML\",\"\",[],1]");
+ OwnPtr<Value> v(DevToolsRpc::ParseMessage("[1,1,\"HTML\",\"\",[],1]"));
+ mock_delegate_->GetDocumentElementResult(kCallId1, *v.get());
mock_delegate_->Replay();
dom_agent_->GetDocumentElement(kCallId1);
@@ -109,7 +110,8 @@ TEST_F(DomAgentTests, GetChildNodes) {
dom_agent_->GetDocumentElement(kCallId1);
mock_delegate_->Reset();
- mock_delegate_->GetChildNodesResult(kCallId2, "[[2,1,\"BODY\",\"\",[],0]]");
+ OwnPtr<Value> v(DevToolsRpc::ParseMessage("[[2,1,\"BODY\",\"\",[],0]]"));
+ mock_delegate_->GetChildNodesResult(kCallId2, *v.get());
mock_delegate_->Replay();
dom_agent_->GetChildNodes(kCallId2, kHtmlElemId);
@@ -359,7 +361,8 @@ TEST_F(DomAgentTests, GetChildNodesOfFrameOwner) {
mock_delegate_->Reset();
// Expecting HTML child with single (body) child.
- mock_delegate_->GetChildNodesResult(kCallId4, "[[4,1,\"HTML\",\"\",[],1]]");
+ OwnPtr<Value> v(DevToolsRpc::ParseMessage("[[4,1,\"HTML\",\"\",[],1]]"));
+ mock_delegate_->GetChildNodesResult(kCallId4, *v.get());
mock_delegate_->Replay();
dom_agent_->GetChildNodes(kCallId4, 3);
diff --git a/webkit/glue/devtools/js/devtools.html b/webkit/glue/devtools/js/devtools.html
index af21bd5..d9684d1 100644
--- a/webkit/glue/devtools/js/devtools.html
+++ b/webkit/glue/devtools/js/devtools.html
@@ -47,8 +47,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="json.js"></script>
<script type="text/javascript" src="utilities.js"></script>
<script type="text/javascript" src="treeoutline.js"></script>
- <script type="text/javascript" src="dom.js"></script>
- <script type="text/javascript" src="net.js"></script>
+ <script type="text/javascript" src="devtools_callback.js"></script>
+ <script type="text/javascript" src="dom_agent.js"></script>
+ <script type="text/javascript" src="net_agent.js"></script>
<script type="text/javascript" src="inspector_controller.js"></script>
<script type="text/javascript" src="inspector_controller_impl.js"></script>
<script type="text/javascript" src="inspector.js"></script>
diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js
index 32c5e71..4ef1c14 100644
--- a/webkit/glue/devtools/js/devtools.js
+++ b/webkit/glue/devtools/js/devtools.js
@@ -9,47 +9,59 @@
*/
goog.provide('devtools.Tools');
-goog.require('devtools.Dom');
-goog.require('devtools.Net');
+goog.require('devtools.DomAgent');
+goog.require('devtools.NetAgent');
-devtools.Tools = function() {
+devtools.ToolsAgent = function() {
+
};
// ToolsAgent implementation.
-devtools.Tools.prototype.updateFocusedNode = function(node_id) {
+devtools.ToolsAgent.prototype.updateFocusedNode = function(node_id) {
var node = dom.getNodeForId(node_id);
WebInspector.updateFocusedNode(node);
};
+
+devtools.ToolsAgent.prototype.setDomAgentEnabled = function(enabled) {
+ RemoteToolsAgent.SetDomAgentEnabled(enabled);
+};
+
+
+devtools.ToolsAgent.prototype.setNetAgentEnabled = function(enabled) {
+ RemoteToolsAgent.SetNetAgentEnabled(enabled);
+};
+
+
// Frontend global objects.
-var dom = new devtools.DomDocument();
-var net = new devtools.Net();
-var tools = new devtools.Tools();
+var domAgent;
+var netAgent;
+var toolsAgent;
+
var context = {}; // Used by WebCore's inspector routines.
// Overrides for existing WebInspector methods.
// TODO(pfeldman): Patch WebCore and upstream changes.
-
var oldLoaded = WebInspector.loaded;
WebInspector.loaded = function() {
+ domAgent = new devtools.DomAgent();
+ netAgent = new devtools.NetAgent();
+ toolsAgent = new devtools.ToolsAgent();
+
oldLoaded.call(this);
Preferences.ignoreWhitespace = false;
- DevToolsHost.getDocumentElement(function(root) {
- dom.setDocumentElement(eval(root));
- });
+ toolsAgent.setDomAgentEnabled(true);
+ toolsAgent.setNetAgentEnabled(true);
+ domAgent.getDocumentElementAsync();
};
-WebInspector.ElementsTreeElement.prototype.onpopulate = function() {
- if (this.children.length || this.whitespaceIgnored !==
- Preferences.ignoreWhitespace)
- return;
- this.whitespaceIgnored = Preferences.ignoreWhitespace;
- var self = this;
- var id = this.representedObject.id;
- DevToolsHost.getChildNodes(id, function(children) {
- dom.setChildren(id, eval(children));
- self.updateChildren();
- });
+var webkitUpdateChildren =
+ WebInspector.ElementsTreeElement.prototype.updateChildren;
+
+WebInspector.ElementsTreeElement.prototype.updateChildren = function() {
+ domAgent.getChildNodesAsync(
+ this.representedObject.id,
+ goog.bind(webkitUpdateChildren, this));
};
diff --git a/webkit/glue/devtools/js/devtools_callback.js b/webkit/glue/devtools/js/devtools_callback.js
new file mode 100644
index 0000000..c7c1482
--- /dev/null
+++ b/webkit/glue/devtools/js/devtools_callback.js
@@ -0,0 +1,57 @@
+// 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.
+
+/**
+ * @fileoverview Generic callback manager.
+ */
+goog.provide('devtools.Callback');
+
+
+/**
+ * Generic callback support as a singleton object.
+ * @constructor
+ */
+devtools.Callback = function() {
+ this.lastCallbackId_ = 0;
+ this.callbacks_ = {};
+};
+
+
+/**
+ * Assigns id to a callback.
+ * @param {Function} callback Callback to assign id to.
+ * @return {number} Callback id.
+ */
+devtools.Callback.prototype.wrap = function(callback) {
+ var callbackId = this.lastCallbackId_++;
+ this.callbacks_[callbackId] = callback;
+ return callbackId;
+};
+
+
+/**
+ * Executes callback with the given id.
+ * @param {callbackId} callbackId Id of a callback to call.
+ */
+devtools.Callback.prototype.processCallback = function(callbackId,
+ opt_vararg) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ var callback = this.callbacks_[callbackId];
+ callback.apply(null, args);
+ delete this.callbacks_[callbackId];
+};
+
+
+/**
+ * @type {devtools.Callback} Callback support singleton.
+ * @private
+ */
+devtools.Callback.INSTANCE_ = new devtools.Callback();
+
+devtools.Callback.wrap = goog.bind(
+ devtools.Callback.INSTANCE_.wrap,
+ devtools.Callback.INSTANCE_);
+devtools.Callback.processCallback = goog.bind(
+ devtools.Callback.INSTANCE_.processCallback,
+ devtools.Callback.INSTANCE_);
diff --git a/webkit/glue/devtools/js/devtools_host_stub.js b/webkit/glue/devtools/js/devtools_host_stub.js
index 7bee0d7..f1b10e5 100644
--- a/webkit/glue/devtools/js/devtools_host_stub.js
+++ b/webkit/glue/devtools/js/devtools_host_stub.js
@@ -3,36 +3,35 @@
// found in the LICENSE file.
/**
- * @fileoverview DevToolsHost Stub emulates backend functionality and allows
+ * @fileoverview These stubs emulate backend functionality and allows
* DevTools frontend to function as a standalone web app.
*/
-goog.provide('devtools.DevToolsHostStub');
/**
* @constructor
*/
-devtools.DevToolsHostStub = function() {
+RemoteDomAgentStub = function() {
};
-devtools.DevToolsHostStub.prototype.getDocumentElement = function(callback) {
+RemoteDomAgentStub.prototype.GetDocumentElement = function(callId) {
setTimeout(function() {
- callback(goog.json.serialize([
+ RemoteDomAgent.GetDocumentElementResult(callId, [
1, // id
1, // type = Node.ELEMENT_NODE,
"HTML", // nodeName
"", // nodeValue
["foo","bar"], // attributes
2, // childNodeCount
- ]))
+ ]);
}, 0);
};
-devtools.DevToolsHostStub.prototype.getChildNodes = function(id, callback) {
+RemoteDomAgentStub.prototype.GetChildNodes = function(callId, id) {
if (id == 1) {
setTimeout(function() {
- callback(goog.json.serialize(
+ RemoteDomAgent.GetChildNodesResult(callId,
[
[
2, // id
@@ -48,11 +47,11 @@ devtools.DevToolsHostStub.prototype.getChildNodes = function(id, callback) {
"", // nodeName
"Text", // nodeValue
]
- ]));
+ ]);
}, 0);
} else if (id == 2) {
setTimeout(function() {
- callback(goog.json.serialize(
+ RemoteDomAgent.GetChildNodesResult(callId,
[
[
4, // id
@@ -62,43 +61,64 @@ devtools.DevToolsHostStub.prototype.getChildNodes = function(id, callback) {
["foo","bar"], // attributes
0, // childNodeCount
]
- ]));
+ ]);
}, 0);
}
};
-devtools.DevToolsHostStub.prototype.attach = function() {
+RemoteDomAgentStub.prototype.SetAttribute = function() {
};
-devtools.DevToolsHostStub.prototype.evaluate = function(str) {
+RemoteDomAgentStub.prototype.RemoveAttribute = function() {
};
-devtools.DevToolsHostStub.prototype.setAttribute = function() {
+RemoteDomAgentStub.prototype.SetTextNodeValue = function() {
};
-devtools.DevToolsHostStub.prototype.removeAttribute = function() {
+/**
+ * @constructor
+ */
+RemoteToolsAgentStub = function() {
+};
+
+
+RemoteToolsAgentStub.prototype.HideDOMNodeHighlight = function() {
+};
+
+
+RemoteToolsAgentStub.prototype.HighlightDOMNode = function() {
};
-devtools.DevToolsHostStub.prototype.setTextNodeValue = function() {
+RemoteToolsAgentStub.prototype.SetDomAgentEnabled = function() {
};
-devtools.DevToolsHostStub.prototype.hideDOMNodeHighlight = function() {
+RemoteToolsAgentStub.prototype.SetNetAgentEnabled = function() {
};
-devtools.DevToolsHostStub.prototype.highlighDOMNode = function() {
+/**
+ * @constructor
+ */
+RemoteNetAgentStub = function() {
};
-devtools.DevToolsHostStub.prototype.debuggerSendMessage = function() {
+/**
+ * @constructor
+ */
+DevToolsHostStub = function() {
};
+
if (!window['DevToolsHost']) {
- window['DevToolsHost'] = new devtools.DevToolsHostStub();
-} \ No newline at end of file
+ window['RemoteDomAgent'] = new RemoteDomAgentStub();
+ window['RemoteNetAgent'] = new RemoteNetAgentStub();
+ window['RemoteToolsAgent'] = new RemoteToolsAgentStub();
+ window['DevToolsHost'] = new DevToolsHostStub();
+}
diff --git a/webkit/glue/devtools/js/dom.js b/webkit/glue/devtools/js/dom_agent.js
index c745333..bc5c9a1f 100644
--- a/webkit/glue/devtools/js/dom.js
+++ b/webkit/glue/devtools/js/dom_agent.js
@@ -6,9 +6,12 @@
* @fileoverview Dom and DomNode are used to represent remote DOM in the
* web inspector.
*/
+goog.provide('devtools.DomAgent');
goog.provide('devtools.DomDocument');
goog.provide('devtools.DomNode');
+goog.require('devtools.Callback');
+
/**
* Defines indexes for the node payload properties.
@@ -182,7 +185,6 @@ devtools.DomDocument = function() {
[], // attributes
0, // childNodeCount
]);
- this.id_to_dom_node_ = { 0 : this };
this.listeners_ = {};
this.defaultView = {
getComputedStyle : function() {},
@@ -246,73 +248,140 @@ devtools.DomDocument.prototype.fireDomEvent_ = function(name, event) {
/**
- * Sets root document element.
- * @param {Array.<Object>} payload Document element data.
+ * Creates DomAgent Js representation.
+ * @constructor
+ */
+devtools.DomAgent = function() {
+ this.document = new devtools.DomDocument();
+ this.idToDomNode_ = { 0 : this.document };
+ RemoteDomAgent.GetDocumentElementResult =
+ devtools.Callback.processCallback;
+ RemoteDomAgent.GetChildNodesResult =
+ devtools.Callback.processCallback;
+ RemoteDomAgent.AttributesUpdated =
+ goog.bind(this.attributesUpdated, this);
+ RemoteDomAgent.ChildNodesUpdated =
+ goog.bind(this.childNodesUpdated, this);
+ RemoteDomAgent.HasChildrenUpdated =
+ goog.bind(this.hasChildrenUpdated, this);
+ RemoteDomAgent.ChildNodeInserted =
+ goog.bind(this.childNodeInserted, this);
+ RemoteDomAgent.ChildNodeRemoved =
+ goog.bind(this.childNodeRemoved, this);
+};
+
+
+/**
+ * Requests that the document element is sent from the agent.
+ * @param {function(Array.<devtools.DomNode>):undefined} opt_callback Callback
+ * with the result.
+ */
+devtools.DomAgent.prototype.getDocumentElementAsync = function(opt_callback) {
+ if (this.document.documentElement) {
+ if (opt_callback) {
+ opt_callback(this.document.documentElement);
+ }
+ return;
+ }
+ var self = this;
+ var mycallback = function(payload) {
+ self.childNodesUpdated(0, [payload]);
+ self.document.documentElement = self.document.firstChild;
+ self.document.documentElement.ownerDocument = self.document;
+ self.document.fireDomEvent_("DOMContentLoaded");
+ if (opt_callback) {
+ opt_callback(self.document.documentElement);
+ }
+ };
+ var callId = devtools.Callback.wrap(mycallback);
+ RemoteDomAgent.GetDocumentElement(callId);
+};
+
+
+/**
+ * Asynchronously fetches children from the element with given id.
+ * @param {number} parentId Element to get children for.
+ * @param {function(devtools.DomNode):undefined} opt_callback Callback with
+ * the result.
*/
-devtools.DomDocument.prototype.setDocumentElement = function(payload) {
- this.setChildren(0, [payload]);
- this.documentElement = this.firstChild;
- this.fireDomEvent_("DOMContentLoaded");
+devtools.DomAgent.prototype.getChildNodesAsync = function(parentId,
+ opt_callback) {
+ var children = this.idToDomNode_[parentId].children;
+ if (children && opt_callback) {
+ opt_callback(children);
+ return;
+ }
+ var self = this;
+ var mycallback = function(data) {
+ self.childNodesUpdated(parentId, data);
+ if (opt_callback) {
+ opt_callback(self.idToDomNode_[parentId].children);
+ }
+ };
+ var callId = devtools.Callback.wrap(mycallback);
+ RemoteDomAgent.GetChildNodes(callId, parentId);
};
/**
- * Sets element's children.
- * @param {string} id Parent id.
- * @param {Array.<Object>} payloads Array with elements' data.
+ * @see DomAgentDelegate.
+ * {@inheritDoc}.
*/
-devtools.DomDocument.prototype.setChildren = function(id, payloads) {
- var parent = this.id_to_dom_node_[id];
+devtools.DomAgent.prototype.attributesUpdated = function(nodeId, attrsArray) {
+ var node = this.idToDomNode_[nodeId];
+ node.setAttributesPayload_(attrsArray);
+};
+
+
+/**
+ * @see DomAgentDelegate.
+ * {@inheritDoc}.
+ */
+devtools.DomAgent.prototype.childNodesUpdated = function(parentId, payloads) {
+ var parent = this.idToDomNode_[parentId];
parent.setChildrenPayload_(payloads);
var children = parent.children;
for (var i = 0; i < children.length; ++i) {
- this.id_to_dom_node_[children[i].id] = children[i];
+ this.idToDomNode_[children[i].id] = children[i];
}
};
/**
- * Inserts node into the given parent after the given anchor.
- * @param {string} parentId Parent id.
- * @param {string} prevId Node to insert given node after.
- * @param {Array.<Object>} payload Node data.
+ * @see DomAgentDelegate.
+ * {@inheritDoc}.
*/
-devtools.DomDocument.prototype.nodeInserted = function(
- parentId, prevId, payload) {
- var parent = this.id_to_dom_node_[parentId];
- var prev = this.id_to_dom_node_[prevId];
- var node = parent.insertChild_(prev, payload);
- this.id_to_dom_node_[node.id] = node;
- var event = { target : node, relatedNode : parent };
- this.fireDomEvent_("DOMNodeInserted", event);
+devtools.DomAgent.prototype.hasChildrenUpdated = function(nodeId, newValue) {
};
/**
- * Removes node from the given parent.
- * @param {string} parentId Parent id.
- * @param {string} nodeId Id of the node to remove.
+ * @see DomAgentDelegate.
+ * {@inheritDoc}.
*/
-devtools.DomDocument.prototype.nodeRemoved = function(
- parentId, nodeId) {
- var parent = this.id_to_dom_node_[parentId];
- var node = this.id_to_dom_node_[nodeId];
- parent.removeChild_(node);
+devtools.DomAgent.prototype.childNodeInserted = function(
+ parentId, prevId, payload) {
+ var parent = this.idToDomNode_[parentId];
+ var prev = this.idToDomNode_[prevId];
+ var node = parent.insertChild_(prev, payload);
+ this.idToDomNode_[node.id] = node;
var event = { target : node, relatedNode : parent };
- this.fireDomEvent_("DOMNodeRemoved", event);
- delete this.id_to_dom_node_[nodeId];
+ this.document.fireDomEvent_("DOMNodeInserted", event);
};
/**
- * Sets attributes to an element with given id.
- * @param {string} nodeId Id of the element to set attributes for.
- * @param {Array.<Object>} attrsArray Flat attributes data.
+ * @see DomAgentDelegate.
+ * {@inheritDoc}.
*/
-devtools.DomDocument.prototype.setAttributes = function(
- nodeId, attrsArray) {
- var node = this.id_to_dom_node_[nodeId];
- node.setAttributesPayload_(attrsArray);
+devtools.DomAgent.prototype.childNodeRemoved = function(
+ parentId, nodeId) {
+ var parent = this.idToDomNode_[parentId];
+ var node = this.idToDomNode_[nodeId];
+ parent.removeChild_(node);
+ var event = { target : node, relatedNode : parent };
+ this.document.fireDomEvent_("DOMNodeRemoved", event);
+ delete this.idToDomNode_[nodeId];
};
diff --git a/webkit/glue/devtools/js/inspector_controller.js b/webkit/glue/devtools/js/inspector_controller.js
index 6a7871a..578be7f 100644
--- a/webkit/glue/devtools/js/inspector_controller.js
+++ b/webkit/glue/devtools/js/inspector_controller.js
@@ -152,6 +152,7 @@ devtools.InspectorController.prototype.moveByUnrestricted = function(x, y) {
*/
devtools.InspectorController.prototype.addResourceSourceToFrame =
function(identifier, element) {
+ return false;
};
@@ -163,7 +164,7 @@ devtools.InspectorController.prototype.addResourceSourceToFrame =
*/
devtools.InspectorController.prototype.addSourceToFrame =
function(mimeType, source, element) {
- return true;
+ return false;
};
diff --git a/webkit/glue/devtools/js/inspector_controller_impl.js b/webkit/glue/devtools/js/inspector_controller_impl.js
index 91199fc..b873a2f 100644
--- a/webkit/glue/devtools/js/inspector_controller_impl.js
+++ b/webkit/glue/devtools/js/inspector_controller_impl.js
@@ -15,7 +15,7 @@ devtools.InspectorControllerImpl = function() {
this.window_ = {
get document() {
- return dom;
+ return domAgent.document;
},
get Node() {
return devtools.DomNode;
@@ -53,8 +53,22 @@ devtools.InspectorControllerImpl.prototype.addSourceToFrame =
/**
* {@inheritDoc}.
*/
+devtools.InspectorController.prototype.addResourceSourceToFrame =
+ function(identifier, element) {
+ var self = this;
+ netAgent.getResourceContentAsync(identifier, function(source) {
+ var resource = netAgent.getResource(identifier);
+ self.addSourceToFrame(resource.mimeType, source, element);
+ });
+ return false;
+};
+
+
+/**
+ * {@inheritDoc}.
+ */
devtools.InspectorControllerImpl.prototype.hideDOMNodeHighlight = function() {
- DevToolsHost.hideDOMNodeHighlight();
+ RemoteToolsAgent.HideDOMNodeHighlight();
};
@@ -63,7 +77,7 @@ devtools.InspectorControllerImpl.prototype.hideDOMNodeHighlight = function() {
*/
devtools.InspectorControllerImpl.prototype.highlightDOMNode =
function(hoveredNode) {
- DevToolsHost.highlightDOMNode(hoveredNode.id);
+ RemoteToolsAgent.HighlightDOMNode(hoveredNode.id);
};
diff --git a/webkit/glue/devtools/js/net.js b/webkit/glue/devtools/js/net_agent.js
index 92933b2..0c0d9fe 100644
--- a/webkit/glue/devtools/js/net.js
+++ b/webkit/glue/devtools/js/net_agent.js
@@ -7,15 +7,62 @@
* HTTP requests and responses.
* web inspector.
*/
-goog.provide('devtools.Net');
+goog.provide('devtools.NetAgent');
-devtools.Net = function() {
+devtools.NetAgent = function() {
this.resources_ = {};
this.id_for_url_ = {};
+
+ RemoteNetAgent.GetResourceContentResult =
+ devtools.Callback.processCallback;
+ RemoteNetAgent.WillSendRequest =
+ goog.bind(this.willSendRequest, this);
+ RemoteNetAgent.DidReceiveResponse =
+ goog.bind(this.didReceiveResponse, this);
+ RemoteNetAgent.DidFinishLoading =
+ goog.bind(this.didFinishLoading, this);
+ RemoteNetAgent.DidFailLoading =
+ goog.bind(this.didFailLoading, this);
+};
+
+
+/**
+ * Returns resource object for given identifier.
+ * @param {number} identifier Identifier to get resource for.
+ * @return {WebInspector.Resouce} Resulting resource.
+ */
+devtools.NetAgent.prototype.getResource = function(identifier) {
+ return this.resources_[identifier];
+};
+
+
+/**
+ * Asynchronously queries for the resource content.
+ * @param {number} identifier Resource identifier.
+ * @param {function(string):undefined} opt_callback Callback to call when
+ * result is available.
+ */
+devtools.NetAgent.prototype.getResourceContentAsync = function(identifier,
+ opt_callback) {
+ var resource = this.resources_[identifier];
+ if (!resource) {
+ return;
+ }
+ var mycallback = function(content) {
+ if (opt_callback) {
+ opt_callback(content);
+ }
+ };
+ RemoteNetAgent.GetResourceContent(
+ devtools.Callback.wrap(mycallback), identifier, resource.url);
};
-devtools.Net.prototype.willSendRequest = function(identifier, request) {
+/**
+ * @see NetAgentDelegate.
+ * {@inheritDoc}.
+ */
+devtools.NetAgent.prototype.willSendRequest = function(identifier, request) {
var mainResource = false;
var cached = false;
var resource = new WebInspector.Resource(request.requestHeaders,
@@ -28,7 +75,11 @@ devtools.Net.prototype.willSendRequest = function(identifier, request) {
};
-devtools.Net.prototype.didReceiveResponse = function(identifier, response) {
+/**
+ * @see NetAgentDelegate.
+ * {@inheritDoc}.
+ */
+devtools.NetAgent.prototype.didReceiveResponse = function(identifier, response) {
var resource = this.resources_[identifier];
if (!resource) {
return;
@@ -52,7 +103,11 @@ devtools.Net.prototype.didReceiveResponse = function(identifier, response) {
};
-devtools.Net.prototype.didFinishLoading = function(identifier, value) {
+/**
+ * @see NetAgentDelegate.
+ * {@inheritDoc}.
+ */
+devtools.NetAgent.prototype.didFinishLoading = function(identifier, value) {
var resource = this.resources_[identifier];
if (!resource) {
return;
@@ -63,7 +118,11 @@ devtools.Net.prototype.didFinishLoading = function(identifier, value) {
};
-devtools.Net.prototype.didFailLoading = function(identifier, value) {
+/**
+ * @see NetAgentDelegate.
+ * {@inheritDoc}.
+ */
+devtools.NetAgent.prototype.didFailLoading = function(identifier, value) {
var resource = this.resources_[identifier];
if (!resource) {
return;
@@ -72,8 +131,3 @@ devtools.Net.prototype.didFailLoading = function(identifier, value) {
resource.finished = false;
resource.failed = true;
};
-
-
-devtools.Net.prototype.setResourceContent = function(identifier,
- content) {
-};
diff --git a/webkit/glue/glue.vcproj b/webkit/glue/glue.vcproj
index 7cab829..f052299 100644
--- a/webkit/glue/glue.vcproj
+++ b/webkit/glue/glue.vcproj
@@ -1,965 +1,969 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="Glue"
- ProjectGUID="{C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09}"
- RootNamespace="glue"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- <ToolFile
- RelativePath=".\devtools\devtools_copy.rules"
- />
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- ConfigurationType="4"
- InheritedPropertySheets="$(SolutionDir)..\build\debug.vsprops;.\glue.vsprops"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="devtools file copy"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- ConfigurationType="4"
- InheritedPropertySheets="..\..\build\release.vsprops;.\glue.vsprops"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="API"
- >
- <File
- RelativePath=".\autofill_form.cc"
- >
- </File>
- <File
- RelativePath=".\autofill_form.h"
- >
- </File>
- <File
- RelativePath=".\console_message_level.h"
- >
- </File>
- <File
- RelativePath=".\context_menu.h"
- >
- </File>
- <File
- RelativePath=".\cpp_bound_class.h"
- >
- </File>
- <File
- RelativePath=".\cpp_variant.h"
- >
- </File>
- <File
- RelativePath=".\dom_operations.h"
- >
- </File>
- <File
- RelativePath=".\form_data.h"
- >
- </File>
- <File
- RelativePath=".\image_decoder.h"
- >
- </File>
- <File
- RelativePath=".\password_form.h"
- >
- </File>
- <File
- RelativePath=".\resource_type.h"
- >
- </File>
- <File
- RelativePath=".\screen_info.h"
- >
- </File>
- <File
- RelativePath=".\webaccessibility.h"
- >
- </File>
- <File
- RelativePath=".\webaccessibilitymanager.h"
- >
- </File>
- <File
- RelativePath=".\webdatasource.h"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsagent.h"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsagent_delegate.h"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsclient.h"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsclient_delegate.h"
- >
- </File>
- <File
- RelativePath=".\weberror.h"
- >
- </File>
- <File
- RelativePath=".\webframe.h"
- >
- </File>
- <File
- RelativePath=".\webhistoryitem.h"
- >
- </File>
- <File
- RelativePath=".\webinputevent.h"
- >
- </File>
- <File
- RelativePath=".\webinputevent_win.cc"
- >
- </File>
- <File
- RelativePath=".\webmediaplayer.h"
- >
- </File>
- <File
- RelativePath=".\webmediaplayer_delegate.h"
- >
- </File>
- <File
- RelativePath=".\webplugin.h"
- >
- </File>
- <File
- RelativePath=".\webplugin_delegate.h"
- >
- </File>
- <File
- RelativePath=".\webpreferences.h"
- >
- </File>
- <File
- RelativePath=".\webresponse.h"
- >
- </File>
- <File
- RelativePath=".\webtextinput.h"
- >
- </File>
- <File
- RelativePath=".\weburlrequest.h"
- >
- </File>
- <File
- RelativePath=".\webview.h"
- >
- </File>
- <File
- RelativePath=".\webview_delegate.h"
- >
- </File>
- <File
- RelativePath=".\webwidget.h"
- >
- </File>
- <File
- RelativePath=".\webwidget_delegate.h"
- >
- </File>
- <File
- RelativePath=".\webworker.h"
- >
- </File>
- <File
- RelativePath=".\webworkerclient.h"
- >
- </File>
- <File
- RelativePath=".\window_open_disposition.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Library"
- >
- <File
- RelativePath="..\pending\AccessibleBase.cpp"
- >
- </File>
- <File
- RelativePath="..\pending\AccessibleBase.h"
- >
- </File>
- <File
- RelativePath="..\pending\AccessibleDocument.cpp"
- >
- </File>
- <File
- RelativePath="..\pending\AccessibleDocument.h"
- >
- </File>
- <File
- RelativePath=".\alt_404_page_resource_fetcher.cc"
- >
- </File>
- <File
- RelativePath=".\alt_404_page_resource_fetcher.h"
- >
- </File>
- <File
- RelativePath=".\alt_error_page_resource_fetcher.cc"
- >
- </File>
- <File
- RelativePath=".\alt_error_page_resource_fetcher.h"
- >
- </File>
- <File
- RelativePath=".\back_forward_list_client_impl.cc"
- >
- </File>
- <File
- RelativePath=".\back_forward_list_client_impl.h"
- >
- </File>
- <File
- RelativePath=".\chrome_client_impl.cc"
- >
- </File>
- <File
- RelativePath=".\chrome_client_impl.h"
- >
- </File>
- <File
- RelativePath=".\chromium_bridge_impl.cc"
- >
- </File>
- <File
- RelativePath=".\clipboard_conversion.cc"
- >
- </File>
- <File
- RelativePath=".\clipboard_conversion.h"
- >
- </File>
- <File
- RelativePath=".\context_menu_client_impl.cc"
- >
- </File>
- <File
- RelativePath=".\context_menu_client_impl.h"
- >
- </File>
- <File
- RelativePath=".\cpp_binding_example.cc"
- >
- </File>
- <File
- RelativePath=".\cpp_bound_class.cc"
- >
- </File>
- <File
- RelativePath=".\cpp_variant.cc"
- >
- </File>
- <File
- RelativePath=".\debugger_bridge.cc"
- >
- </File>
- <File
- RelativePath=".\debugger_bridge.h"
- >
- </File>
- <File
- RelativePath=".\dom_operations.cc"
- >
- </File>
- <File
- RelativePath=".\dom_operations_private.h"
- >
- </File>
- <File
- RelativePath=".\dom_serializer.cc"
- >
- </File>
- <File
- RelativePath=".\dom_serializer.h"
- >
- </File>
- <File
- RelativePath=".\dom_serializer_delegate.h"
- >
- </File>
- <File
- RelativePath=".\dragclient_impl.cc"
- >
- </File>
- <File
- RelativePath=".\dragclient_impl.h"
- >
- </File>
- <File
- RelativePath=".\editor_client_impl.cc"
- >
- </File>
- <File
- RelativePath=".\editor_client_impl.h"
- >
- </File>
- <File
- RelativePath=".\entity_map.cc"
- >
- </File>
- <File
- RelativePath=".\entity_map.h"
- >
- </File>
- <File
- RelativePath=".\event_conversion.cc"
- >
- </File>
- <File
- RelativePath=".\event_conversion.h"
- >
- </File>
- <File
- RelativePath=".\feed_preview.cc"
- >
- </File>
- <File
- RelativePath=".\feed_preview.h"
- >
- </File>
- <File
- RelativePath=".\glue_accessibility_object.cc"
- >
- </File>
- <File
- RelativePath=".\glue_accessibility_object.h"
- >
- </File>
- <File
- RelativePath=".\glue_serialize.cc"
- >
- </File>
- <File
- RelativePath=".\glue_serialize.h"
- >
- </File>
- <File
- RelativePath=".\glue_util.cc"
- >
- </File>
- <File
- RelativePath=".\glue_util.h"
- >
- </File>
- <File
- RelativePath=".\image_decoder.cc"
- >
- </File>
- <File
- RelativePath=".\image_resource_fetcher.cc"
- >
- </File>
- <File
- RelativePath=".\image_resource_fetcher.h"
- >
- </File>
- <File
- RelativePath=".\inspector_client_impl.cc"
- >
- </File>
- <File
- RelativePath=".\inspector_client_impl.h"
- >
- </File>
- <File
- RelativePath=".\localized_strings.cc"
- >
- </File>
- <File
- RelativePath=".\media_player_private_impl.cc"
- >
- </File>
- <File
- RelativePath=".\multipart_response_delegate.cc"
- >
- </File>
- <File
- RelativePath=".\multipart_response_delegate.h"
- >
- </File>
- <File
- RelativePath=".\npruntime_util.cc"
- >
- </File>
- <File
- RelativePath=".\npruntime_util.h"
- >
- </File>
- <File
- RelativePath=".\password_autocomplete_listener.cc"
- >
- </File>
- <File
- RelativePath=".\password_autocomplete_listener.h"
- >
- </File>
- <File
- RelativePath=".\password_form_dom_manager.cc"
- >
- </File>
- <File
- RelativePath=".\password_form_dom_manager.h"
- >
- </File>
- <File
- RelativePath=".\resource.h"
- >
- </File>
- <File
- RelativePath=".\resource_fetcher.cc"
- >
- </File>
- <File
- RelativePath=".\resource_fetcher.h"
- >
- </File>
- <File
- RelativePath=".\resource_handle_impl.cc"
- >
- </File>
- <File
- RelativePath=".\resource_loader_bridge.cc"
- >
- </File>
- <File
- RelativePath=".\resource_loader_bridge.h"
- >
- </File>
- <File
- RelativePath=".\scoped_clipboard_writer_glue.h"
- >
- </File>
- <File
- RelativePath=".\searchable_form_data.cc"
- >
- </File>
- <File
- RelativePath=".\searchable_form_data.h"
- >
- </File>
- <File
- RelativePath=".\simple_webmimeregistry_impl.cc"
- >
- </File>
- <File
- RelativePath=".\simple_webmimeregistry_impl.h"
- >
- </File>
- <File
- RelativePath=".\stacking_order_iterator.cc"
- >
- </File>
- <File
- RelativePath=".\stacking_order_iterator.h"
- >
- </File>
- <File
- RelativePath=".\webaccessibilitymanager_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webaccessibilitymanager_impl.h"
- >
- </File>
- <File
- RelativePath=".\webclipboard_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webclipboard_impl.h"
- >
- </File>
- <File
- RelativePath=".\webcursor.cc"
- >
- </File>
- <File
- RelativePath=".\webcursor.h"
- >
- </File>
- <File
- RelativePath=".\webcursor_win.cc"
- >
- </File>
- <File
- RelativePath=".\webdatasource_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webdatasource_impl.h"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsagent_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsagent_impl.h"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsclient_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsclient_impl.h"
- >
- </File>
- <File
- RelativePath=".\webdropdata.cc"
- >
- </File>
- <File
- RelativePath=".\webdropdata.h"
- >
- </File>
- <File
- RelativePath=".\weberror_impl.cc"
- >
- </File>
- <File
- RelativePath=".\weberror_impl.h"
- >
- </File>
- <File
- RelativePath=".\webframe_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webframe_impl.h"
- >
- </File>
- <File
- RelativePath=".\webframeloaderclient_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webframeloaderclient_impl.h"
- >
- </File>
- <File
- RelativePath=".\webhistoryitem_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webhistoryitem_impl.h"
- >
- </File>
- <File
- RelativePath=".\webinputevent_util.cc"
- >
- </File>
- <File
- RelativePath=".\webinputevent_util.h"
- >
- </File>
- <File
- RelativePath=".\webkit_glue.cc"
- >
- </File>
- <File
- RelativePath=".\webkit_glue.h"
- >
- </File>
- <File
- RelativePath=".\webkit_glue_win.cc"
- >
- </File>
- <File
- RelativePath=".\webkitclient_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webkitclient_impl.h"
- >
- </File>
- <File
- RelativePath=".\webmediaplayer_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webmediaplayer_impl.h"
- >
- </File>
- <File
- RelativePath=".\webplugin_delegate.cc"
- >
- </File>
- <File
- RelativePath=".\webplugin_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webplugin_impl.h"
- >
- </File>
- <File
- RelativePath=".\webresponse_impl.h"
- >
- </File>
- <File
- RelativePath=".\webscriptsource.h"
- >
- </File>
- <File
- RelativePath=".\webtextinput_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webtextinput_impl.h"
- >
- </File>
- <File
- RelativePath=".\webthemeengine_impl_win.cc"
- >
- </File>
- <File
- RelativePath=".\webthemeengine_impl_win.h"
- >
- </File>
- <File
- RelativePath=".\weburlrequest_impl.cc"
- >
- </File>
- <File
- RelativePath=".\weburlrequest_impl.h"
- >
- </File>
- <File
- RelativePath=".\webview_delegate.cc"
- >
- </File>
- <File
- RelativePath=".\webview_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webview_impl.h"
- >
- </File>
- <File
- RelativePath=".\webwidget_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webwidget_impl.h"
- >
- </File>
- <File
- RelativePath=".\webworker_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webworker_impl.h"
- >
- </File>
- <File
- RelativePath=".\webworkerclient_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webworkerclient_impl.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Plugins"
- >
- <File
- RelativePath=".\plugins\mozilla_extensions.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\mozilla_extensions.h"
- >
- </File>
- <File
- RelativePath=".\plugins\nphostapi.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_constants_win.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_host.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_host.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_instance.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_instance.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_lib.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_lib.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_lib_win.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_list.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_list.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_list_win.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_stream.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_stream.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_stream_url.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_stream_url.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_stream_win.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_string_stream.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_string_stream.h"
- >
- </File>
- <File
- RelativePath=".\plugins\webplugin_delegate_impl.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\webplugin_delegate_impl.h"
- >
- </File>
- </Filter>
- <Filter
- Name="DevTools"
- >
- <File
- RelativePath=".\devtools\devtools_rpc.cc"
- >
- </File>
- <File
- RelativePath=".\devtools\devtools_rpc.h"
- >
- </File>
- <File
- RelativePath=".\devtools\dom_agent.h"
- >
- </File>
- <File
- RelativePath=".\devtools\dom_agent_impl.cc"
- >
- </File>
- <File
- RelativePath=".\devtools\dom_agent_impl.h"
- >
- </File>
- <File
- RelativePath=".\devtools\net_agent.h"
- >
- </File>
- <File
- RelativePath=".\devtools\net_agent_impl.cc"
- >
- </File>
- <File
- RelativePath=".\devtools\net_agent_impl.h"
- >
- </File>
- <File
- RelativePath=".\devtools\tools_agent.h"
- >
- </File>
- <Filter
- Name="js"
- >
- <File
- RelativePath=".\devtools\js\base.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\devtools.html"
- >
- </File>
- <File
- RelativePath=".\devtools\js\devtools.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\devtools_host_stub.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\dom.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\inspector_controller.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\inspector_controller_impl.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\json.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\net.js"
- >
- </File>
- </Filter>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="Glue"
+ ProjectGUID="{C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09}"
+ RootNamespace="glue"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ <ToolFile
+ RelativePath=".\devtools\devtools_copy.rules"
+ />
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(SolutionDir)..\build\debug.vsprops;.\glue.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="devtools file copy"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="4"
+ InheritedPropertySheets="..\..\build\release.vsprops;.\glue.vsprops"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="API"
+ >
+ <File
+ RelativePath=".\autofill_form.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\autofill_form.h"
+ >
+ </File>
+ <File
+ RelativePath=".\console_message_level.h"
+ >
+ </File>
+ <File
+ RelativePath=".\context_menu.h"
+ >
+ </File>
+ <File
+ RelativePath=".\cpp_bound_class.h"
+ >
+ </File>
+ <File
+ RelativePath=".\cpp_variant.h"
+ >
+ </File>
+ <File
+ RelativePath=".\dom_operations.h"
+ >
+ </File>
+ <File
+ RelativePath=".\form_data.h"
+ >
+ </File>
+ <File
+ RelativePath=".\image_decoder.h"
+ >
+ </File>
+ <File
+ RelativePath=".\password_form.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource_type.h"
+ >
+ </File>
+ <File
+ RelativePath=".\screen_info.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webaccessibility.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webaccessibilitymanager.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webdatasource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webdevtoolsagent.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webdevtoolsagent_delegate.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webdevtoolsclient.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webdevtoolsclient_delegate.h"
+ >
+ </File>
+ <File
+ RelativePath=".\weberror.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webframe.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webhistoryitem.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webinputevent.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webinputevent_win.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webmediaplayer.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webmediaplayer_delegate.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webplugin.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webplugin_delegate.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webpreferences.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webresponse.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webtextinput.h"
+ >
+ </File>
+ <File
+ RelativePath=".\weburlrequest.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webview.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webview_delegate.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webwidget.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webwidget_delegate.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webworker.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webworkerclient.h"
+ >
+ </File>
+ <File
+ RelativePath=".\window_open_disposition.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Library"
+ >
+ <File
+ RelativePath="..\pending\AccessibleBase.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\pending\AccessibleBase.h"
+ >
+ </File>
+ <File
+ RelativePath="..\pending\AccessibleDocument.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\pending\AccessibleDocument.h"
+ >
+ </File>
+ <File
+ RelativePath=".\alt_404_page_resource_fetcher.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\alt_404_page_resource_fetcher.h"
+ >
+ </File>
+ <File
+ RelativePath=".\alt_error_page_resource_fetcher.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\alt_error_page_resource_fetcher.h"
+ >
+ </File>
+ <File
+ RelativePath=".\back_forward_list_client_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\back_forward_list_client_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\chrome_client_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\chrome_client_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\chromium_bridge_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\clipboard_conversion.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\clipboard_conversion.h"
+ >
+ </File>
+ <File
+ RelativePath=".\context_menu_client_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\context_menu_client_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\cpp_binding_example.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\cpp_bound_class.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\cpp_variant.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\debugger_bridge.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\debugger_bridge.h"
+ >
+ </File>
+ <File
+ RelativePath=".\dom_operations.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\dom_operations_private.h"
+ >
+ </File>
+ <File
+ RelativePath=".\dom_serializer.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\dom_serializer.h"
+ >
+ </File>
+ <File
+ RelativePath=".\dom_serializer_delegate.h"
+ >
+ </File>
+ <File
+ RelativePath=".\dragclient_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\dragclient_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\editor_client_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\editor_client_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\entity_map.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\entity_map.h"
+ >
+ </File>
+ <File
+ RelativePath=".\event_conversion.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\event_conversion.h"
+ >
+ </File>
+ <File
+ RelativePath=".\feed_preview.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\feed_preview.h"
+ >
+ </File>
+ <File
+ RelativePath=".\glue_accessibility_object.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\glue_accessibility_object.h"
+ >
+ </File>
+ <File
+ RelativePath=".\glue_serialize.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\glue_serialize.h"
+ >
+ </File>
+ <File
+ RelativePath=".\glue_util.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\glue_util.h"
+ >
+ </File>
+ <File
+ RelativePath=".\image_decoder.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\image_resource_fetcher.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\image_resource_fetcher.h"
+ >
+ </File>
+ <File
+ RelativePath=".\inspector_client_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\inspector_client_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\localized_strings.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\media_player_private_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\multipart_response_delegate.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\multipart_response_delegate.h"
+ >
+ </File>
+ <File
+ RelativePath=".\npruntime_util.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\npruntime_util.h"
+ >
+ </File>
+ <File
+ RelativePath=".\password_autocomplete_listener.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\password_autocomplete_listener.h"
+ >
+ </File>
+ <File
+ RelativePath=".\password_form_dom_manager.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\password_form_dom_manager.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource_fetcher.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\resource_fetcher.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource_handle_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\resource_loader_bridge.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\resource_loader_bridge.h"
+ >
+ </File>
+ <File
+ RelativePath=".\scoped_clipboard_writer_glue.h"
+ >
+ </File>
+ <File
+ RelativePath=".\searchable_form_data.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\searchable_form_data.h"
+ >
+ </File>
+ <File
+ RelativePath=".\simple_webmimeregistry_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\simple_webmimeregistry_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\stacking_order_iterator.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\stacking_order_iterator.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webaccessibilitymanager_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webaccessibilitymanager_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webclipboard_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webclipboard_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webcursor.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webcursor.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webcursor_win.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webdatasource_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webdatasource_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webdevtoolsagent_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webdevtoolsagent_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webdevtoolsclient_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webdevtoolsclient_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webdropdata.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webdropdata.h"
+ >
+ </File>
+ <File
+ RelativePath=".\weberror_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\weberror_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webframe_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webframe_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webframeloaderclient_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webframeloaderclient_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webhistoryitem_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webhistoryitem_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webinputevent_util.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webinputevent_util.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webkit_glue.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webkit_glue.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webkit_glue_win.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webkitclient_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webkitclient_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webmediaplayer_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webmediaplayer_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webplugin_delegate.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webplugin_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webplugin_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webresponse_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webscriptsource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webtextinput_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webtextinput_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webthemeengine_impl_win.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webthemeengine_impl_win.h"
+ >
+ </File>
+ <File
+ RelativePath=".\weburlrequest_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\weburlrequest_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webview_delegate.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webview_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webview_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webwidget_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webwidget_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webworker_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webworker_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\webworkerclient_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\webworkerclient_impl.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Plugins"
+ >
+ <File
+ RelativePath=".\plugins\mozilla_extensions.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\mozilla_extensions.h"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\nphostapi.h"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_constants_win.h"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_host.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_host.h"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_instance.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_instance.h"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_lib.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_lib.h"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_lib_win.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_list.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_list.h"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_list_win.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_stream.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_stream.h"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_stream_url.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_stream_url.h"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_stream_win.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_string_stream.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\plugin_string_stream.h"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\webplugin_delegate_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\plugins\webplugin_delegate_impl.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="DevTools"
+ >
+ <File
+ RelativePath=".\devtools\devtools_rpc.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\devtools_rpc.h"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\devtools_rpc_js.h"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\dom_agent.h"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\dom_agent_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\dom_agent_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\net_agent.h"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\net_agent_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\net_agent_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\tools_agent.h"
+ >
+ </File>
+ <Filter
+ Name="js"
+ >
+ <File
+ RelativePath=".\devtools\js\base.js"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\js\devtools.html"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\js\devtools.js"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\js\devtools_host_stub.js"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\js\dom_agent.js"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\js\inspector_controller.js"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\js\inspector_controller_impl.js"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\js\json.js"
+ >
+ </File>
+ <File
+ RelativePath=".\devtools\js\net_agent.js"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/webkit/glue/webdevtoolsclient_impl.cc b/webkit/glue/webdevtoolsclient_impl.cc
index b13e6c3..269b159 100644
--- a/webkit/glue/webdevtoolsclient_impl.cc
+++ b/webkit/glue/webdevtoolsclient_impl.cc
@@ -19,6 +19,10 @@
#include "base/string_util.h"
#include "base/values.h"
+#include "webkit/glue/devtools/devtools_rpc_js.h"
+#include "webkit/glue/devtools/dom_agent.h"
+#include "webkit/glue/devtools/net_agent.h"
+#include "webkit/glue/devtools/tools_agent.h"
#include "webkit/glue/glue_util.h"
#include "webkit/glue/webdevtoolsclient_delegate.h"
#include "webkit/glue/webdevtoolsclient_impl.h"
@@ -32,6 +36,13 @@ using WebCore::Node;
using WebCore::Page;
using WebCore::String;
+DEFINE_RPC_JS_BOUND_OBJ(DomAgent, DOM_AGENT_STRUCT,
+ DomAgentDelegate, DOM_AGENT_DELEGATE_STRUCT)
+DEFINE_RPC_JS_BOUND_OBJ(NetAgent, NET_AGENT_STRUCT,
+ NetAgentDelegate, NET_AGENT_DELEGATE_STRUCT)
+DEFINE_RPC_JS_BOUND_OBJ(ToolsAgent, TOOLS_AGENT_STRUCT,
+ ToolsAgentDelegate, TOOLS_AGENT_DELEGATE_STRUCT)
+
/*static*/
WebDevToolsClient* WebDevToolsClient::Create(
WebView* view,
@@ -43,212 +54,55 @@ WebDevToolsClientImpl::WebDevToolsClientImpl(
WebViewImpl* web_view_impl,
WebDevToolsClientDelegate* delegate)
: web_view_impl_(web_view_impl),
- delegate_(delegate),
- last_call_id_(1) {
- dom_agent_stub_.set(new DomAgentStub(this));
- net_agent_stub_.set(new NetAgentStub(this));
- tools_agent_stub_.set(new ToolsAgentStub(this));
-
- BindToJavascript(web_view_impl_->GetMainFrame(), L"DevToolsHost");
- BindMethod("getDocumentElement",
- &WebDevToolsClientImpl::JsGetDocumentElement);
- BindMethod("getChildNodes", &WebDevToolsClientImpl::JsGetChildNodes);
- BindMethod("setAttribute", &WebDevToolsClientImpl::JsSetAttribute);
- BindMethod("removeAttribute", &WebDevToolsClientImpl::JsRemoveAttribute);
- BindMethod("setTextNodeValue", &WebDevToolsClientImpl::JsSetTextNodeValue);
- BindMethod("highlightDOMNode", &WebDevToolsClientImpl::JsHighlightDOMNode);
- BindMethod("hideDOMNodeHighlight",
- &WebDevToolsClientImpl::JsHideDOMNodeHighlight);
-}
-
-WebDevToolsClientImpl::~WebDevToolsClientImpl() {
-}
-
-// DomAgent::DomAgentDelegate implementation.
-void WebDevToolsClientImpl::GetDocumentElementResult(
- int call_id,
- const std::string& root) {
- ProcessCallback(call_id, root);
-}
-
-void WebDevToolsClientImpl::GetChildNodesResult(
- int call_id,
- const std::string& list) {
- ProcessCallback(call_id, list);
-}
-
-void WebDevToolsClientImpl::AttributesUpdated(int id, const Value& attributes) {
- MakeJsCall("dom.setAttributes", id, &attributes);
-}
-
-void WebDevToolsClientImpl::ChildNodesUpdated(int id, const Value& children) {
- MakeJsCall("dom.setChildren", id, &children);
-}
-
-void WebDevToolsClientImpl::ChildNodeInserted(
- int parent_id,
- int prev_id,
- const Value& value) {
- MakeJsCall("dom.nodeInserted", parent_id, prev_id, &value);
-}
-
-void WebDevToolsClientImpl::ChildNodeRemoved(int parent_id, int id) {
- MakeJsCall("dom.nodeRemoved", parent_id, id);
-}
-
-void WebDevToolsClientImpl::HasChildrenUpdated(int id, bool new_value) {
- MakeJsCall("dom.setHasChildren", id, true);
-}
-
-// NetAgent::NetAgentDelegate implementation.
-void WebDevToolsClientImpl::WillSendRequest(
- int identifier,
- const Value& request) {
- MakeJsCall("net.willSendRequest", identifier, &request);
-}
-
-void WebDevToolsClientImpl::DidReceiveResponse(
- int identifier,
- const Value& response) {
- MakeJsCall("net.didReceiveResponse", identifier, &response);
-}
-
-void WebDevToolsClientImpl::DidFinishLoading(int identifier,
- const Value& response) {
- MakeJsCall("net.didFinishLoading", identifier, &response);
-}
-
-void WebDevToolsClientImpl::DidFailLoading(int identifier,
- const Value& response) {
- MakeJsCall("net.didFailLoading", identifier, &response);
-}
-
-void WebDevToolsClientImpl::GetResourceContentResult(
- int call_id,
- const std::string& content) {
- ProcessCallback(call_id, content);
-}
-
-void WebDevToolsClientImpl::UpdateFocusedNode(int node_id) {
- MakeJsCall("tools.updateFocusedNode", node_id);
-}
-
-void WebDevToolsClientImpl::ProcessCallback(
- int call_id,
- const std::string& data) {
- HashMap<int, CppVariant>::iterator it = callbacks_.find(call_id);
- if (it != callbacks_.end()) {
- CppVariant result;
- CppVariant args[2];
- args[0].Set(*GetAsCppVariant());
- args[1].Set(data);
- it->second.Invoke("call", args, 2, result);
- callbacks_.remove(call_id);
- }
-}
-
-void WebDevToolsClientImpl::JsGetResourceSource(
- const CppArgumentList& args,
- CppVariant* result) {
- int call_id = last_call_id_++;
- net_agent_stub_->GetResourceContent(call_id, args[0].ToInt32(),
- webkit_glue::StdStringToString(args[1].ToString()));
- callbacks_.set(call_id, args[1]);
-}
-
-void WebDevToolsClientImpl::JsGetDocumentElement(
- const CppArgumentList& args,
- CppVariant* result) {
- tools_agent_stub_->SetDomAgentEnabled(true);
- tools_agent_stub_->SetNetAgentEnabled(true);
- int call_id = last_call_id_++;
- dom_agent_stub_->GetDocumentElement(call_id);
- callbacks_.set(call_id, args[0]);
- result->SetNull();
-}
-
-void WebDevToolsClientImpl::JsGetChildNodes(
- const CppArgumentList& args,
- CppVariant* result) {
- int call_id = last_call_id_++;
- dom_agent_stub_->GetChildNodes(call_id, args[0].ToInt32());
- callbacks_.set(call_id, args[1]);
- result->SetNull();
-}
-
-void WebDevToolsClientImpl::JsSetAttribute(
- const CppArgumentList& args,
- CppVariant* result) {
- dom_agent_stub_->SetAttribute(args[0].ToInt32(),
- webkit_glue::StdStringToString(args[1].ToString()),
- webkit_glue::StdStringToString(args[2].ToString()));
- result->SetNull();
-}
-
-void WebDevToolsClientImpl::JsRemoveAttribute(
- const CppArgumentList& args,
- CppVariant* result) {
- dom_agent_stub_->RemoveAttribute(args[0].ToInt32(),
- webkit_glue::StdStringToString(args[1].ToString()));
- result->SetNull();
-}
-
-void WebDevToolsClientImpl::JsSetTextNodeValue(
- const CppArgumentList& args,
- CppVariant* result) {
- dom_agent_stub_->SetTextNodeValue(args[0].ToInt32(),
- webkit_glue::StdStringToString(args[1].ToString()));
- result->SetNull();
-}
+ delegate_(delegate) {
+ WebFrame* frame = web_view_impl_->GetMainFrame();
+ dom_agent_obj_.set(new JsDomAgentBoundObj(this, frame, L"RemoteDomAgent"));
+ net_agent_obj_.set(new JsNetAgentBoundObj(this, frame, L"RemoteNetAgent"));
+ tools_agent_obj_.set(new JsToolsAgentBoundObj(this, frame, L"RemoteToolsAgent"));
-void WebDevToolsClientImpl::JsHighlightDOMNode(
- const CppArgumentList& args,
- CppVariant* result) {
- tools_agent_stub_->HighlightDOMNode(args[0].ToInt32());
- result->SetNull();
+ BindToJavascript(frame, L"DevToolsHost");
+ BindMethod("addSourceToFrame", &WebDevToolsClientImpl::JsAddSourceToFrame);
}
-void WebDevToolsClientImpl::JsHideDOMNodeHighlight(const CppArgumentList& args,
- CppVariant* result) {
- tools_agent_stub_->HideDOMNodeHighlight();
- result->SetNull();
-}
-
-void WebDevToolsClientImpl::EvaluateJs(const std::string& expr) {
- web_view_impl_->GetMainFrame()->ExecuteScript(expr);
+WebDevToolsClientImpl::~WebDevToolsClientImpl() {
}
void WebDevToolsClientImpl::DispatchMessageFromAgent(
const std::string& raw_msg) {
OwnPtr<ListValue> message(
static_cast<ListValue*>(DevToolsRpc::ParseMessage(raw_msg)));
- if (DomAgentDelegateDispatch::Dispatch(this, *message.get()))
- return;
- if (NetAgentDelegateDispatch::Dispatch(this, *message.get()))
- return;
- if (ToolsAgentDelegateDispatch::Dispatch(this, *message.get()))
- return;
+
+ std::string expr;
+ if (dom_agent_obj_->Dispatch(*message.get(), &expr)
+ || net_agent_obj_->Dispatch(*message.get(), &expr)
+ || tools_agent_obj_->Dispatch(*message.get(), &expr)) {
+ web_view_impl_->GetMainFrame()->ExecuteScript(expr);
+ }
}
void WebDevToolsClientImpl::SendRpcMessage(const std::string& raw_msg) {
delegate_->SendMessageToAgent(raw_msg);
}
-// static
-std::string WebDevToolsClientImpl::ToJSON(const String& value) {
- StringValue str(webkit_glue::StringToStdString(value));
- return ToJSON(&str);
-}
-
-// static
-std::string WebDevToolsClientImpl::ToJSON(int value) {
- FundamentalValue fund(value);
- return ToJSON(&fund);
-}
+void WebDevToolsClientImpl::JsAddSourceToFrame(
+ const CppArgumentList& args,
+ CppVariant* result) {
+ std::string mime_type = args[0].ToString();
+ std::string source = args[1].ToString();
+ std::string node_id = args[2].ToString();
+
+ Page* page = web_view_impl_->page();
+ Document* document = page->mainFrame()->document();
+ Node* node = document->getElementById(
+ webkit_glue::StdStringToString(node_id));
+ if (!node) {
+ result->SetNull();
+ return;
+ }
-// static
-std::string WebDevToolsClientImpl::ToJSON(const Value* value) {
- std::string json;
- JSONWriter::Write(value, false, &json);
- return json;
+ page->inspectorController()->addSourceToFrame(
+ webkit_glue::StdStringToString(mime_type),
+ webkit_glue::StdStringToString(source),
+ node);
+ result->SetNull();
}
diff --git a/webkit/glue/webdevtoolsclient_impl.h b/webkit/glue/webdevtoolsclient_impl.h
index 91ea321..f05cad6 100644
--- a/webkit/glue/webdevtoolsclient_impl.h
+++ b/webkit/glue/webdevtoolsclient_impl.h
@@ -7,67 +7,31 @@
#include <string>
-#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
-#include "base/string_util.h"
#include "webkit/glue/cpp_bound_class.h"
#include "webkit/glue/devtools/devtools_rpc.h"
-#include "webkit/glue/devtools/dom_agent.h"
-#include "webkit/glue/devtools/net_agent.h"
-#include "webkit/glue/devtools/tools_agent.h"
#include "webkit/glue/webdevtoolsclient.h"
namespace WebCore {
class String;
}
-class DomAgentStub;
-class NetAgentStub;
-class ToolsAgentStub;
+class JsDomAgentBoundObj;
+class JsNetAgentBoundObj;
+class JsToolsAgentBoundObj;
class WebDevToolsClientDelegate;
class WebViewImpl;
class WebDevToolsClientImpl : public WebDevToolsClient,
public CppBoundClass,
- public DevToolsRpc::Delegate,
- public DomAgentDelegate,
- public NetAgentDelegate,
- public ToolsAgentDelegate {
+ public DevToolsRpc::Delegate {
public:
WebDevToolsClientImpl(
WebViewImpl* web_view_impl,
WebDevToolsClientDelegate* delegate);
virtual ~WebDevToolsClientImpl();
- // DomAgentDelegate implementation.
- virtual void GetDocumentElementResult(int call_id, const std::string& value);
- virtual void GetChildNodesResult(int call_id, const std::string& value);
- virtual void AttributesUpdated(int id, const Value& attributes);
- virtual void ChildNodesUpdated(int id, const Value& value);
- virtual void ChildNodeInserted(
- int parent_id,
- int prev_id,
- const Value& value);
- virtual void ChildNodeRemoved(int parent_id, int id);
- virtual void HasChildrenUpdated(int id, bool new_value);
-
- // NetAgentDelegate implementation.
- virtual void WillSendRequest(
- int identifier,
- const Value& request);
- virtual void DidReceiveResponse(
- int identifier,
- const Value& response);
- virtual void DidFinishLoading(int identifier, const Value& response);
- virtual void DidFailLoading(int identifier, const Value& response);
- virtual void GetResourceContentResult(
- int call_id,
- const std::string& content);
-
- // ToolsAgentDelegate implementation.
- virtual void UpdateFocusedNode(int node_id);
-
// DevToolsRpc::Delegate implementation.
virtual void SendRpcMessage(const std::string& raw_msg);
@@ -75,71 +39,13 @@ class WebDevToolsClientImpl : public WebDevToolsClient,
virtual void DispatchMessageFromAgent(const std::string& raw_msg);
private:
- void ProcessCallback(int call_id, const std::string& data);
- // MakeJsCall templates.
- void MakeJsCall(const std::string& func) {
- EvaluateJs(StringPrintf("%s()", func.c_str()));
- }
- template<class T1>
- void MakeJsCall(const std::string& func, T1 t1) {
- EvaluateJs(StringPrintf("%s(%s)", func.c_str(),
- ToJSON(t1).c_str()));
- }
- template<class T1, class T2>
- void MakeJsCall(const std::string& func, T1 t1, T2 t2) {
- EvaluateJs(StringPrintf("%s(%s, %s)", func.c_str(),
- ToJSON(t1).c_str(), ToJSON(t2).c_str()));
- }
- template<class T1, class T2, class T3>
- void MakeJsCall(const std::string& func, T1 t1, T2 t2, T3 t3) {
- EvaluateJs(StringPrintf("%s(%s, %s, %s)", func.c_str(),
- ToJSON(t1).c_str(), ToJSON(t2).c_str(), ToJSON(t3).c_str()));
- }
- template<class T1, class T2, class T3, class T4>
- void MakeJsCall(const std::string& func, T1 t1, T2 t2, T3 t3, T4 t4) {
- EvaluateJs(StringPrintf("%s(%s, %s, %s, %s)", func.c_str(),
- ToJSON(t1).c_str(), ToJSON(t2).c_str(), ToJSON(t3).c_str(),
- ToJSON(t4).c_str()));
- }
- template<class T1, class T2, class T3, class T4, class T5>
- void MakeJsCall(const std::string& func, T1 t1, T2 t2, T3 t3, T4 t4,
- T5 t5) {
- EvaluateJs(StringPrintf("%s(%s, %s, %s, %s, %s)",
- func.c_str(), ToJSON(t1).c_str(), ToJSON(t2).c_str(),
- ToJSON(t3).c_str(), ToJSON(t4).c_str(), ToJSON(t5).c_str()));
- }
-
- void EvaluateJs(const std::string& expr);
-
- void JsGetResourceSource(const CppArgumentList& args, CppVariant* result);
-
- void JsGetDocumentElement(const CppArgumentList& args, CppVariant* result);
-
- void JsGetChildNodes(const CppArgumentList& args, CppVariant* result);
-
- void JsSetAttribute(const CppArgumentList& args, CppVariant* result);
-
- void JsRemoveAttribute(const CppArgumentList& args, CppVariant* result);
-
- void JsSetTextNodeValue(const CppArgumentList& args, CppVariant* result);
-
- void JsHighlightDOMNode(const CppArgumentList& args, CppVariant* result);
-
- void JsHideDOMNodeHighlight(const CppArgumentList& args, CppVariant* result);
-
- private:
- // Serializers
- static std::string ToJSON(const WebCore::String& value);
- static std::string ToJSON(int value);
- static std::string ToJSON(const Value* value);
+ void JsAddSourceToFrame(const CppArgumentList& args, CppVariant* result);
WebViewImpl* web_view_impl_;
WebDevToolsClientDelegate* delegate_;
- OwnPtr<DomAgentStub> dom_agent_stub_;
- OwnPtr<NetAgentStub> net_agent_stub_;
- OwnPtr<ToolsAgentStub> tools_agent_stub_;
- int last_call_id_;
- HashMap<int, CppVariant> callbacks_;
+ OwnPtr<JsDomAgentBoundObj> dom_agent_obj_;
+ OwnPtr<JsNetAgentBoundObj> net_agent_obj_;
+ OwnPtr<JsToolsAgentBoundObj> tools_agent_obj_;
DISALLOW_COPY_AND_ASSIGN(WebDevToolsClientImpl);
};
diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp
index 3a70454..954bfbc 100644
--- a/webkit/webkit.gyp
+++ b/webkit/webkit.gyp
@@ -4202,6 +4202,7 @@
# names.
'glue/devtools/devtools_rpc.cc',
'glue/devtools/devtools_rpc.h',
+ 'glue/devtools/devtools_rpc_js.h',
'glue/devtools/dom_agent.h',
'glue/devtools/dom_agent_impl.cc',
'glue/devtools/dom_agent_impl.h',