| 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. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 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 report unspecified implementation-dependent report for debugging p
urposes; | 35 * @param report unspecified implementation-dependent report for debugging p
urposes; |
| 36 * may be null | 36 * may be null |
| 37 * @param changeDescription describes live editing change that has been appl
ied or is planned | 37 * @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 | 38 * to be applied; may be null if backend or VM does not support |
| 39 */ | 39 */ |
| 40 void success(Object report, ChangeDescription changeDescription); | 40 void success(Object report, ChangeDescription changeDescription); |
| 41 void failure(String message); | 41 void failure(String message, Failure details); |
| 42 } | 42 } |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * An interface that explains what has happened/going to happen within script
update action. | 45 * An interface that explains what has happened/going to happen within script
update action. |
| 46 */ | 46 */ |
| 47 interface ChangeDescription { | 47 interface ChangeDescription { |
| 48 /** | 48 /** |
| 49 * @return the root of the function change tree | 49 * @return the root of the function change tree |
| 50 */ | 50 */ |
| 51 OldFunctionNode getChangeTree(); | 51 OldFunctionNode getChangeTree(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 FunctionPositions getNewPositions(); | 108 FunctionPositions getNewPositions(); |
| 109 | 109 |
| 110 List<? extends NewFunctionNode> newChildren(); | 110 List<? extends NewFunctionNode> newChildren(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 /** | 113 /** |
| 114 * Represents a brand new function in the changed script, that has no correspo
nding old function. | 114 * Represents a brand new function in the changed script, that has no correspo
nding old function. |
| 115 */ | 115 */ |
| 116 interface NewFunctionNode extends FunctionNode<NewFunctionNode> { | 116 interface NewFunctionNode extends FunctionNode<NewFunctionNode> { |
| 117 } | 117 } |
| 118 |
| 119 /** |
| 120 * Specifies failure type. |
| 121 */ |
| 122 interface Failure { |
| 123 <R> R accept(Visitor<R> visitor); |
| 124 |
| 125 interface Visitor<R> { |
| 126 R visitUnspecified(); |
| 127 R visitCompileError(CompileErrorFailure compileErrorFailure); |
| 128 } |
| 129 |
| 130 Failure UNSPECIFIED = new Failure() { |
| 131 @Override public <R> R accept(Visitor<R> visitor) { |
| 132 return visitor.visitUnspecified(); |
| 133 } |
| 134 }; |
| 135 } |
| 136 |
| 137 /** |
| 138 * Describes failure caused by compile error. |
| 139 */ |
| 140 interface CompileErrorFailure extends Failure { |
| 141 /** |
| 142 * A string message returned by JavaScript compiler. |
| 143 */ |
| 144 String getCompilerMessage(); |
| 145 |
| 146 /** @return error start position in text. */ |
| 147 TextStreamPosition getStartPosition(); |
| 148 |
| 149 /** @return error end position in text. */ |
| 150 TextStreamPosition getEndPosition(); |
| 151 } |
| 118 } | 152 } |
| OLD | NEW |