OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 } | 316 } |
317 | 317 |
318 static NPObject* makeIntArrayImpl(const WebVector<int>& data, v8::Isolate* isola
te) | 318 static NPObject* makeIntArrayImpl(const WebVector<int>& data, v8::Isolate* isola
te) |
319 { | 319 { |
320 v8::HandleScope handleScope(isolate); | 320 v8::HandleScope handleScope(isolate); |
321 v8::Handle<v8::Array> result = v8::Array::New(isolate, data.size()); | 321 v8::Handle<v8::Array> result = v8::Array::New(isolate, data.size()); |
322 for (size_t i = 0; i < data.size(); ++i) | 322 for (size_t i = 0; i < data.size(); ++i) |
323 result->Set(i, v8::Number::New(isolate, data[i])); | 323 result->Set(i, v8::Number::New(isolate, data[i])); |
324 | 324 |
325 LocalDOMWindow* window = currentDOMWindow(isolate); | 325 LocalDOMWindow* window = currentDOMWindow(isolate); |
326 return npCreateV8ScriptObject(0, result, window, isolate); | 326 return npCreateV8ScriptObject(isolate, 0, result, window); |
327 } | 327 } |
328 | 328 |
329 static NPObject* makeStringArrayImpl(const WebVector<WebString>& data, v8::Isola
te* isolate) | 329 static NPObject* makeStringArrayImpl(const WebVector<WebString>& data, v8::Isola
te* isolate) |
330 { | 330 { |
331 v8::HandleScope handleScope(isolate); | 331 v8::HandleScope handleScope(isolate); |
332 v8::Handle<v8::Array> result = v8::Array::New(isolate, data.size()); | 332 v8::Handle<v8::Array> result = v8::Array::New(isolate, data.size()); |
333 for (size_t i = 0; i < data.size(); ++i) | 333 for (size_t i = 0; i < data.size(); ++i) |
334 result->Set(i, v8String(isolate, data[i])); | 334 result->Set(i, v8String(isolate, data[i])); |
335 | 335 |
336 LocalDOMWindow* window = currentDOMWindow(isolate); | 336 LocalDOMWindow* window = currentDOMWindow(isolate); |
337 return npCreateV8ScriptObject(0, result, window, isolate); | 337 return npCreateV8ScriptObject(isolate, 0, result, window); |
338 } | 338 } |
339 | 339 |
340 bool WebBindings::getRange(NPObject* range, WebRange* webRange) | 340 bool WebBindings::getRange(NPObject* range, WebRange* webRange) |
341 { | 341 { |
342 return getRangeImpl(range, webRange, v8::Isolate::GetCurrent()); | 342 return getRangeImpl(range, webRange, v8::Isolate::GetCurrent()); |
343 } | 343 } |
344 | 344 |
345 bool WebBindings::getArrayBuffer(NPObject* arrayBuffer, WebArrayBuffer* webArray
Buffer) | 345 bool WebBindings::getArrayBuffer(NPObject* arrayBuffer, WebArrayBuffer* webArray
Buffer) |
346 { | 346 { |
347 return getArrayBufferImpl(arrayBuffer, webArrayBuffer, v8::Isolate::GetCurre
nt()); | 347 return getArrayBufferImpl(arrayBuffer, webArrayBuffer, v8::Isolate::GetCurre
nt()); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 if (!v8Object) | 396 if (!v8Object) |
397 return v8::Undefined(isolate); | 397 return v8::Undefined(isolate); |
398 return convertNPVariantToV8Object(variant, v8Object->rootObject->frame()
->script().windowScriptNPObject(), isolate); | 398 return convertNPVariantToV8Object(variant, v8Object->rootObject->frame()
->script().windowScriptNPObject(), isolate); |
399 } | 399 } |
400 // Safe to pass 0 since we have checked the script object class to make sure
the | 400 // Safe to pass 0 since we have checked the script object class to make sure
the |
401 // argument is a primitive v8 type. | 401 // argument is a primitive v8 type. |
402 return convertNPVariantToV8Object(variant, 0, isolate); | 402 return convertNPVariantToV8Object(variant, 0, isolate); |
403 } | 403 } |
404 | 404 |
405 } // namespace blink | 405 } // namespace blink |
OLD | NEW |