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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 { | 162 { |
163 return !m_value.get() || m_value->isEmpty(); | 163 return !m_value.get() || m_value->isEmpty(); |
164 } | 164 } |
165 | 165 |
166 void clear() | 166 void clear() |
167 { | 167 { |
168 m_value = nullptr; | 168 m_value = nullptr; |
169 } | 169 } |
170 | 170 |
171 v8::Local<v8::Value> v8Value() const; | 171 v8::Local<v8::Value> v8Value() const; |
172 // TODO(bashi): Remove v8ValueUnsafe(). | |
173 v8::Local<v8::Value> v8ValueUnsafe() const; | |
174 // Returns v8Value() if a given ScriptState is the same as the | 172 // Returns v8Value() if a given ScriptState is the same as the |
175 // ScriptState which is associated with this ScriptValue. Otherwise | 173 // ScriptState which is associated with this ScriptValue. Otherwise |
176 // this "clones" the v8 value and returns it. | 174 // this "clones" the v8 value and returns it. |
177 v8::Local<v8::Value> v8ValueFor(ScriptState*) const; | 175 v8::Local<v8::Value> v8ValueFor(ScriptState*) const; |
178 | 176 |
179 bool toString(String&) const; | 177 bool toString(String&) const; |
180 | 178 |
181 void setReference(const v8::Persistent<v8::Object>& parent, v8::Isolate* iso
late) | 179 void setReference(const v8::Persistent<v8::Object>& parent, v8::Isolate* iso
late) |
182 { | 180 { |
183 m_value->setReference(parent, isolate); | 181 m_value->setReference(parent, isolate); |
184 } | 182 } |
185 | 183 |
186 static ScriptValue createNull(ScriptState*); | 184 static ScriptValue createNull(ScriptState*); |
187 | 185 |
188 private: | 186 private: |
189 RefPtr<ScriptState> m_scriptState; | 187 RefPtr<ScriptState> m_scriptState; |
190 RefPtr<SharedPersistent<v8::Value>> m_value; | 188 RefPtr<SharedPersistent<v8::Value>> m_value; |
191 }; | 189 }; |
192 | 190 |
193 } // namespace blink | 191 } // namespace blink |
194 | 192 |
195 #endif // ScriptValue_h | 193 #endif // ScriptValue_h |
OLD | NEW |