summaryrefslogtreecommitdiffstats
path: root/ppapi/native_client/src/trusted/plugin/plugin.h
diff options
context:
space:
mode:
authorbbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-02 03:06:47 +0000
committerbbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-02 03:06:47 +0000
commit92ad3f713f47d403058c14ae81e3a496f31cb864 (patch)
tree961fdcd0825705992000782b7bd357f20c812fc5 /ppapi/native_client/src/trusted/plugin/plugin.h
parent59726558ff4ccc590da249349bb49910ac7afd0d (diff)
downloadchromium_src-92ad3f713f47d403058c14ae81e3a496f31cb864.zip
chromium_src-92ad3f713f47d403058c14ae81e3a496f31cb864.tar.gz
chromium_src-92ad3f713f47d403058c14ae81e3a496f31cb864.tar.bz2
Modify the Native Client plugin to report progress events. This CL modifies
the FileDownloader::Open method to accept an optional 'progress_callback' parameter which is passed to the URL loader using the trusted interface. The Plugin defines a static 'UpdateNexeDownloadProgress' method which it passes to the file downloader when loading nexes. A 5% progress change threshold is used to avoid spamming the Javascript side with progress updates. Review URL: http://codereview.chromium.org/7792018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/native_client/src/trusted/plugin/plugin.h')
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.h b/ppapi/native_client/src/trusted/plugin/plugin.h
index 2df0827..b4e76cf 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.h
+++ b/ppapi/native_client/src/trusted/plugin/plugin.h
@@ -1,8 +1,6 @@
-/*
- * Copyright (c) 2011 The Native Client Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
// The portable representation of an instance and root scriptable object.
// The PPAPI version of the plugin instantiates a subclass of this class.
@@ -501,12 +499,22 @@ class Plugin : public pp::InstancePrivate {
nacl::scoped_ptr<pp::WidgetClient_Dev> widget_client_adapter_;
nacl::scoped_ptr<pp::Zoom_Dev> zoom_adapter_;
- // used for NexeFileDidOpenContinuation
+ // Used for NexeFileDidOpenContinuation
int64_t load_start_;
int64_t init_time_;
int64_t ready_time_;
size_t nexe_size_;
+
+ static void UpdateNexeDownloadProgress(
+ PP_Instance pp_instance,
+ PP_Resource pp_resource,
+ int64_t bytes_sent,
+ int64_t total_bytes_to_be_sent,
+ int64_t bytes_received,
+ int64_t total_bytes_to_be_received);
+
+ int64_t last_event_bytes_received_;
};
} // namespace plugin