OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "ScriptState.h" | 35 #include "ScriptState.h" |
36 #include <runtime/Protect.h> | 36 #include <runtime/Protect.h> |
37 | 37 |
38 namespace WebCore { | 38 namespace WebCore { |
39 | 39 |
40 class String; | 40 class String; |
41 | 41 |
42 class ScriptValue { | 42 class ScriptValue { |
43 public: | 43 public: |
44 ScriptValue(JSC::JSValuePtr value = JSC::noValue()) : m_value(value) {} | 44 ScriptValue(JSC::JSValuePtr value = JSC::noValue()) : m_value(value) {} |
| 45 virtual ~ScriptValue() {} |
45 | 46 |
46 JSC::JSValuePtr jsValue() const { return m_value.get(); } | 47 JSC::JSValuePtr jsValue() const { return m_value.get(); } |
47 bool getString(String& result) const; | 48 bool getString(String& result) const; |
48 String toString(ScriptState* scriptState) const { return m_value.get().toStr
ing(scriptState); } | 49 String toString(ScriptState* scriptState) const { return m_value.get().toStr
ing(scriptState); } |
49 bool isNull() const; | 50 bool isNull() const; |
50 bool isUndefined() const; | 51 bool isUndefined() const; |
51 bool hasNoValue() const { return m_value == JSC::noValue(); } | 52 bool hasNoValue() const { return m_value == JSC::noValue(); } |
52 | 53 |
53 private: | 54 private: |
54 JSC::ProtectedJSValuePtr m_value; | 55 JSC::ProtectedJSValuePtr m_value; |
55 }; | 56 }; |
56 | 57 |
57 } // namespace WebCore | 58 } // namespace WebCore |
58 | 59 |
59 #endif // ScriptValue_h | 60 #endif // ScriptValue_h |
60 | 61 |
OLD | NEW |