| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.internal.wip; | 5 package org.chromium.sdk.internal.wip; |
| 6 | 6 |
| 7 import java.util.List; | 7 import java.util.List; |
| 8 | 8 |
| 9 import org.chromium.sdk.RelayOk; | 9 import org.chromium.sdk.RelayOk; |
| 10 import org.chromium.sdk.Script; | 10 import org.chromium.sdk.Script; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 RelaySyncCallback relay = new RelaySyncCallback(syncCallback); | 50 RelaySyncCallback relay = new RelaySyncCallback(syncCallback); |
| 51 final RelaySyncCallback.Guard guard = relay.newGuard(); | 51 final RelaySyncCallback.Guard guard = relay.newGuard(); |
| 52 | 52 |
| 53 SetScriptSourceParams params = new SetScriptSourceParams(getId(), newSource,
preview); | 53 SetScriptSourceParams params = new SetScriptSourceParams(getId(), newSource,
preview); |
| 54 | 54 |
| 55 GenericCallback<SetScriptSourceData> commandCallback = | 55 GenericCallback<SetScriptSourceData> commandCallback = |
| 56 new GenericCallback<SetScriptSourceData>() { | 56 new GenericCallback<SetScriptSourceData>() { |
| 57 @Override | 57 @Override |
| 58 public void success(SetScriptSourceData value) { | 58 public void success(SetScriptSourceData value) { |
| 59 // TODO: support 'step in recommended' here. |
| 59 RelayOk relayOk = | 60 RelayOk relayOk = |
| 60 possiblyUpdateCallFrames(preview, value, updateCallback, guard.getRe
lay()); | 61 possiblyUpdateCallFrames(preview, value, updateCallback, guard.getRe
lay()); |
| 61 guard.discharge(relayOk); | 62 guard.discharge(relayOk); |
| 62 } | 63 } |
| 63 | 64 |
| 64 @Override | 65 @Override |
| 65 public void failure(Exception exception) { | 66 public void failure(Exception exception) { |
| 66 // TODO: provide failure details when supported by protocol. | 67 // TODO: provide failure details when supported by protocol. |
| 67 UpdatableScript.Failure failure = UpdatableScript.Failure.UNSPECIFIED; | 68 UpdatableScript.Failure failure = UpdatableScript.Failure.UNSPECIFIED; |
| 68 updateCallback.failure(exception.getMessage(), failure); | 69 updateCallback.failure(exception.getMessage(), failure); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 if (updateCallback != null) { | 106 if (updateCallback != null) { |
| 106 LiveEditResult liveEditResult; | 107 LiveEditResult liveEditResult; |
| 107 try { | 108 try { |
| 108 liveEditResult = | 109 liveEditResult = |
| 109 LiveEditProtocolParserAccess.get().parseLiveEditResult(result.getUnd
erlyingObject()); | 110 LiveEditProtocolParserAccess.get().parseLiveEditResult(result.getUnd
erlyingObject()); |
| 110 } catch (JsonProtocolParseException e) { | 111 } catch (JsonProtocolParseException e) { |
| 111 throw new RuntimeException("Failed to parse LiveEdit response", e); | 112 throw new RuntimeException("Failed to parse LiveEdit response", e); |
| 112 } | 113 } |
| 113 ChangeDescription wrappedChangeDescription = | 114 ChangeDescription wrappedChangeDescription = |
| 114 UpdateResultParser.wrapChangeDescription(liveEditResult); | 115 UpdateResultParser.wrapChangeDescription(liveEditResult); |
| 115 updateCallback.success(null, wrappedChangeDescription); | 116 updateCallback.success(false, null, wrappedChangeDescription); |
| 116 } | 117 } |
| 117 } | 118 } |
| 118 } | 119 } |
| OLD | NEW |