| Index: content/renderer/dom_automation_controller.h
|
| diff --git a/content/renderer/dom_automation_controller.h b/content/renderer/dom_automation_controller.h
|
| index 0db719f51146250bd358ade4ee42a912d62b9c12..f393ba12c060be06d90b1a0d8ca7fc0211ee06f7 100644
|
| --- a/content/renderer/dom_automation_controller.h
|
| +++ b/content/renderer/dom_automation_controller.h
|
| @@ -11,68 +11,6 @@
|
| #include "content/public/renderer/render_frame_observer.h"
|
| #include "gin/wrappable.h"
|
|
|
| -/* DomAutomationController class:
|
| - Bound to Javascript window.domAutomationController object.
|
| - At the very basic, this object makes any native value (string, numbers,
|
| - boolean) from javascript available to the automation host in Cpp.
|
| - Any renderer implementation that is built with this binding will allow the
|
| - above facility.
|
| - The intended use of this object is to expose the DOM Objects and their
|
| - attributes to the automation host.
|
| -
|
| - A typical usage would be like following (JS code):
|
| -
|
| - var object = document.getElementById('some_id');
|
| - window.domAutomationController.send(object.nodeName); // get the tag name
|
| -
|
| - For the exact mode of usage,
|
| - refer AutomationProxyTest.*DomAutomationController tests.
|
| -
|
| - The class provides a single send method that can send variety of native
|
| - javascript values. (NPString, Number(double), Boolean)
|
| -
|
| - The actual communication occurs in the following manner:
|
| -
|
| - TEST MASTER RENDERER
|
| - (1) (3)
|
| - |AProxy| ----->|AProvider|----->|RenderView|------|
|
| - /\ | | |
|
| - | | | |
|
| - |(6) |(2) |(0) |(4)
|
| - | | \/ |
|
| - | |-------->|DAController|<----|
|
| - | |
|
| - | |(5)
|
| - |-------|WebContentsImpl|<--------|
|
| -
|
| -
|
| - Legends:
|
| - - AProxy = AutomationProxy
|
| - - AProvider = AutomationProvider
|
| - - DAController = DomAutomationController
|
| -
|
| - (0) Initialization step where DAController is bound to the renderer
|
| - and the view_id of the renderer is supplied to the DAController for
|
| - routing message in (5).
|
| - (1) A 'javascript:' url is sent from the test process to master as an IPC
|
| - message. A unique routing id is generated at this stage (automation_id_)
|
| - (2) The automation_id_ of step (1) is supplied to DAController by calling
|
| - the bound method setAutomationId(). This is required for routing message
|
| - in (6).
|
| - (3) The 'javascript:' url is sent for execution by calling into
|
| - Browser::LoadURL()
|
| - (4) A callback is generated as a result of domAutomationController.send()
|
| - into Cpp. The supplied value is received as a result of this callback.
|
| - (5) The value received in (4) is sent to the master along with the
|
| - stored automation_id_ as an IPC message. The frame_'s RenderFrameImpl is
|
| - used to route the message. (IPC messages, ViewHostMsg_*DomAutomation* )
|
| - (6) The value and the automation_id_ is extracted out of the message received
|
| - in (5). This value is relayed to AProxy using another IPC message.
|
| - automation_id_ is used to route the message.
|
| - (IPC messages, AutomationMsg_Dom*Response)
|
| -
|
| -*/
|
| -
|
| namespace blink {
|
| class WebLocalFrame;
|
| }
|
| @@ -85,6 +23,15 @@ namespace content {
|
|
|
| class RenderFrame;
|
|
|
| +// Provides implementation of window.domAutomationController javascript object.
|
| +// Javascript can call domAutomationController.send(...) to send arbitrary data
|
| +// to the browser. On the browser side, the data is received via one of the
|
| +// following:
|
| +// - Product code:
|
| +// - Explicit handlers of FrameHostMsg_DomOperationResponse IPC
|
| +// - Test code:
|
| +// - DOMMessageQueue class
|
| +// - ExecuteScriptAndExtractInt/Bool/String functions
|
| class DomAutomationController : public gin::Wrappable<DomAutomationController>,
|
| public RenderFrameObserver {
|
| public:
|
| @@ -102,11 +49,6 @@ class DomAutomationController : public gin::Wrappable<DomAutomationController>,
|
| // The value should be properly formed JSON.
|
| bool SendJSON(const std::string& json);
|
|
|
| - // Sends a string with a provided Automation Id.
|
| - bool SendWithId(int automation_id, const std::string& str);
|
| -
|
| - bool SetAutomationId(int automation_id);
|
| -
|
| private:
|
| explicit DomAutomationController(RenderFrame* render_view);
|
| ~DomAutomationController() override;
|
|
|