OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 { | 163 { |
164 return !m_value.get() || m_value->isEmpty(); | 164 return !m_value.get() || m_value->isEmpty(); |
165 } | 165 } |
166 | 166 |
167 void clear() | 167 void clear() |
168 { | 168 { |
169 m_value = nullptr; | 169 m_value = nullptr; |
170 } | 170 } |
171 | 171 |
172 v8::Local<v8::Value> v8Value() const; | 172 v8::Local<v8::Value> v8Value() const; |
173 v8::Local<v8::Value> v8ValueUnsafe() const; | 173 v8::Local<v8::Value> v8ValueUnsafe() const; |
haraken
2015/05/20 00:43:42
Not related to this CL, this is used only in one p
bashi
2015/05/20 00:52:22
Acknowledged.
| |
174 // Returns v8Value() if a given ScriptState is the same as the | |
175 // ScriptState which is associated with this ScriptValue. Otherwise | |
176 // this "clones" the v8 value and returns it. | |
177 v8::Local<v8::Value> v8ValueFor(ScriptState*); | |
174 | 178 |
175 bool toString(String&) const; | 179 bool toString(String&) const; |
176 | 180 |
177 static ScriptValue createNull(ScriptState*); | 181 static ScriptValue createNull(ScriptState*); |
178 | 182 |
179 private: | 183 private: |
180 RefPtr<ScriptState> m_scriptState; | 184 RefPtr<ScriptState> m_scriptState; |
181 RefPtr<SharedPersistent<v8::Value>> m_value; | 185 RefPtr<SharedPersistent<v8::Value>> m_value; |
182 }; | 186 }; |
183 | 187 |
184 } // namespace blink | 188 } // namespace blink |
185 | 189 |
186 #endif // ScriptValue_h | 190 #endif // ScriptValue_h |
OLD | NEW |