diff options
author | Steve Block <steveblock@google.com> | 2011-01-05 12:15:11 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-01-06 14:14:00 +0000 |
commit | d06194330da2bb8da887d2e1adeacb3a5c1504b2 (patch) | |
tree | e0af8413af65a8e30630563441af7bdb8478e513 /WebCore/fileapi/FileReader.cpp | |
parent | 419a5cf2f8db6ca014df624865197ffb82caad37 (diff) | |
download | external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.zip external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.tar.gz external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.tar.bz2 |
Merge WebKit at r72805: Initial merge by Git
Note that this is a backwards merge from Chromium release 9.0.600.0
to 9.0.597.0, to align with the Chromium 9 stable release branch.
Change-Id: I5d2bb4e8cee9d39ae8485abf48bdb55ecf8b3790
Diffstat (limited to 'WebCore/fileapi/FileReader.cpp')
-rw-r--r-- | WebCore/fileapi/FileReader.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/WebCore/fileapi/FileReader.cpp b/WebCore/fileapi/FileReader.cpp index 9ee3b01..a54a337 100644 --- a/WebCore/fileapi/FileReader.cpp +++ b/WebCore/fileapi/FileReader.cpp @@ -35,16 +35,20 @@ #include "FileReader.h" #include "ArrayBuffer.h" +#include "Blob.h" #include "CrossThreadTask.h" #include "File.h" #include "Logging.h" #include "ProgressEvent.h" #include "ScriptExecutionContext.h" #include <wtf/CurrentTime.h> +#include <wtf/OwnPtr.h> +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> namespace WebCore { -static const double progressNotificationIntervalMS = 50; +const double progressNotificationIntervalMS = 50; FileReader::FileReader(ScriptExecutionContext* context) : ActiveDOMObject(context, this) @@ -191,7 +195,7 @@ void FileReader::didStartLoading() void FileReader::didReceiveData() { // Fire the progress event at least every 50ms. - double now = currentTimeMS(); + double now = WTF::currentTimeMS(); if (!m_lastProgressNotificationTimeMS) m_lastProgressNotificationTimeMS = now; else if (now - m_lastProgressNotificationTimeMS > progressNotificationIntervalMS) { @@ -223,7 +227,10 @@ void FileReader::didFail(int errorCode) void FileReader::fireEvent(const AtomicString& type) { - dispatchEvent(ProgressEvent::create(type, true, m_loader ? m_loader->bytesLoaded() : 0, m_loader ? m_loader->totalBytes() : 0)); + // FIXME: the current ProgressEvent uses "unsigned long" for total and loaded attributes. Need to talk with the spec writer to resolve the issue. + unsigned bytesLoaded = m_loader ? m_loader->bytesLoaded() : 0; + unsigned totalBytes = m_loader ? m_loader->totalBytes() : 0; + dispatchEvent(ProgressEvent::create(type, true, bytesLoaded, totalBytes)); } FileReader::ReadyState FileReader::readyState() const |