Commit 8b158e44 authored by teravest@chromium.org's avatar teravest@chromium.org

Pepper: Remove Plugin::EnqueueProgressEvent.

This wrapper isn't providing much benefit; we may as well tear it out. This
also removes the LengthComputable enum.

BUG=239656
R=dmichael@chromium.org

Review URL: https://codereview.chromium.org/316653002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274598 0039d316-1c4b-4281-b951-d872f2087c98
parent 99951c90
...@@ -559,29 +559,6 @@ void Plugin::ReportSelLdrLoadStatus(int status) { ...@@ -559,29 +559,6 @@ void Plugin::ReportSelLdrLoadStatus(int status) {
HistogramEnumerateSelLdrLoadStatus(static_cast<NaClErrorCode>(status)); HistogramEnumerateSelLdrLoadStatus(static_cast<NaClErrorCode>(status));
} }
void Plugin::EnqueueProgressEvent(PP_NaClEventType event_type,
const nacl::string& url,
LengthComputable length_computable,
uint64_t loaded_bytes,
uint64_t total_bytes) {
PLUGIN_PRINTF(("Plugin::EnqueueProgressEvent ("
"event_type='%d', url='%s', length_computable=%d, "
"loaded=%" NACL_PRIu64 ", total=%" NACL_PRIu64 ")\n",
static_cast<int>(event_type),
url.c_str(),
static_cast<int>(length_computable),
loaded_bytes,
total_bytes));
nacl_interface_->DispatchEvent(
pp_instance(),
event_type,
url.c_str(),
length_computable == LENGTH_IS_COMPUTABLE ? PP_TRUE : PP_FALSE,
loaded_bytes,
total_bytes);
}
bool Plugin::DocumentCanRequest(const std::string& url) { bool Plugin::DocumentCanRequest(const std::string& url) {
CHECK(pp::Module::Get()->core()->IsMainThread()); CHECK(pp::Module::Get()->core()->IsMainThread());
CHECK(pp::URLUtil_Dev::Get() != NULL); CHECK(pp::URLUtil_Dev::Get() != NULL);
......
...@@ -110,10 +110,6 @@ class Plugin : public pp::Instance { ...@@ -110,10 +110,6 @@ class Plugin : public pp::Instance {
PP_FileHandle file_handle, PP_FileHandle file_handle,
ErrorInfo* error_info); ErrorInfo* error_info);
enum LengthComputable {
LENGTH_IS_NOT_COMPUTABLE = 0,
LENGTH_IS_COMPUTABLE = 1
};
// Report successful loading of a module. // Report successful loading of a module.
void ReportLoadSuccess(uint64_t loaded_bytes, uint64_t total_bytes); void ReportLoadSuccess(uint64_t loaded_bytes, uint64_t total_bytes);
// Report an error that was encountered while loading a module. // Report an error that was encountered while loading a module.
...@@ -121,17 +117,6 @@ class Plugin : public pp::Instance { ...@@ -121,17 +117,6 @@ class Plugin : public pp::Instance {
// Report loading a module was aborted, typically due to user action. // Report loading a module was aborted, typically due to user action.
void ReportLoadAbort(); void ReportLoadAbort();
// Dispatch a JavaScript event to indicate a key step in loading.
// |event_type| is a character string indicating which type of progress
// event (loadstart, progress, error, abort, load, loadend). Events are
// enqueued on the JavaScript event loop, which then calls back through
// DispatchProgressEvent.
void EnqueueProgressEvent(PP_NaClEventType event_type,
const nacl::string& url,
LengthComputable length_computable,
uint64_t loaded_bytes,
uint64_t total_bytes);
// Report the error code that sel_ldr produces when starting a nexe. // Report the error code that sel_ldr produces when starting a nexe.
void ReportSelLdrLoadStatus(int status); void ReportSelLdrLoadStatus(int status);
......
...@@ -256,9 +256,10 @@ void PnaclCoordinator::TranslateFinished(int32_t pp_error) { ...@@ -256,9 +256,10 @@ void PnaclCoordinator::TranslateFinished(int32_t pp_error) {
// that were delayed (see the delay inserted in BitcodeGotCompiled). // that were delayed (see the delay inserted in BitcodeGotCompiled).
if (ExpectedProgressKnown()) { if (ExpectedProgressKnown()) {
pexe_bytes_compiled_ = expected_pexe_size_; pexe_bytes_compiled_ = expected_pexe_size_;
plugin_->EnqueueProgressEvent(PP_NACL_EVENT_PROGRESS, GetNaClInterface()->DispatchEvent(plugin_->pp_instance(),
pexe_url_, PP_NACL_EVENT_PROGRESS,
plugin::Plugin::LENGTH_IS_COMPUTABLE, pexe_url_.c_str(),
PP_TRUE,
pexe_bytes_compiled_, pexe_bytes_compiled_,
expected_pexe_size_); expected_pexe_size_);
} }
...@@ -549,16 +550,18 @@ void PnaclCoordinator::BitcodeGotCompiled(int32_t pp_error, ...@@ -549,16 +550,18 @@ void PnaclCoordinator::BitcodeGotCompiled(int32_t pp_error,
// that bytes were sent to the compiler. // that bytes were sent to the compiler.
if (ExpectedProgressKnown()) { if (ExpectedProgressKnown()) {
if (!ShouldDelayProgressEvent()) { if (!ShouldDelayProgressEvent()) {
plugin_->EnqueueProgressEvent(PP_NACL_EVENT_PROGRESS, GetNaClInterface()->DispatchEvent(plugin_->pp_instance(),
pexe_url_, PP_NACL_EVENT_PROGRESS,
plugin::Plugin::LENGTH_IS_COMPUTABLE, pexe_url_.c_str(),
PP_TRUE,
pexe_bytes_compiled_, pexe_bytes_compiled_,
expected_pexe_size_); expected_pexe_size_);
} }
} else { } else {
plugin_->EnqueueProgressEvent(PP_NACL_EVENT_PROGRESS, GetNaClInterface()->DispatchEvent(plugin_->pp_instance(),
pexe_url_, PP_NACL_EVENT_PROGRESS,
plugin::Plugin::LENGTH_IS_NOT_COMPUTABLE, pexe_url_.c_str(),
PP_FALSE,
pexe_bytes_compiled_, pexe_bytes_compiled_,
expected_pexe_size_); expected_pexe_size_);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment