2009-06-12 Dmitry Titov <dimich@chromium.org>
authordimich@chromium.org <dimich@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jun 2009 23:20:28 +0000 (23:20 +0000)
committerdimich@chromium.org <dimich@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jun 2009 23:20:28 +0000 (23:20 +0000)
        Reviewed by David Levin.

        https://bugs.webkit.org/show_bug.cgi?id=26359
        [v8] Add XMLHttpRequest to WorkerContextExecutionProxy.

        * bindings/v8/WorkerContextExecutionProxy.cpp:
        (WebCore::WorkerContextExecutionProxy::ToV8Object): Add type == V8ClassIndex::XMLHTTPREQUEST to the convertable types.
        (WebCore::WorkerContextExecutionProxy::EventTargetToV8Object): same.
        * bindings/v8/WorkerContextExecutionProxy.h: fix typo in the comment.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@44635 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
WebCore/bindings/v8/WorkerContextExecutionProxy.h

index 3772565..a884c43 100644 (file)
@@ -1,3 +1,15 @@
+2009-06-12  Dmitry Titov  <dimich@chromium.org>
+
+        Reviewed by David Levin.
+
+        https://bugs.webkit.org/show_bug.cgi?id=26359
+        [v8] Add XMLHttpRequest to WorkerContextExecutionProxy.
+
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        (WebCore::WorkerContextExecutionProxy::ToV8Object): Add type == V8ClassIndex::XMLHTTPREQUEST to the convertable types.
+        (WebCore::WorkerContextExecutionProxy::EventTargetToV8Object): same.
+        * bindings/v8/WorkerContextExecutionProxy.h: fix typo in the comment.
+
 2009-06-12  Peter Kasting  <pkasting@google.com>
 
         Reviewed by Eric Seidel.
index 7af9536..2cf043d 100644 (file)
@@ -217,7 +217,7 @@ v8::Handle<v8::Value> WorkerContextExecutionProxy::ToV8Object(V8ClassIndex::V8Wr
     if (type == V8ClassIndex::WORKERCONTEXT)
         return WorkerContextToV8Object(static_cast<WorkerContext*>(impl));
 
-    if (type == V8ClassIndex::WORKER) {
+    if (type == V8ClassIndex::WORKER || type == V8ClassIndex::XMLHTTPREQUEST) {
         v8::Persistent<v8::Object> result = getActiveDOMObjectMap().get(impl);
         if (!result.IsEmpty())
             return result;
@@ -293,6 +293,10 @@ v8::Handle<v8::Value> WorkerContextExecutionProxy::EventTargetToV8Object(EventTa
     if (worker)
         return ToV8Object(V8ClassIndex::WORKER, worker);
 
+    XMLHttpRequest* xhr = target->toXMLHttpRequest();
+    if (xhr)
+        return ToV8Object(V8ClassIndex::XMLHTTPREQUEST, xhr);
+
     ASSERT_NOT_REACHED();
     return v8::Handle<v8::Value>();
 }
index dad191c..21af0ef 100644 (file)
@@ -53,7 +53,7 @@ namespace WebCore {
         WorkerContextExecutionProxy(WorkerContext*);
         ~WorkerContextExecutionProxy();
 
-        // FIXME: following function sshould have camelCased names once V8 code-generating script is migrated.
+        // FIXME: following function should have camelCased names once V8 code-generating script is migrated.
         v8::Local<v8::Context> GetContext() { return v8::Local<v8::Context>::New(m_context); }
         v8::Local<v8::Function> GetConstructor(V8ClassIndex::V8WrapperType);
         void RemoveEventListener(V8EventListener*);