OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 Google Inc. All rights reserved. | 2 * Copyright (c) 2010 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 uint32_t m_arrayLimit; | 156 uint32_t m_arrayLimit; |
157 v8::Isolate* m_isolate; | 157 v8::Isolate* m_isolate; |
158 StringBuilder m_builder; | 158 StringBuilder m_builder; |
159 Vector<v8::Local<v8::Array> > m_visitedArrays; | 159 Vector<v8::Local<v8::Array> > m_visitedArrays; |
160 v8::TryCatch m_tryCatch; | 160 v8::TryCatch m_tryCatch; |
161 }; | 161 }; |
162 | 162 |
163 } // namespace | 163 } // namespace |
164 | 164 |
165 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ScriptArguments) | |
166 | |
167 PassRefPtrWillBeRawPtr<ScriptArguments> ScriptArguments::create(ScriptState* scr
iptState, Vector<ScriptValue>& arguments) | 165 PassRefPtrWillBeRawPtr<ScriptArguments> ScriptArguments::create(ScriptState* scr
iptState, Vector<ScriptValue>& arguments) |
168 { | 166 { |
169 return adoptRefWillBeNoop(new ScriptArguments(scriptState, arguments)); | 167 return adoptRefWillBeNoop(new ScriptArguments(scriptState, arguments)); |
170 } | 168 } |
171 | 169 |
172 ScriptArguments::ScriptArguments(ScriptState* scriptState, Vector<ScriptValue>&
arguments) | 170 ScriptArguments::ScriptArguments(ScriptState* scriptState, Vector<ScriptValue>&
arguments) |
173 : m_scriptState(scriptState) | 171 : m_scriptState(scriptState) |
174 { | 172 { |
175 m_arguments.swap(arguments); | 173 m_arguments.swap(arguments); |
176 } | 174 } |
177 | 175 |
| 176 ScriptArguments::~ScriptArguments() |
| 177 { |
| 178 } |
| 179 |
178 const ScriptValue &ScriptArguments::argumentAt(size_t index) const | 180 const ScriptValue &ScriptArguments::argumentAt(size_t index) const |
179 { | 181 { |
180 ASSERT(m_arguments.size() > index); | 182 ASSERT(m_arguments.size() > index); |
181 return m_arguments[index]; | 183 return m_arguments[index]; |
182 } | 184 } |
183 | 185 |
184 bool ScriptArguments::getFirstArgumentAsString(String& result) const | 186 bool ScriptArguments::getFirstArgumentAsString(String& result) const |
185 { | 187 { |
186 if (!argumentCount()) | 188 if (!argumentCount()) |
187 return false; | 189 return false; |
188 | 190 |
189 const ScriptValue& value = argumentAt(0); | 191 const ScriptValue& value = argumentAt(0); |
190 ScriptState::Scope scope(m_scriptState.get()); | 192 ScriptState::Scope scope(m_scriptState.get()); |
191 result = V8ValueStringBuilder::toString(value.v8Value(), value.isolate()); | 193 result = V8ValueStringBuilder::toString(value.v8Value(), value.isolate()); |
192 return true; | 194 return true; |
193 } | 195 } |
194 | 196 |
195 } // namespace blink | 197 } // namespace blink |
OLD | NEW |