Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: Source/core/page/EventSource.h

Issue 1232333002: Fix virtual/override/final usage in the rest of Source/core/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/page/CustomContextMenuProvider.h ('k') | Source/core/page/Page.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 class ResourceResponse; 49 class ResourceResponse;
50 class TextResourceDecoder; 50 class TextResourceDecoder;
51 class ThreadableLoader; 51 class ThreadableLoader;
52 52
53 class EventSource final : public RefCountedGarbageCollectedEventTargetWithInline Data<EventSource>, private ThreadableLoaderClient, public ActiveDOMObject { 53 class EventSource final : public RefCountedGarbageCollectedEventTargetWithInline Data<EventSource>, private ThreadableLoaderClient, public ActiveDOMObject {
54 DEFINE_WRAPPERTYPEINFO(); 54 DEFINE_WRAPPERTYPEINFO();
55 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(EventSource); 55 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(EventSource);
56 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(EventSource); 56 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(EventSource);
57 public: 57 public:
58 static EventSource* create(ExecutionContext*, const String& url, const Event SourceInit&, ExceptionState&); 58 static EventSource* create(ExecutionContext*, const String& url, const Event SourceInit&, ExceptionState&);
59 virtual ~EventSource(); 59 ~EventSource() override;
60 60
61 static const unsigned long long defaultReconnectDelay; 61 static const unsigned long long defaultReconnectDelay;
62 62
63 String url() const; 63 String url() const;
64 bool withCredentials() const; 64 bool withCredentials() const;
65 65
66 typedef short State; 66 typedef short State;
67 static const State CONNECTING = 0; 67 static const State CONNECTING = 0;
68 static const State OPEN = 1; 68 static const State OPEN = 1;
69 static const State CLOSED = 2; 69 static const State CLOSED = 2;
70 70
71 State readyState() const; 71 State readyState() const;
72 72
73 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(open);
74 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(message);
75 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); 75 DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
76 76
77 void close(); 77 void close();
78 78
79 virtual const AtomicString& interfaceName() const override; 79 const AtomicString& interfaceName() const override;
80 virtual ExecutionContext* executionContext() const override; 80 ExecutionContext* executionContext() const override;
81 81
82 // ActiveDOMObject 82 // ActiveDOMObject
83 // 83 //
84 // Note: suspend() is noop since ScopedPageLoadDeferrer calls 84 // Note: suspend() is noop since ScopedPageLoadDeferrer calls
85 // Page::setDefersLoading() and it defers delivery of events from the 85 // Page::setDefersLoading() and it defers delivery of events from the
86 // loader, and therefore the methods of this class for receiving 86 // loader, and therefore the methods of this class for receiving
87 // asynchronous events from the loader won't be invoked. 87 // asynchronous events from the loader won't be invoked.
88 virtual void stop() override; 88 void stop() override;
89 89
90 virtual bool hasPendingActivity() const override; 90 bool hasPendingActivity() const override;
91 91
92 DECLARE_VIRTUAL_TRACE(); 92 DECLARE_VIRTUAL_TRACE();
93 93
94 private: 94 private:
95 EventSource(ExecutionContext*, const KURL&, const EventSourceInit&); 95 EventSource(ExecutionContext*, const KURL&, const EventSourceInit&);
96 96
97 virtual void didReceiveResponse(unsigned long, const ResourceResponse&, Pass OwnPtr<WebDataConsumerHandle>) override; 97 void didReceiveResponse(unsigned long, const ResourceResponse&, PassOwnPtr<W ebDataConsumerHandle>) override;
98 virtual void didReceiveData(const char*, unsigned) override; 98 void didReceiveData(const char*, unsigned) override;
99 virtual void didFinishLoading(unsigned long, double) override; 99 void didFinishLoading(unsigned long, double) override;
100 virtual void didFail(const ResourceError&) override; 100 void didFail(const ResourceError&) override;
101 virtual void didFailAccessControlCheck(const ResourceError&) override; 101 void didFailAccessControlCheck(const ResourceError&) override;
102 virtual void didFailRedirectCheck() override; 102 void didFailRedirectCheck() override;
103 103
104 void scheduleInitialConnect(); 104 void scheduleInitialConnect();
105 void connect(); 105 void connect();
106 void networkRequestEnded(); 106 void networkRequestEnded();
107 void scheduleReconnect(); 107 void scheduleReconnect();
108 void connectTimerFired(Timer<EventSource>*); 108 void connectTimerFired(Timer<EventSource>*);
109 void abortConnectionAttempt(); 109 void abortConnectionAttempt();
110 void parseEventStream(); 110 void parseEventStream();
111 void parseEventStreamLine(unsigned pos, int fieldLength, int lineLength); 111 void parseEventStreamLine(unsigned pos, int fieldLength, int lineLength);
112 PassRefPtrWillBeRawPtr<MessageEvent> createMessageEvent(); 112 PassRefPtrWillBeRawPtr<MessageEvent> createMessageEvent();
(...skipping 13 matching lines...) Expand all
126 Vector<UChar> m_data; 126 Vector<UChar> m_data;
127 AtomicString m_currentlyParsedEventId; 127 AtomicString m_currentlyParsedEventId;
128 AtomicString m_lastEventId; 128 AtomicString m_lastEventId;
129 unsigned long long m_reconnectDelay; 129 unsigned long long m_reconnectDelay;
130 String m_eventStreamOrigin; 130 String m_eventStreamOrigin;
131 }; 131 };
132 132
133 } // namespace blink 133 } // namespace blink
134 134
135 #endif // EventSource_h 135 #endif // EventSource_h
OLDNEW
« no previous file with comments | « Source/core/page/CustomContextMenuProvider.h ('k') | Source/core/page/Page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698