| 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 // TODO(bashi): Remove v8ValueUnsafe(). |
| 173 v8::Local<v8::Value> v8ValueUnsafe() const; | 174 v8::Local<v8::Value> v8ValueUnsafe() const; |
| 175 // Returns v8Value() if a given ScriptState is the same as the |
| 176 // ScriptState which is associated with this ScriptValue. Otherwise |
| 177 // this "clones" the v8 value and returns it. |
| 178 v8::Local<v8::Value> v8ValueFor(ScriptState*); |
| 174 | 179 |
| 175 bool toString(String&) const; | 180 bool toString(String&) const; |
| 176 | 181 |
| 177 static ScriptValue createNull(ScriptState*); | 182 static ScriptValue createNull(ScriptState*); |
| 178 | 183 |
| 179 private: | 184 private: |
| 180 RefPtr<ScriptState> m_scriptState; | 185 RefPtr<ScriptState> m_scriptState; |
| 181 RefPtr<SharedPersistent<v8::Value>> m_value; | 186 RefPtr<SharedPersistent<v8::Value>> m_value; |
| 182 }; | 187 }; |
| 183 | 188 |
| 184 } // namespace blink | 189 } // namespace blink |
| 185 | 190 |
| 186 #endif // ScriptValue_h | 191 #endif // ScriptValue_h |
| OLD | NEW |