| 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 29 matching lines...) Expand all Loading... |
| 40 #include "wtf/RefCounted.h" | 40 #include "wtf/RefCounted.h" |
| 41 #include "wtf/RefPtr.h" | 41 #include "wtf/RefPtr.h" |
| 42 #include "wtf/text/AtomicStringHash.h" | 42 #include "wtf/text/AtomicStringHash.h" |
| 43 | 43 |
| 44 namespace WebCore { | 44 namespace WebCore { |
| 45 | 45 |
| 46 class ExceptionState; | 46 class ExceptionState; |
| 47 class KURL; | 47 class KURL; |
| 48 class ScriptExecutionContext; | 48 class ScriptExecutionContext; |
| 49 | 49 |
| 50 class AbstractWorker : public RefCounted<AbstractWorker>, public EventTarget, pu
blic ActiveDOMObject { | 50 class AbstractWorker : public RefCounted<AbstractWorker>, public EventTargetWith
InlineData, public ActiveDOMObject { |
| 51 public: | 51 public: |
| 52 // EventTarget APIs | 52 // EventTarget APIs |
| 53 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE { re
turn ActiveDOMObject::scriptExecutionContext(); } | 53 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE { re
turn ActiveDOMObject::scriptExecutionContext(); } |
| 54 | 54 |
| 55 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 55 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 56 | 56 |
| 57 using RefCounted<AbstractWorker>::ref; | 57 using RefCounted<AbstractWorker>::ref; |
| 58 using RefCounted<AbstractWorker>::deref; | 58 using RefCounted<AbstractWorker>::deref; |
| 59 | 59 |
| 60 virtual void contextDestroyed() OVERRIDE; | 60 virtual void contextDestroyed() OVERRIDE; |
| 61 AbstractWorker(ScriptExecutionContext*); | 61 AbstractWorker(ScriptExecutionContext*); |
| 62 virtual ~AbstractWorker(); | 62 virtual ~AbstractWorker(); |
| 63 | 63 |
| 64 protected: | 64 protected: |
| 65 // Helper function that converts a URL to an absolute URL and checks the res
ult for validity. | 65 // Helper function that converts a URL to an absolute URL and checks the res
ult for validity. |
| 66 KURL resolveURL(const String& url, ExceptionState&); | 66 KURL resolveURL(const String& url, ExceptionState&); |
| 67 intptr_t asID() const { return reinterpret_cast<intptr_t>(this); } | 67 intptr_t asID() const { return reinterpret_cast<intptr_t>(this); } |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 virtual void refEventTarget() OVERRIDE { ref(); } | 70 virtual void refEventTarget() OVERRIDE { ref(); } |
| 71 virtual void derefEventTarget() OVERRIDE { deref(); } | 71 virtual void derefEventTarget() OVERRIDE { deref(); } |
| 72 virtual EventTargetData* eventTargetData() OVERRIDE; | |
| 73 virtual EventTargetData* ensureEventTargetData() OVERRIDE; | |
| 74 | |
| 75 EventTargetData m_eventTargetData; | |
| 76 }; | 72 }; |
| 77 | 73 |
| 78 } // namespace WebCore | 74 } // namespace WebCore |
| 79 | 75 |
| 80 #endif // AbstractWorker_h | 76 #endif // AbstractWorker_h |
| OLD | NEW |