author | Eugene Ostroukhov <eugeneo@symbian.org> |
Mon, 07 Jun 2010 16:51:19 -0700 | |
changeset 355 | 8726e95bcbba |
parent 52 | f577ea64429e |
permissions | -rw-r--r-- |
2 | 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 |
|
3 |
// found in the LICENSE file. |
|
4 |
||
5 |
package org.chromium.sdk.internal; |
|
6 |
||
7 |
import org.chromium.sdk.JsFunction; |
|
8 |
import org.chromium.sdk.Script; |
|
9 |
||
10 |
/** |
|
11 |
* Generic implementation of {@link JsFunction}. |
|
12 |
*/ |
|
13 |
class JsFunctionImpl extends JsObjectImpl implements JsFunction { |
|
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
14 |
JsFunctionImpl(InternalContext context, String parentFqn, ValueMirror valueState) { |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
15 |
super(context, parentFqn, valueState); |
2 | 16 |
} |
17 |
||
18 |
public Script getScript() { |
|
19 |
FunctionAdditionalProperties additionalProperties = |
|
20 |
(FunctionAdditionalProperties) getSubpropertiesMirror().getAdditionalProperties(); |
|
21 |
||
22 |
int scriptId = additionalProperties.getScriptId(); |
|
23 |
if (scriptId == FunctionAdditionalProperties.NO_SCRIPT_ID) { |
|
24 |
return null; |
|
25 |
} |
|
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
26 |
DebugSession debugSession = getInternalContext().getDebugSession(); |
2 | 27 |
return debugSession.getScriptManager().findById(Long.valueOf(scriptId)); |
28 |
} |
|
29 |
||
30 |
public int getSourcePosition() { |
|
31 |
FunctionAdditionalProperties additionalProperties = |
|
32 |
(FunctionAdditionalProperties) getSubpropertiesMirror().getAdditionalProperties(); |
|
33 |
||
34 |
return additionalProperties.getSourcePosition(); |
|
35 |
} |
|
36 |
||
37 |
@Override |
|
38 |
public JsFunction asFunction() { |
|
39 |
return this; |
|
40 |
} |
|
41 |
} |