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

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
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,12 +60,16 @@
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& url = resource_base_url + resource_urls_[i];
pp::CompletionCallback ready_callback =
- callback_factory_.NewCallback(&PnaclResources::ResourceReady, url);
+ callback_factory_.NewCallback(&PnaclResources::ResourceReady,
+ resource_urls_[i]);
jvoung - send to chromium... 2011/11/11 00:40:57 could also pass the full_url here, and avoid re-co
sehr (please use chromium) 2011/11/11 01:01:18 Done.
if (!plugin_->StreamAsFile(url, ready_callback.pp_completion_callback())) {
ErrorInfo error_info;
error_info.SetReport(ERROR_UNKNOWN,
@@ -84,8 +88,9 @@
PLUGIN_PRINTF(("PnaclResources::ResourceReady (pp_error=%"
NACL_PRId32", url=%s)\n", pp_error, url.c_str()));
// pp_error is checked by GetLoadedFileDesc.
+ nacl::string full_url = coordinator_->resource_base_url() + url;
int32_t fd = coordinator_->GetLoadedFileDesc(pp_error,
- url,
+ full_url,
"resource " + url);
if (fd < 0) {
coordinator_->PnaclPpapiError(pp_error);

Powered by Google App Engine
This is Rietveld 408576698