| 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 18 matching lines...) Expand all Loading... |
| 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" | 35 #include "core/dom/ActiveDOMObject.h" |
| 36 #include "core/events/EventListener.h" | 36 #include "core/events/EventListener.h" |
| 37 #include "core/events/EventTarget.h" | 37 #include "core/events/EventTarget.h" |
| 38 #include "core/events/ThreadLocalEventNames.h" | 38 #include "core/events/ThreadLocalEventNames.h" |
| 39 #include "heap/Handle.h" |
| 39 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
| 40 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
| 41 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
| 42 #include "wtf/text/AtomicStringHash.h" | 43 #include "wtf/text/AtomicStringHash.h" |
| 43 | 44 |
| 44 namespace WebCore { | 45 namespace WebCore { |
| 45 | 46 |
| 46 class ExceptionState; | 47 class ExceptionState; |
| 47 class KURL; | 48 class KURL; |
| 48 class ExecutionContext; | 49 class ExecutionContext; |
| 49 | 50 |
| 50 class AbstractWorker : public RefCounted<AbstractWorker>, public EventTargetWith
InlineData, public ActiveDOMObject { | 51 class AbstractWorker : public RefCountedWillBeRefCountedGarbageCollected<Abstrac
tWorker>, public EventTargetWithInlineData, public ActiveDOMObject { |
| 51 REFCOUNTED_EVENT_TARGET(AbstractWorker); | 52 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<A
bstractWorker>); |
| 52 public: | 53 public: |
| 53 // EventTarget APIs | 54 // EventTarget APIs |
| 54 virtual ExecutionContext* executionContext() const OVERRIDE FINAL { return A
ctiveDOMObject::executionContext(); } | 55 virtual ExecutionContext* executionContext() const OVERRIDE FINAL { return A
ctiveDOMObject::executionContext(); } |
| 55 | 56 |
| 56 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(error); | 57 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(error); |
| 57 | 58 |
| 58 AbstractWorker(ExecutionContext*); | 59 AbstractWorker(ExecutionContext*); |
| 59 virtual ~AbstractWorker(); | 60 virtual ~AbstractWorker(); |
| 60 | 61 |
| 62 virtual void trace(Visitor*) { } |
| 63 |
| 61 protected: | 64 protected: |
| 62 // 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. |
| 63 KURL resolveURL(const String& url, ExceptionState&); | 66 KURL resolveURL(const String& url, ExceptionState&); |
| 64 intptr_t asID() const { return reinterpret_cast<intptr_t>(this); } | 67 intptr_t asID() const { return reinterpret_cast<intptr_t>(this); } |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 } // namespace WebCore | 70 } // namespace WebCore |
| 68 | 71 |
| 69 #endif // AbstractWorker_h | 72 #endif // AbstractWorker_h |
| OLD | NEW |