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

Unified Diff: plugins/org.chromium.sdk/src/org/chromium/sdk/JsVariable.java

Issue 11662019: Support variable changing in SDK interface and v8 native (Closed) Base URL: https://chromedevtools.googlecode.com/svn/trunk
Patch Set: merge Created 7 years, 11 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: plugins/org.chromium.sdk/src/org/chromium/sdk/JsVariable.java
diff --git a/plugins/org.chromium.sdk/src/org/chromium/sdk/JsVariable.java b/plugins/org.chromium.sdk/src/org/chromium/sdk/JsVariable.java
index a291a028b89fe40ecc9f354fe8f745f7f4fdd573..341edcb799d39b216d831449c74101872f018f68 100755
--- a/plugins/org.chromium.sdk/src/org/chromium/sdk/JsVariable.java
+++ b/plugins/org.chromium.sdk/src/org/chromium/sdk/JsVariable.java
@@ -10,15 +10,6 @@ package org.chromium.sdk;
public interface JsVariable {
/**
- * A callback to use while setting a variable value.
- */
- interface SetValueCallback {
- void success();
-
- void failure(String errorMessage);
- }
-
- /**
* @return whether it is possible to read this variable
*/
boolean isReadable();
@@ -54,13 +45,35 @@ public interface JsVariable {
*
* @param newValue to set
* @param callback to report the operation result to
+ * @param syncCallback to report the end of any processing
* @see #isMutable()
* @throws UnsupportedOperationException if this variable is not mutable
*/
- void setValue(String newValue, SetValueCallback callback)
+ RelayOk setValue(JsValue newValue, SetValueCallback callback, SyncCallback syncCallback)
throws UnsupportedOperationException;
/**
+ * A callback to use while setting a variable value.
+ */
+ interface SetValueCallback {
+ /**
+ * Variable is successfully updated. New value is available in {@link JsVariable#getValue()}.
+ */
+ void success();
+
+ /**
+ * Variable hasn't been updated because exception was thrown. Most probably this exception was
+ * thrown from setter function.
+ */
+ void exceptionThrown(JsValue exception);
+
+ /**
+ * Variable hasn't been updated for unknown reason.
+ */
+ void failure(Exception cause);
+ }
+
+ /**
* Returns object property data if variable is an object property and its descriptor
* is available.
*/

Powered by Google App Engine
This is Rietveld 408576698