summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbbudge@google.com <bbudge@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-20 21:34:21 +0000
committerbbudge@google.com <bbudge@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-20 21:34:21 +0000
commite3a234403614e149a4d9f1468d9a343cf31dccbb (patch)
treee8e08ff909faa62ec2a713c414da9ad30f8c6fe2
parenta2d2be2c5ca97ea34845b487f93d512c7b76d7ef (diff)
downloadchromium_src-e3a234403614e149a4d9f1468d9a343cf31dccbb.zip
chromium_src-e3a234403614e149a4d9f1468d9a343cf31dccbb.tar.gz
chromium_src-e3a234403614e149a4d9f1468d9a343cf31dccbb.tar.bz2
Fix NaCl download progress events for zipped Nexes.
BUG=100950 TEST=manual Review URL: http://codereview.chromium.org/8357022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106585 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
index dfb3f77..d913e66 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -1869,16 +1869,17 @@ void Plugin::UpdateNexeDownloadProgress(
int64_t /*bytes_sent*/,
int64_t /*total_bytes_to_be_sent*/,
int64_t bytes_received,
- int64_t total_bytes_to_be_received)
-{
+ int64_t total_bytes_to_be_received) {
Instance* instance = pp::Module::Get()->InstanceForPPInstance(pp_instance);
if (instance != NULL) {
Plugin* plugin = static_cast<Plugin*>(instance);
int64_t progress = bytes_received - plugin->last_event_bytes_received_;
const int64_t kProgressThreshold = 1 << 17; // 128K bytes per event
if (progress > kProgressThreshold) {
+ LengthComputable length_computable = (total_bytes_to_be_received >= 0) ?
+ LENGTH_IS_COMPUTABLE : LENGTH_IS_NOT_COMPUTABLE;
plugin->EnqueueProgressEvent("progress",
- LENGTH_IS_COMPUTABLE,
+ length_computable,
bytes_received,
total_bytes_to_be_received);
plugin->last_event_bytes_received_ = bytes_received;