| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2009, 2012 Ericsson AB. All rights reserved. |
| 3 * Copyright (C) 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #ifndef EventSource_h | 32 #ifndef EventSource_h |
| 33 #define EventSource_h | 33 #define EventSource_h |
| 34 | 34 |
| 35 #include "bindings/core/v8/V8GCRoot.h" |
| 35 #include "core/dom/ContextLifecycleObserver.h" | 36 #include "core/dom/ContextLifecycleObserver.h" |
| 36 #include "core/events/EventTarget.h" | 37 #include "core/events/EventTarget.h" |
| 37 #include "core/loader/ThreadableLoader.h" | 38 #include "core/loader/ThreadableLoader.h" |
| 38 #include "core/loader/ThreadableLoaderClient.h" | 39 #include "core/loader/ThreadableLoaderClient.h" |
| 39 #include "core/page/EventSourceParser.h" | 40 #include "core/page/EventSourceParser.h" |
| 40 #include "platform/Timer.h" | 41 #include "platform/Timer.h" |
| 41 #include "platform/heap/Handle.h" | 42 #include "platform/heap/Handle.h" |
| 42 #include "platform/weborigin/KURL.h" | 43 #include "platform/weborigin/KURL.h" |
| 43 #include "wtf/Forward.h" | 44 #include "wtf/Forward.h" |
| 44 #include "wtf/OwnPtr.h" | 45 #include "wtf/OwnPtr.h" |
| 45 | 46 |
| 46 namespace blink { | 47 namespace blink { |
| 47 | 48 |
| 48 class EventSourceInit; | 49 class EventSourceInit; |
| 49 class ExceptionState; | 50 class ExceptionState; |
| 50 class ResourceResponse; | 51 class ResourceResponse; |
| 51 | 52 |
| 52 class CORE_EXPORT EventSource final : public RefCountedGarbageCollectedEventTarg
etWithInlineData<EventSource>, private ThreadableLoaderClient, public ContextLif
ecycleObserver, public EventSourceParser::Client { | 53 class CORE_EXPORT EventSource final : public RefCountedGarbageCollectedEventTarg
etWithInlineData<EventSource>, private ThreadableLoaderClient, public ContextLif
ecycleObserver, public EventSourceParser::Client, public V8GCRoot { |
| 53 DEFINE_WRAPPERTYPEINFO(); | 54 DEFINE_WRAPPERTYPEINFO(); |
| 54 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(EventSource); | 55 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(EventSource); |
| 55 USING_GARBAGE_COLLECTED_MIXIN(EventSource); | 56 USING_GARBAGE_COLLECTED_MIXIN(EventSource); |
| 56 public: | 57 public: |
| 57 static EventSource* create(ExecutionContext*, const String& url, const Event
SourceInit&, ExceptionState&); | 58 static EventSource* create(ExecutionContext*, const String& url, const Event
SourceInit&, ExceptionState&); |
| 58 ~EventSource() override; | 59 ~EventSource() override; |
| 59 | 60 |
| 60 static const unsigned long long defaultReconnectDelay; | 61 static const unsigned long long defaultReconnectDelay; |
| 61 | 62 |
| 62 String url() const; | 63 String url() const; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 OwnPtr<ThreadableLoader> m_loader; | 118 OwnPtr<ThreadableLoader> m_loader; |
| 118 Timer<EventSource> m_connectTimer; | 119 Timer<EventSource> m_connectTimer; |
| 119 | 120 |
| 120 unsigned long long m_reconnectDelay; | 121 unsigned long long m_reconnectDelay; |
| 121 String m_eventStreamOrigin; | 122 String m_eventStreamOrigin; |
| 122 }; | 123 }; |
| 123 | 124 |
| 124 } // namespace blink | 125 } // namespace blink |
| 125 | 126 |
| 126 #endif // EventSource_h | 127 #endif // EventSource_h |
| OLD | NEW |