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

Side by Side Diff: Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h

Issue 1229743005: Fix virtual/override/final usage in Source/core/{fetch,loader,streams,xmlhttprequest}/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org> 2 * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org>
3 * All right reserved. 3 * All right 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // In the comments for this class: 48 // In the comments for this class:
49 // - "progress" event means an event named "progress" 49 // - "progress" event means an event named "progress"
50 // - ProgressEvent means an event using the ProgressEvent interface defined in 50 // - ProgressEvent means an event using the ProgressEvent interface defined in
51 // the spec. 51 // the spec.
52 class XMLHttpRequestProgressEventThrottle final : public NoBaseWillBeGarbageColl ectedFinalized<XMLHttpRequestProgressEventThrottle>, public TimerBase { 52 class XMLHttpRequestProgressEventThrottle final : public NoBaseWillBeGarbageColl ectedFinalized<XMLHttpRequestProgressEventThrottle>, public TimerBase {
53 public: 53 public:
54 static PassOwnPtrWillBeRawPtr<XMLHttpRequestProgressEventThrottle> create(XM LHttpRequest* eventTarget) 54 static PassOwnPtrWillBeRawPtr<XMLHttpRequestProgressEventThrottle> create(XM LHttpRequest* eventTarget)
55 { 55 {
56 return adoptPtrWillBeNoop(new XMLHttpRequestProgressEventThrottle(eventT arget)); 56 return adoptPtrWillBeNoop(new XMLHttpRequestProgressEventThrottle(eventT arget));
57 } 57 }
58 virtual ~XMLHttpRequestProgressEventThrottle(); 58 ~XMLHttpRequestProgressEventThrottle() override;
59 59
60 enum DeferredEventAction { 60 enum DeferredEventAction {
61 Ignore, 61 Ignore,
62 Clear, 62 Clear,
63 Flush, 63 Flush,
64 }; 64 };
65 65
66 // Dispatches a ProgressEvent. 66 // Dispatches a ProgressEvent.
67 // 67 //
68 // Special treatment for events named "progress" is implemented to dispatch 68 // Special treatment for events named "progress" is implemented to dispatch
(...skipping 16 matching lines...) Expand all
85 85
86 private: 86 private:
87 explicit XMLHttpRequestProgressEventThrottle(XMLHttpRequest*); 87 explicit XMLHttpRequestProgressEventThrottle(XMLHttpRequest*);
88 88
89 // The main purpose of this class is to throttle the "progress" 89 // The main purpose of this class is to throttle the "progress"
90 // ProgressEvent dispatching. This class represents such a deferred 90 // ProgressEvent dispatching. This class represents such a deferred
91 // "progress" ProgressEvent. 91 // "progress" ProgressEvent.
92 class DeferredEvent; 92 class DeferredEvent;
93 static const double minimumProgressEventDispatchingIntervalInSeconds; 93 static const double minimumProgressEventDispatchingIntervalInSeconds;
94 94
95 virtual void fired() override; 95 void fired() override;
96 void dispatchDeferredEvent(); 96 void dispatchDeferredEvent();
97 97
98 // Non-Oilpan, keep a weak pointer to our XMLHttpRequest object as it is 98 // Non-Oilpan, keep a weak pointer to our XMLHttpRequest object as it is
99 // the one holding us. With Oilpan, a simple strong Member can be used - 99 // the one holding us. With Oilpan, a simple strong Member can be used -
100 // this XMLHttpRequestProgressEventThrottle (part) object dies together 100 // this XMLHttpRequestProgressEventThrottle (part) object dies together
101 // with the XMLHttpRequest object. 101 // with the XMLHttpRequest object.
102 RawPtrWillBeMember<XMLHttpRequest> m_target; 102 RawPtrWillBeMember<XMLHttpRequest> m_target;
103 103
104 // A slot for the deferred "progress" ProgressEvent. When multiple events 104 // A slot for the deferred "progress" ProgressEvent. When multiple events
105 // arrive, only the last one is stored and others are discarded. 105 // arrive, only the last one is stored and others are discarded.
106 const OwnPtr<DeferredEvent> m_deferred; 106 const OwnPtr<DeferredEvent> m_deferred;
107 }; 107 };
108 108
109 } // namespace blink 109 } // namespace blink
110 110
111 #endif // XMLHttpRequestProgressEventThrottle_h 111 #endif // XMLHttpRequestProgressEventThrottle_h
OLDNEW
« no previous file with comments | « Source/core/xmlhttprequest/XMLHttpRequestProgressEvent.h ('k') | Source/core/xmlhttprequest/XMLHttpRequestUpload.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698