diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 13:03:51 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 13:03:51 +0000 |
commit | 097e38421957bcdf84a79fbed193570fbb2e647e (patch) | |
tree | 088062f435d940d67b06a1b7a35a5b0850cb9243 /webkit/glue/devtools/dom_agent.h | |
parent | 31d58b18c3ae0bc157eab12371f5777f3340cabc (diff) | |
download | chromium_src-097e38421957bcdf84a79fbed193570fbb2e647e.zip chromium_src-097e38421957bcdf84a79fbed193570fbb2e647e.tar.gz chromium_src-097e38421957bcdf84a79fbed193570fbb2e647e.tar.bz2 |
Initial WebDevToolsAgent implementation contains two agent objects: Dom agent
and Net agent.
Dom agent provides API for querying for DOM nodes and receiving notifications
on
Dom updates. It has some logic in and this logic is covered with the unit
tests.
Net agent pushes an initial set of request/response-related events to the
client. It is to be filled with more data later on. It currently caches loaders
for all the requests which is Ok for the case when this agent is turned ON (at
least for now).
Note that this code is not yet wired to the dev tools agent (this is by design).
The plan is to start enrolling the dev tools agent glue that connects these
sub-agents with the IPC transport once this CL is in.
Original CL: http://codereview.chromium.org/41008/show
Review URL: http://codereview.chromium.org/43128
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11531 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/devtools/dom_agent.h')
-rw-r--r-- | webkit/glue/devtools/dom_agent.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/webkit/glue/devtools/dom_agent.h b/webkit/glue/devtools/dom_agent.h new file mode 100644 index 0000000..a2d8818 --- /dev/null +++ b/webkit/glue/devtools/dom_agent.h @@ -0,0 +1,60 @@ +// 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_DEVTOOLS_DOM_AGENT_H_ +#define WEBKIT_GLUE_DEVTOOLS_DOM_AGENT_H_ + +#include "webkit/glue/devtools/devtools_rpc.h" + +// DomAgent is a utility object that covers DOM-related functionality of the +// WebDevToolsAgent. It is capable of sending DOM tree to the client as well +// as providing DOM notifications for the nodes known to the client. +// DomAgent's environment is represented with the DomAgentDelegate interface. +#define DOM_AGENT_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3) \ + /* Requests that the document root element is sent to the delegate. */ \ + METHOD0(GetDocumentElement) \ + \ + /* Requests that the element's children are sent to the client. */ \ + METHOD1(GetChildNodes, int /* id */) \ + \ + /* Sets attribute value in the element with given id. */ \ + METHOD3(SetAttribute, int /* id */, String /* name */, String /* value */) \ + \ + /* Removes attribute from the element with given id. */ \ + METHOD2(RemoveAttribute, int /* id */, String /* name */) \ + \ + /* Sets text node value in the node with given id. */ \ + METHOD2(SetTextNodeValue, int /* id */, String /* text */) \ + \ + /* Tells dom agent that the client has lost all of the dom-related + information and is no longer interested in the notifications related to the + nodes issued earlier. */ \ + METHOD0(DiscardBindings) + +DEFINE_RPC_CLASS(DomAgent, DOM_AGENT_STRUCT) + +#define DOM_AGENT_DELEGATE_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3) \ + /* Notifies the delegate that document element is available. */ \ + METHOD1(DocumentElementUpdated, Value /* node */) \ + \ + /* Notifies the delegate that element's attributes are updated. */ \ + METHOD2(AttributesUpdated, int /* id */, Value /* attributes */) \ + \ + /* Notifies the delegate that element's child nodes have been updated. */ \ + METHOD2(ChildNodesUpdated, int /* id */, Value /* node */) \ + \ + /* Notifies the delegate that element's 'has children' state has been + updated */ \ + METHOD2(HasChildrenUpdated, int /* id */, bool /* new_value */) \ + \ + /* Notifies the delegate that child node has been inserted. */ \ + METHOD3(ChildNodeInserted, int /* parent_id */ , int /* prev_id */, \ + Value /* node */) \ + \ + /* Notifies the delegate that child node has been deleted. */ \ + METHOD2(ChildNodeRemoved, int /* parent_id */, int /* id */) + +DEFINE_RPC_CLASS(DomAgentDelegate, DOM_AGENT_DELEGATE_STRUCT) + +#endif // WEBKIT_GLUE_DEVTOOLS_DOM_AGENT_H_ |