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

Unified Diff: ppapi/native_client/src/trusted/plugin/pnacl_resources.cc

Issue 8525014: Get all the resources relative to a single base. Currently the same base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | « ppapi/native_client/src/trusted/plugin/pnacl_resources.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/trusted/plugin/pnacl_resources.cc
===================================================================
--- ppapi/native_client/src/trusted/plugin/pnacl_resources.cc (revision 109525)
+++ ppapi/native_client/src/trusted/plugin/pnacl_resources.cc (working copy)
@@ -60,17 +60,23 @@
delayed_callback_.reset(
new DelayedCallback(all_loaded_callback, resource_count));
+ // All resource URLs are relative to the coordinator's resource_base_url().
+ nacl::string resource_base_url = coordinator_->resource_base_url();
+
// Schedule the downloads.
CHECK(resource_urls_.size() > 0);
for (size_t i = 0; i < resource_urls_.size(); ++i) {
- const nacl::string& url = resource_urls_[i];
+ const nacl::string& full_url = resource_base_url + resource_urls_[i];
pp::CompletionCallback ready_callback =
- callback_factory_.NewCallback(&PnaclResources::ResourceReady, url);
- if (!plugin_->StreamAsFile(url, ready_callback.pp_completion_callback())) {
+ callback_factory_.NewCallback(&PnaclResources::ResourceReady,
+ resource_urls_[i],
+ full_url);
+ if (!plugin_->StreamAsFile(full_url,
+ ready_callback.pp_completion_callback())) {
ErrorInfo error_info;
error_info.SetReport(ERROR_UNKNOWN,
"PnaclCoordinator: Failed to download file: " +
- url + "\n");
+ resource_urls_[i] + "\n");
coordinator_->ReportLoadError(error_info);
coordinator_->PnaclNonPpapiError();
break;
@@ -80,12 +86,13 @@
}
void PnaclResources::ResourceReady(int32_t pp_error,
- const nacl::string& url) {
+ const nacl::string& url,
+ const nacl::string& full_url) {
PLUGIN_PRINTF(("PnaclResources::ResourceReady (pp_error=%"
NACL_PRId32", url=%s)\n", pp_error, url.c_str()));
// pp_error is checked by GetLoadedFileDesc.
int32_t fd = coordinator_->GetLoadedFileDesc(pp_error,
- url,
+ full_url,
"resource " + url);
if (fd < 0) {
coordinator_->PnaclPpapiError(pp_error);
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/pnacl_resources.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698