| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.sdk; | 5 package org.chromium.sdk; |
| 6 | 6 |
| 7 import java.util.List; | 7 import java.util.List; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * This interface is a part of {@link Script} interface. It covers live editing
support. | 10 * This interface is a part of {@link Script} interface. It covers live editing
support. |
| 11 */ | 11 */ |
| 12 public interface UpdatableScript { | 12 public interface UpdatableScript { |
| 13 /** | 13 /** |
| 14 * Demands that script text should be replaced with a new one if possible. VM
may get resumed | 14 * Demands that script text should be replaced with a new one if possible. A t
echnical VM step may |
| 15 * after this command (this is defined by {@link ChangeDescription#isStackModi
fied()}). In this | 15 * be automatically scheduled after this command (this is defined |
| 16 * case a standard 'suspended' notification is expected in a moment. | 16 * by {@link ChangeDescription#isStackModified()}), that is a technical requir
ement of V8. |
| 17 * VM should pause back in a moment, standard 'suspended' notification will be
visible. |
| 17 * @param newSource new text of script | 18 * @param newSource new text of script |
| 18 * TODO: add an explicit output parameter about whether VM was resumed or not. | |
| 19 */ | 19 */ |
| 20 RelayOk setSourceOnRemote(String newSource, UpdateCallback callback, SyncCallb
ack syncCallback); | 20 RelayOk setSourceOnRemote(String newSource, UpdateCallback callback, SyncCallb
ack syncCallback); |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * Same as {@link #setSourceOnRemote}, but does not actually update a script,
only provides | 23 * Same as {@link #setSourceOnRemote}, but does not actually update a script,
only provides |
| 24 * a description of the planned changes. | 24 * a description of the planned changes. |
| 25 * @param callback receives change plan description | 25 * @param callback receives change plan description |
| 26 */ | 26 */ |
| 27 RelayOk previewSetSource(String newSource, UpdateCallback callback, SyncCallba
ck syncCallback); | 27 RelayOk previewSetSource(String newSource, UpdateCallback callback, SyncCallba
ck syncCallback); |
| 28 | 28 |
| 29 interface UpdateCallback { | 29 interface UpdateCallback { |
| 30 /** | 30 /** |
| 31 * Script text change has succeeded or was successfully pre-calculated (in p
review mode). | 31 * Script text change has succeeded or was successfully pre-calculated (in p
review mode). |
| 32 * {@link DebugEventListener#scriptContentChanged} will | 32 * {@link DebugEventListener#scriptContentChanged} will |
| 33 * be called additionally. Besides, a current context may be dismissed and r
ecreated after this | 33 * be called additionally. Besides, a current context may be dismissed and r
ecreated after this |
| 34 * event. The order of all listed event notifications is not currently speci
fied. | 34 * event. The order of all listed event notifications is not currently speci
fied. |
| 35 * @param resumed true if VM has been resumed to make post-change technical
step |
| 35 * @param report unspecified implementation-dependent report for debugging p
urposes; | 36 * @param report unspecified implementation-dependent report for debugging p
urposes; |
| 36 * may be null | 37 * may be null |
| 37 * @param changeDescription describes live editing change that has been appl
ied or is planned | 38 * @param changeDescription describes live editing change that has been appl
ied or is planned |
| 38 * to be applied; may be null if backend or VM does not support | 39 * to be applied; may be null if backend or VM does not support |
| 39 */ | 40 */ |
| 40 void success(Object report, ChangeDescription changeDescription); | 41 void success(boolean resumed, Object report, ChangeDescription changeDescrip
tion); |
| 41 void failure(String message, Failure details); | 42 void failure(String message, Failure details); |
| 42 } | 43 } |
| 43 | 44 |
| 44 /** | 45 /** |
| 45 * An interface that explains what has happened/going to happen within script
update action. | 46 * An interface that explains what has happened/going to happen within script
update action. |
| 46 */ | 47 */ |
| 47 interface ChangeDescription { | 48 interface ChangeDescription { |
| 48 /** | 49 /** |
| 49 * @return the root of the function change tree | 50 * @return the root of the function change tree |
| 50 */ | 51 */ |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 */ | 144 */ |
| 144 String getCompilerMessage(); | 145 String getCompilerMessage(); |
| 145 | 146 |
| 146 /** @return error start position in text. */ | 147 /** @return error start position in text. */ |
| 147 TextStreamPosition getStartPosition(); | 148 TextStreamPosition getStartPosition(); |
| 148 | 149 |
| 149 /** @return error end position in text. */ | 150 /** @return error end position in text. */ |
| 150 TextStreamPosition getEndPosition(); | 151 TextStreamPosition getEndPosition(); |
| 151 } | 152 } |
| 152 } | 153 } |
| OLD | NEW |