Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 14 matching lines...) Expand all Loading... | |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef AbstractWorker_h | 31 #ifndef AbstractWorker_h |
| 32 #define AbstractWorker_h | 32 #define AbstractWorker_h |
| 33 | 33 |
| 34 #include "bindings/v8/ScriptWrappable.h" | 34 #include "bindings/v8/ScriptWrappable.h" |
| 35 #include "core/dom/ActiveDOMObject.h" | |
| 36 #include "core/dom/EventListener.h" | 35 #include "core/dom/EventListener.h" |
| 37 #include "core/dom/EventNames.h" | 36 #include "core/dom/EventNames.h" |
| 38 #include "core/dom/EventTarget.h" | 37 #include "core/dom/EventTarget.h" |
| 39 #include <wtf/PassRefPtr.h> | 38 #include <wtf/PassRefPtr.h> |
| 40 #include <wtf/RefCounted.h> | 39 #include <wtf/RefCounted.h> |
| 41 #include <wtf/RefPtr.h> | 40 #include <wtf/RefPtr.h> |
| 42 #include <wtf/text/AtomicStringHash.h> | 41 #include <wtf/text/AtomicStringHash.h> |
| 43 | 42 |
| 44 namespace WebCore { | 43 namespace WebCore { |
| 45 | 44 |
| 46 class KURL; | 45 class KURL; |
| 47 class ScriptExecutionContext; | 46 class ScriptExecutionContext; |
| 48 | 47 |
| 49 class AbstractWorker : public RefCounted<AbstractWorker>, public ScriptWrapp able, public ActiveDOMObject, public EventTarget { | 48 class AbstractWorker : public RefCounted<AbstractWorker>, public EventTarget { |
|
haraken
2013/06/19 10:24:00
Why did you move ScriptWrappable and ActiveDOMObje
do-not-use
2013/06/19 10:39:09
It did not link if AbstractWorker would subclass S
do-not-use
2013/06/19 10:52:08
I'll try to move back ActiveDOMObject to AbstractW
| |
| 50 public: | 49 public: |
| 51 // EventTarget APIs | 50 // EventTarget APIs |
| 52 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE { return ActiveDOMObject::scriptExecutionContext(); } | |
| 53 | 51 |
| 54 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 52 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 55 | 53 |
| 56 using RefCounted<AbstractWorker>::ref; | 54 using RefCounted<AbstractWorker>::ref; |
| 57 using RefCounted<AbstractWorker>::deref; | 55 using RefCounted<AbstractWorker>::deref; |
| 58 | 56 |
| 59 virtual void contextDestroyed() OVERRIDE; | 57 AbstractWorker(); |
| 60 AbstractWorker(ScriptExecutionContext*); | |
| 61 virtual ~AbstractWorker(); | 58 virtual ~AbstractWorker(); |
| 62 | 59 |
| 63 protected: | 60 protected: |
| 64 // Helper function that converts a URL to an absolute URL and checks the result for validity. | 61 // Helper function that converts a URL to an absolute URL and checks the result for validity. |
| 65 KURL resolveURL(const String& url, ExceptionCode& ec); | 62 KURL resolveURL(const String& url, ExceptionCode& ec); |
| 66 intptr_t asID() const { return reinterpret_cast<intptr_t>(this); } | 63 intptr_t asID() const { return reinterpret_cast<intptr_t>(this); } |
| 67 | 64 |
| 68 private: | 65 private: |
| 69 virtual void refEventTarget() OVERRIDE { ref(); } | 66 virtual void refEventTarget() OVERRIDE { ref(); } |
| 70 virtual void derefEventTarget() OVERRIDE { deref(); } | 67 virtual void derefEventTarget() OVERRIDE { deref(); } |
| 71 virtual EventTargetData* eventTargetData() OVERRIDE; | 68 virtual EventTargetData* eventTargetData() OVERRIDE; |
| 72 virtual EventTargetData* ensureEventTargetData() OVERRIDE; | 69 virtual EventTargetData* ensureEventTargetData() OVERRIDE; |
| 73 | 70 |
| 74 EventTargetData m_eventTargetData; | 71 EventTargetData m_eventTargetData; |
| 75 }; | 72 }; |
| 76 | 73 |
| 77 } // namespace WebCore | 74 } // namespace WebCore |
| 78 | 75 |
| 79 #endif // AbstractWorker_h | 76 #endif // AbstractWorker_h |
| OLD | NEW |