summaryrefslogtreecommitdiffstats
path: root/content/renderer/dom_automation_controller.h
diff options
context:
space:
mode:
authorcraigdh@chromium.org <craigdh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-26 19:36:23 +0000
committercraigdh@chromium.org <craigdh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-26 19:36:23 +0000
commit09f3707c586fb1a1fe4c46765509953d6d6f4871 (patch)
tree01ef25b5b608bed3a86d58d676b044f3433e5913 /content/renderer/dom_automation_controller.h
parent00577aabd2f626429649e374ac9583f1eb47e862 (diff)
downloadchromium_src-09f3707c586fb1a1fe4c46765509953d6d6f4871.zip
chromium_src-09f3707c586fb1a1fe4c46765509953d6d6f4871.tar.gz
chromium_src-09f3707c586fb1a1fe4c46765509953d6d6f4871.tar.bz2
Modified DomAutomationController to expose a new Javascript method sendWithId() and updated the event queue tests to use it.
All DomAutomationController messages need to be coupled with an automation routing id. This was previously done by setting the id through a separate javascript functional call. However, events introduce a race condition where an event raised between the call to set the automation id and actually sending the message would leave the DomAutomationController with a cleared Automation Id and the send() message would fail. A new method sendWithId() allows events to send a message with an automation id in an atomic fashion, without disrupting the automation id held by the DomAutomationController. Change-Id: Ia6be9108ce881ee1a063fc6ff1844587bf122f50 BUG= TEST=functional/apptest.py Review URL: http://codereview.chromium.org/9655002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128971 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/dom_automation_controller.h')
-rw-r--r--content/renderer/dom_automation_controller.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/content/renderer/dom_automation_controller.h b/content/renderer/dom_automation_controller.h
index 576e09d..f1b06f4 100644
--- a/content/renderer/dom_automation_controller.h
+++ b/content/renderer/dom_automation_controller.h
@@ -90,6 +90,14 @@ class DomAutomationController : public CppBoundClass {
// This function does not modify/escape the returned string in any way.
void SendJSON(const CppArgumentList& args, CppVariant* result);
+ // Sends a string with a provided Automation Id.
+ // Expects two javascript values; the first must be a number type and will be
+ // used as the Automation Id, the second must be of type NPString.
+ // The function returns true/false to the javascript based on the success
+ // of the send over IPC. It sets the javascript return value to null on
+ // unexpected errors or arguments.
+ void SendWithId(const CppArgumentList& args, CppVariant* result);
+
void SetAutomationId(const CppArgumentList& args, CppVariant* result);
// TODO(vibhor): Implement later