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.ExceptionData; |
|
8 |
import org.chromium.sdk.JsObject; |
|
9 |
||
10 |
/** |
|
11 |
* An immutable implementation of the ExceptionData interface. |
|
12 |
*/ |
|
13 |
public class ExceptionDataImpl implements ExceptionData { |
|
14 |
||
15 |
private final InternalContext context; |
|
16 |
private final String sourceText; |
|
17 |
private final ValueMirror mirror; |
|
18 |
private final String name; |
|
19 |
private final boolean isUncaught; |
|
20 |
private final String exceptionText; |
|
21 |
private JsObject cachedException; |
|
22 |
||
23 |
public ExceptionDataImpl(InternalContext context, ValueMirror mirror, String name, |
|
24 |
boolean isUncaught, String sourceText, String exceptionText) { |
|
25 |
this.context = context; |
|
26 |
this.mirror = mirror; |
|
27 |
this.name = name; |
|
28 |
this.isUncaught = isUncaught; |
|
29 |
this.sourceText = sourceText; |
|
30 |
this.exceptionText = exceptionText; |
|
31 |
} |
|
32 |
||
33 |
public JsObject getExceptionObject() { |
|
34 |
if (cachedException == null) { |
|
52
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
35 |
cachedException = |
f577ea64429e
Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
36 |
new JsObjectImpl(context.getTopFrameImpl().getInternalContext(), name, mirror); |
2 | 37 |
} |
38 |
return cachedException; |
|
39 |
} |
|
40 |
||
41 |
public String getSourceText() { |
|
42 |
return sourceText; |
|
43 |
} |
|
44 |
||
45 |
public boolean isUncaught() { |
|
46 |
return isUncaught; |
|
47 |
} |
|
48 |
||
49 |
public String getExceptionMessage() { |
|
50 |
return exceptionText; |
|
51 |
} |
|
52 |
||
53 |
} |