OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 { | 251 { |
252 ASSERT(!hasNoValue()); | 252 ASSERT(!hasNoValue()); |
253 ScriptFunctionCall wrapFunction(injectedScriptObject(), "wrapObject"); | 253 ScriptFunctionCall wrapFunction(injectedScriptObject(), "wrapObject"); |
254 wrapFunction.appendArgument(value); | 254 wrapFunction.appendArgument(value); |
255 wrapFunction.appendArgument(groupName); | 255 wrapFunction.appendArgument(groupName); |
256 wrapFunction.appendArgument(canAccessInspectedWindow()); | 256 wrapFunction.appendArgument(canAccessInspectedWindow()); |
257 wrapFunction.appendArgument(generatePreview); | 257 wrapFunction.appendArgument(generatePreview); |
258 bool hadException = false; | 258 bool hadException = false; |
259 ScriptValue r = callFunctionWithEvalEnabled(wrapFunction, hadException); | 259 ScriptValue r = callFunctionWithEvalEnabled(wrapFunction, hadException); |
260 if (hadException) | 260 if (hadException) |
261 return 0; | 261 return nullptr; |
262 RefPtr<JSONObject> rawResult = r.toJSONValue(scriptState())->asObject(); | 262 RefPtr<JSONObject> rawResult = r.toJSONValue(scriptState())->asObject(); |
263 return TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult); | 263 return TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult); |
264 } | 264 } |
265 | 265 |
266 PassRefPtr<TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapTable(const S
criptValue& table, const ScriptValue& columns) const | 266 PassRefPtr<TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapTable(const S
criptValue& table, const ScriptValue& columns) const |
267 { | 267 { |
268 ASSERT(!hasNoValue()); | 268 ASSERT(!hasNoValue()); |
269 ScriptFunctionCall wrapFunction(injectedScriptObject(), "wrapTable"); | 269 ScriptFunctionCall wrapFunction(injectedScriptObject(), "wrapTable"); |
270 wrapFunction.appendArgument(canAccessInspectedWindow()); | 270 wrapFunction.appendArgument(canAccessInspectedWindow()); |
271 wrapFunction.appendArgument(table); | 271 wrapFunction.appendArgument(table); |
272 if (columns.hasNoValue()) | 272 if (columns.hasNoValue()) |
273 wrapFunction.appendArgument(false); | 273 wrapFunction.appendArgument(false); |
274 else | 274 else |
275 wrapFunction.appendArgument(columns); | 275 wrapFunction.appendArgument(columns); |
276 bool hadException = false; | 276 bool hadException = false; |
277 ScriptValue r = callFunctionWithEvalEnabled(wrapFunction, hadException); | 277 ScriptValue r = callFunctionWithEvalEnabled(wrapFunction, hadException); |
278 if (hadException) | 278 if (hadException) |
279 return 0; | 279 return nullptr; |
280 RefPtr<JSONObject> rawResult = r.toJSONValue(scriptState())->asObject(); | 280 RefPtr<JSONObject> rawResult = r.toJSONValue(scriptState())->asObject(); |
281 return TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult); | 281 return TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult); |
282 } | 282 } |
283 | 283 |
284 PassRefPtr<TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapNode(Node* no
de, const String& groupName) | 284 PassRefPtr<TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapNode(Node* no
de, const String& groupName) |
285 { | 285 { |
286 return wrapObject(nodeAsScriptValue(node), groupName); | 286 return wrapObject(nodeAsScriptValue(node), groupName); |
287 } | 287 } |
288 | 288 |
289 ScriptValue InjectedScript::findObjectById(const String& objectId) const | 289 ScriptValue InjectedScript::findObjectById(const String& objectId) const |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 ASSERT(!hadException); | 332 ASSERT(!hadException); |
333 } | 333 } |
334 | 334 |
335 ScriptValue InjectedScript::nodeAsScriptValue(Node* node) | 335 ScriptValue InjectedScript::nodeAsScriptValue(Node* node) |
336 { | 336 { |
337 return InjectedScriptHost::nodeAsScriptValue(scriptState(), node); | 337 return InjectedScriptHost::nodeAsScriptValue(scriptState(), node); |
338 } | 338 } |
339 | 339 |
340 } // namespace WebCore | 340 } // namespace WebCore |
341 | 341 |
OLD | NEW |