OLD | NEW |
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // m_lengthComputable, m_loaded and m_total. They'll be used on next | 70 // m_lengthComputable, m_loaded and m_total. They'll be used on next |
71 // fired() call. | 71 // fired() call. |
72 void dispatchProgressEvent(const AtomicString&, bool lengthComputable, unsig
ned long long loaded, unsigned long long total); | 72 void dispatchProgressEvent(const AtomicString&, bool lengthComputable, unsig
ned long long loaded, unsigned long long total); |
73 // Dispatches the given event after operation about the "progress" event | 73 // Dispatches the given event after operation about the "progress" event |
74 // depending on the value of the ProgressEventAction argument. | 74 // depending on the value of the ProgressEventAction argument. |
75 void dispatchReadyStateChangeEvent(PassRefPtrWillBeRawPtr<Event>, DeferredEv
entAction); | 75 void dispatchReadyStateChangeEvent(PassRefPtrWillBeRawPtr<Event>, DeferredEv
entAction); |
76 | 76 |
77 void suspend(); | 77 void suspend(); |
78 void resume(); | 78 void resume(); |
79 | 79 |
| 80 // Promptly stop this timer once finalizable. |
| 81 EAGERLY_FINALIZE(); |
80 DECLARE_TRACE(); | 82 DECLARE_TRACE(); |
81 | 83 |
82 private: | 84 private: |
83 // The main purpose of this class is to throttle the "progress" | 85 // The main purpose of this class is to throttle the "progress" |
84 // ProgressEvent dispatching. This class represents such a deferred | 86 // ProgressEvent dispatching. This class represents such a deferred |
85 // "progress" ProgressEvent. | 87 // "progress" ProgressEvent. |
86 class DeferredEvent; | 88 class DeferredEvent; |
87 static const double minimumProgressEventDispatchingIntervalInSeconds; | 89 static const double minimumProgressEventDispatchingIntervalInSeconds; |
88 | 90 |
89 virtual void fired() override; | 91 virtual void fired() override; |
90 void dispatchDeferredEvent(); | 92 void dispatchDeferredEvent(); |
91 | 93 |
92 // Non-Oilpan, keep a weak pointer to our XMLHttpRequest object as it is | 94 // Non-Oilpan, keep a weak pointer to our XMLHttpRequest object as it is |
93 // the one holding us. With Oilpan, a simple strong Member can be used - | 95 // the one holding us. With Oilpan, a simple strong Member can be used - |
94 // this XMLHttpRequestProgressEventThrottle (part) object dies together | 96 // this XMLHttpRequestProgressEventThrottle (part) object dies together |
95 // with the XMLHttpRequest object. | 97 // with the XMLHttpRequest object. |
96 RawPtrWillBeMember<EventTarget> m_target; | 98 RawPtrWillBeMember<EventTarget> m_target; |
97 | 99 |
98 // A slot for the deferred "progress" ProgressEvent. When multiple events | 100 // A slot for the deferred "progress" ProgressEvent. When multiple events |
99 // arrive, only the last one is stored and others are discarded. | 101 // arrive, only the last one is stored and others are discarded. |
100 const OwnPtr<DeferredEvent> m_deferred; | 102 const OwnPtr<DeferredEvent> m_deferred; |
101 }; | 103 }; |
102 | 104 |
103 } // namespace blink | 105 } // namespace blink |
104 | 106 |
105 #endif // XMLHttpRequestProgressEventThrottle_h | 107 #endif // XMLHttpRequestProgressEventThrottle_h |
OLD | NEW |