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

Unified Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp

Issue 1750323002: Keep XHR progress throttle interval an implementation detail. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp
index 7d3d6b1601d97ef33f408ba151ac3de1cd6f6ac4..44dc4fa8af4603370dc8bfc07d2f49592ed9177a 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp
@@ -36,6 +36,8 @@
namespace blink {
+static const double kMinimumProgressEventDispatchingIntervalInSeconds = .05; // 50 ms per specification.
yhirano 2016/03/01 17:43:54 I generally prefer an unnamed namespace to static.
+
XMLHttpRequestProgressEventThrottle::DeferredEvent::DeferredEvent()
{
clear();
@@ -68,8 +70,6 @@ PassRefPtrWillBeRawPtr<Event> XMLHttpRequestProgressEventThrottle::DeferredEvent
return event.release();
}
-const double XMLHttpRequestProgressEventThrottle::minimumProgressEventDispatchingIntervalInSeconds = .05; // 50 ms per specification.
-
XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle(XMLHttpRequest* target)
: m_target(target)
, m_hasDispatchedProgressProgressEvent(false)
@@ -94,7 +94,7 @@ void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(const AtomicStri
m_deferred.set(lengthComputable, loaded, total);
} else {
dispatchProgressProgressEvent(ProgressEvent::create(EventTypeNames::progress, lengthComputable, loaded, total));
- startOneShot(minimumProgressEventDispatchingIntervalInSeconds, BLINK_FROM_HERE);
+ startOneShot(kMinimumProgressEventDispatchingIntervalInSeconds, BLINK_FROM_HERE);
}
}
@@ -150,7 +150,7 @@ void XMLHttpRequestProgressEventThrottle::fired()
dispatchProgressProgressEvent(m_deferred.take());
// Watch if another "progress" ProgressEvent arrives in the next 50ms.
- startOneShot(minimumProgressEventDispatchingIntervalInSeconds, BLINK_FROM_HERE);
+ startOneShot(kMinimumProgressEventDispatchingIntervalInSeconds, BLINK_FROM_HERE);
}
void XMLHttpRequestProgressEventThrottle::suspend()
« no previous file with comments | « third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698