Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Unified Diff: chrome/browser/automation/automation_provider_observers.cc

Issue 6614023: Convert ChromeDriver to use only the JSON automation interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address Pawel's additional comments Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/automation_provider_observers.cc
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 7afc0d0c5a9159b6d46229df7b99f28195d8b204..878f5286b7a0382479a0e6ed8f08ae426bb88a1d 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -2009,6 +2009,10 @@ void AllTabsStoppedLoadingObserver::Observe(
}
void AllTabsStoppedLoadingObserver::CheckIfStopped() {
+ if (!automation_) {
+ delete this;
+ return;
+ }
bool done_loading = true;
BrowserList::const_iterator iter = BrowserList::begin();
for (; iter != BrowserList::end(); ++iter) {
@@ -2095,3 +2099,24 @@ void WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread() {
automation_->Send(reply_message_.release());
Release();
}
+
+ExecuteJavascriptObserver::ExecuteJavascriptObserver(
+ AutomationProvider* automation,
+ IPC::Message* reply_message)
+ : automation_(automation->AsWeakPtr()),
+ reply_message_(reply_message) {
+}
+
+ExecuteJavascriptObserver::~ExecuteJavascriptObserver() {
+}
+
+void ExecuteJavascriptObserver::OnDomOperationCompleted(
+ const std::string& json) {
+ if (automation_) {
+ DictionaryValue dict;
+ dict.SetString("result", json);
+ AutomationJSONReply(automation_, reply_message_.release())
+ .SendSuccess(&dict);
+ }
+ delete this;
+}
« no previous file with comments | « chrome/browser/automation/automation_provider_observers.h ('k') | chrome/browser/automation/testing_automation_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698