diff options
Diffstat (limited to 'WebKit/chromium/src/WebBindings.cpp')
-rw-r--r-- | WebKit/chromium/src/WebBindings.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/WebKit/chromium/src/WebBindings.cpp b/WebKit/chromium/src/WebBindings.cpp index 4bb9022..c25c31b 100644 --- a/WebKit/chromium/src/WebBindings.cpp +++ b/WebKit/chromium/src/WebBindings.cpp @@ -312,6 +312,17 @@ static bool getElementImpl(NPObject* npObj, WebElement* webElement) return true; } +static NPObject* makeIntArrayImpl(const WebVector<int>& data) +{ + v8::HandleScope handleScope; + v8::Handle<v8::Array> result = v8::Array::New(data.size()); + for (size_t i = 0; i < data.size(); i++) + result->Set(i, v8::Number::New(data[i])); + + WebCore::DOMWindow* window = WebCore::V8Proxy::retrieveWindow(WebCore::V8Proxy::currentContext()); + return npCreateV8ScriptObject(0, result, window); +} + #endif bool WebBindings::getDragData(NPObject* event, int* eventId, WebDragData* data) @@ -350,6 +361,16 @@ bool WebBindings::getElement(NPObject* element, WebElement* webElement) #endif } +NPObject* WebBindings::makeIntArray(const WebVector<int> & data) +{ +#if USE(V8) + return makeIntArrayImpl(data); +#else + // Not supported on other ports (JSC, etc.). + return 0; +#endif +} + void WebBindings::pushExceptionHandler(ExceptionHandler handler, void* data) { WebCore::pushExceptionHandler(handler, data); |