2009-07-21 Jian Li <jianli@chromium.org>
authorjianli@chromium.org <jianli@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Jul 2009 22:44:41 +0000 (22:44 +0000)
committerjianli@chromium.org <jianli@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Jul 2009 22:44:41 +0000 (22:44 +0000)
        Reviewed by David Levin.

        Add onerror to WorkerContext.
        https://bugs.webkit.org/show_bug.cgi?id=27516

        * bindings/js/JSWorkerContextCustom.cpp:
        (WebCore::JSWorkerContext::mark):
        * workers/WorkerContext.h:
        (WebCore::WorkerContext::setOnerror):
        (WebCore::WorkerContext::onerror):
        * workers/WorkerContext.idl:

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

WebCore/ChangeLog
WebCore/bindings/js/JSWorkerContextCustom.cpp
WebCore/workers/WorkerContext.h
WebCore/workers/WorkerContext.idl

index 12691a7..6076735 100644 (file)
@@ -1,3 +1,17 @@
+2009-07-21  Jian Li  <jianli@chromium.org>
+
+        Reviewed by David Levin.
+
+        Add onerror to WorkerContext.
+        https://bugs.webkit.org/show_bug.cgi?id=27516
+
+        * bindings/js/JSWorkerContextCustom.cpp:
+        (WebCore::JSWorkerContext::mark):
+        * workers/WorkerContext.h:
+        (WebCore::WorkerContext::setOnerror):
+        (WebCore::WorkerContext::onerror):
+        * workers/WorkerContext.idl:
+
 2009-07-21  Yong Li  <yong.li@torchmobile.com>
 
         Reviewed by George Staikos.
index 06475f9..440bb7a 100644 (file)
@@ -58,6 +58,7 @@ void JSWorkerContext::mark()
     markDOMObjectWrapper(globalData, impl()->optionalLocation());
     markDOMObjectWrapper(globalData, impl()->optionalNavigator());
 
+    markIfNotNull(impl()->onerror());
     markIfNotNull(impl()->onmessage());
 
     typedef WorkerContext::EventListenersMap EventListenersMap;
index 16f43fd..2ee016e 100644 (file)
@@ -84,6 +84,8 @@ namespace WebCore {
         WorkerContext* self() { return this; }
         WorkerLocation* location() const;
         void close();
+        void setOnerror(PassRefPtr<EventListener> eventListener) { m_onErrorListener = eventListener; }
+        EventListener* onerror() const { return m_onErrorListener.get(); }
 
         // WorkerUtils
         void importScripts(const Vector<String>& urls, const String& callerURL, int callerLine, ExceptionCode&);
@@ -140,6 +142,7 @@ namespace WebCore {
         OwnPtr<WorkerScriptController> m_script;
         WorkerThread* m_thread;
 
+        RefPtr<EventListener> m_onErrorListener;
         RefPtr<EventListener> m_onmessageListener;
         EventListenersMap m_eventListeners;
 
index 709410a..ab4a766 100644 (file)
@@ -37,11 +37,11 @@ module threads {
 
         // WorkerGlobalScope
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
-                 attribute [Replaceable] WorkerContext self;
+        attribute [Replaceable] WorkerContext self;
 #endif
-                 attribute [Replaceable] WorkerLocation location;
+        attribute [Replaceable] WorkerLocation location;
         void close();
-        //         attribute EventListener onerror;
+        attribute EventListener onerror;
 
         // WorkerUtils
         [Custom] void importScripts(/*[Variadic] in DOMString urls */);