| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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.v8native; | 5 package org.chromium.sdk.internal.v8native; |
| 6 | 6 |
| 7 import java.util.ArrayList; | 7 import java.util.ArrayList; |
| 8 import java.util.Collections; | 8 import java.util.Collections; |
| 9 import java.util.List; | 9 import java.util.List; |
| 10 import java.util.concurrent.atomic.AtomicReference; | 10 import java.util.concurrent.atomic.AtomicReference; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 import org.chromium.sdk.internal.v8native.protocol.V8ProtocolUtil; | 26 import org.chromium.sdk.internal.v8native.protocol.V8ProtocolUtil; |
| 27 import org.chromium.sdk.internal.v8native.protocol.input.FailedCommandResponse.E
rrorDetails; | 27 import org.chromium.sdk.internal.v8native.protocol.input.FailedCommandResponse.E
rrorDetails; |
| 28 import org.chromium.sdk.internal.v8native.protocol.input.FrameObject; | 28 import org.chromium.sdk.internal.v8native.protocol.input.FrameObject; |
| 29 import org.chromium.sdk.internal.v8native.protocol.input.RestartFrameBody; | 29 import org.chromium.sdk.internal.v8native.protocol.input.RestartFrameBody; |
| 30 import org.chromium.sdk.internal.v8native.protocol.input.ScopeRef; | 30 import org.chromium.sdk.internal.v8native.protocol.input.ScopeRef; |
| 31 import org.chromium.sdk.internal.v8native.protocol.input.SuccessCommandResponse; | 31 import org.chromium.sdk.internal.v8native.protocol.input.SuccessCommandResponse; |
| 32 import org.chromium.sdk.internal.v8native.protocol.output.DebuggerMessage; | 32 import org.chromium.sdk.internal.v8native.protocol.output.DebuggerMessage; |
| 33 import org.chromium.sdk.internal.v8native.protocol.output.DebuggerMessageFactory
; | 33 import org.chromium.sdk.internal.v8native.protocol.output.DebuggerMessageFactory
; |
| 34 import org.chromium.sdk.internal.v8native.protocol.output.RestartFrameMessage; | 34 import org.chromium.sdk.internal.v8native.protocol.output.RestartFrameMessage; |
| 35 import org.chromium.sdk.internal.v8native.value.JsScopeImpl; | 35 import org.chromium.sdk.internal.v8native.value.JsScopeImpl; |
| 36 import org.chromium.sdk.internal.v8native.value.JsVariableImpl; | 36 import org.chromium.sdk.internal.v8native.value.JsVariableBase; |
| 37 import org.chromium.sdk.internal.v8native.value.PropertyReference; | 37 import org.chromium.sdk.internal.v8native.value.PropertyReference; |
| 38 import org.chromium.sdk.internal.v8native.value.ValueLoader; | 38 import org.chromium.sdk.internal.v8native.value.ValueLoader; |
| 39 import org.chromium.sdk.internal.v8native.value.ValueMirror; | 39 import org.chromium.sdk.internal.v8native.value.ValueMirror; |
| 40 import org.chromium.sdk.util.GenericCallback; | 40 import org.chromium.sdk.util.GenericCallback; |
| 41 import org.chromium.sdk.util.MethodIsBlockingException; | 41 import org.chromium.sdk.util.MethodIsBlockingException; |
| 42 import org.chromium.sdk.util.RelaySyncCallback; | 42 import org.chromium.sdk.util.RelaySyncCallback; |
| 43 import org.json.simple.JSONObject; | 43 import org.json.simple.JSONObject; |
| 44 | 44 |
| 45 /** | 45 /** |
| 46 * A generic implementation of the CallFrame interface. | 46 * A generic implementation of the CallFrame interface. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 160 |
| 161 PropertyReference ref = V8Helper.computeReceiverRef(frameObject); | 161 PropertyReference ref = V8Helper.computeReceiverRef(frameObject); |
| 162 if (ref == null) { | 162 if (ref == null) { |
| 163 result = null; | 163 result = null; |
| 164 } else { | 164 } else { |
| 165 ValueLoader valueLoader = context.getValueLoader(); | 165 ValueLoader valueLoader = context.getValueLoader(); |
| 166 ValueMirror mirror = | 166 ValueMirror mirror = |
| 167 valueLoader.getOrLoadValueFromRefs(Collections.singletonList(ref)).get
(0); | 167 valueLoader.getOrLoadValueFromRefs(Collections.singletonList(ref)).get
(0); |
| 168 // This name should be string. We are making it string as a fall-back stra
tegy. | 168 // This name should be string. We are making it string as a fall-back stra
tegy. |
| 169 String varNameStr = ref.getName().toString(); | 169 String varNameStr = ref.getName().toString(); |
| 170 result = new JsVariableImpl.Impl(valueLoader, mirror, varNameStr); | 170 result = new JsVariableBase.Impl(valueLoader, mirror, varNameStr); |
| 171 } | 171 } |
| 172 if (result != null) { | 172 if (result != null) { |
| 173 receiverVariableRef.compareAndSet(null, result); | 173 receiverVariableRef.compareAndSet(null, result); |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 | 176 |
| 177 @Override | 177 @Override |
| 178 public TextStreamPosition getStatementStartPosition() { | 178 public TextStreamPosition getStatementStartPosition() { |
| 179 return textStreamPosition; | 179 return textStreamPosition; |
| 180 } | 180 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } | 369 } |
| 370 | 370 |
| 371 @Override | 371 @Override |
| 372 public boolean canRestartFrame(CallFrame callFrame) { | 372 public boolean canRestartFrame(CallFrame callFrame) { |
| 373 return callFrame.getScript() != null; | 373 return callFrame.getScript() != null; |
| 374 } | 374 } |
| 375 }; | 375 }; |
| 376 | 376 |
| 377 private static final String DEBUGGER_RESERVED = "debugger"; | 377 private static final String DEBUGGER_RESERVED = "debugger"; |
| 378 } | 378 } |
| OLD | NEW |