OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 14 matching lines...) Expand all Loading... |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #include "config.h" | 29 #include "config.h" |
30 #include "ScriptValue.h" | 30 #include "ScriptValue.h" |
31 | 31 |
32 #include <JavaScriptCore/APICast.h> | 32 #include <JavaScriptCore/APICast.h> |
33 #include <JavaScriptCore/JSValueRef.h> | 33 #include <JavaScriptCore/JSValueRef.h> |
34 | 34 |
35 #include "JSInspectedObjectWrapper.h" | |
36 | |
37 #include <runtime/JSLock.h> | 35 #include <runtime/JSLock.h> |
38 #include <runtime/Protect.h> | 36 #include <runtime/Protect.h> |
39 #include <runtime/UString.h> | 37 #include <runtime/UString.h> |
40 | 38 |
41 using namespace JSC; | 39 using namespace JSC; |
42 | 40 |
43 namespace WebCore { | 41 namespace WebCore { |
44 | 42 |
45 #if ENABLE(INSPECTOR) | |
46 ScriptValue ScriptValue::quarantineValue(ScriptState* scriptState, const ScriptV
alue& value) | |
47 { | |
48 JSLock lock(SilenceAssertionsOnly); | |
49 return ScriptValue(JSInspectedObjectWrapper::wrap(scriptState, value.jsValue
())); | |
50 } | |
51 #endif | |
52 | |
53 bool ScriptValue::getString(ScriptState* scriptState, String& result) const | 43 bool ScriptValue::getString(ScriptState* scriptState, String& result) const |
54 { | 44 { |
55 if (!m_value) | 45 if (!m_value) |
56 return false; | 46 return false; |
57 JSLock lock(SilenceAssertionsOnly); | 47 JSLock lock(SilenceAssertionsOnly); |
58 UString ustring; | 48 UString ustring; |
59 if (!m_value.get().getString(scriptState, ustring)) | 49 if (!m_value.get().getString(scriptState, ustring)) |
60 return false; | 50 return false; |
61 result = ustring; | 51 result = ustring; |
62 return true; | 52 return true; |
(...skipping 22 matching lines...) Expand all Loading... |
85 } | 75 } |
86 | 76 |
87 bool ScriptValue::isObject() const | 77 bool ScriptValue::isObject() const |
88 { | 78 { |
89 if (!m_value) | 79 if (!m_value) |
90 return false; | 80 return false; |
91 return m_value.get().isObject(); | 81 return m_value.get().isObject(); |
92 } | 82 } |
93 | 83 |
94 } // namespace WebCore | 84 } // namespace WebCore |
OLD | NEW |