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

Unified Diff: ppapi/native_client/src/trusted/plugin/pnacl_coordinator.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_coordinator.cc
===================================================================
--- ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc (revision 109525)
+++ ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc (working copy)
@@ -348,20 +348,23 @@
return nacl::string("___PNACL_GENERATED");
}
-string_vector LinkResources(const nacl::string& sandbox_isa,
- bool withGenerated) {
+nacl::string ResourceBaseUrl() {
+ nacl::string sandbox_isa = GetSandboxISA();
+ nacl::string base_url = "pnacl_support/" + sandbox_isa + "/";
+ return base_url;
+}
+
+string_vector LinkResources(bool withGenerated) {
string_vector results;
- nacl::string base_dir = "pnacl_support/" + sandbox_isa;
-
// NOTE: order of items == link order.
- results.push_back(base_dir + "/crtbegin.o");
+ results.push_back("crtbegin.o");
if (withGenerated) {
results.push_back(GeneratedObjectFileName());
}
- results.push_back(base_dir + "/libcrt_platform.a");
- results.push_back(base_dir + "/libgcc.a");
- results.push_back(base_dir + "/libgcc_eh.a");
- results.push_back(base_dir + "/crtend.o");
+ results.push_back("libcrt_platform.a");
+ results.push_back("libgcc.a");
+ results.push_back("libgcc_eh.a");
+ results.push_back("crtend.o");
return results;
}
@@ -429,7 +432,7 @@
}
//// Files.
- string_vector files = LinkResources(sandbox_isa, true);
+ string_vector files = LinkResources(true);
PnaclResources* resources = coordinator->resources();
for (string_vector::iterator i = files.begin(), e = files.end();
i != e; ++i) {
@@ -585,15 +588,16 @@
void PnaclCoordinator::BitcodeToNative(
const nacl::string& pexe_url,
- const nacl::string& llc_url,
- const nacl::string& ld_url,
const pp::CompletionCallback& finish_callback) {
- PLUGIN_PRINTF(("PnaclCoordinator::BitcodeToNative (pexe=%s, llc=%s, ld=%s)\n",
- pexe_url.c_str(),
- llc_url.c_str(),
- ld_url.c_str()));
- llc_url_ = llc_url;
- ld_url_ = ld_url;
+ PLUGIN_PRINTF(("PnaclCoordinator::BitcodeToNative (pexe=%s)\n",
+ pexe_url.c_str()));
+ // The base URL for finding all the resources will be obtained from the
+ // PNaCl manifest file.
+ // Also, the llc and ld pathnames should be read from the manifest.
+ // TODO(sehr): change to use the manifest file when ready.
+ resource_base_url_ = ResourceBaseUrl();
+ llc_url_ = "llc";
+ ld_url_ = "ld";
translate_notify_callback_ = finish_callback;
// Steps:
@@ -613,9 +617,9 @@
callback_factory_.NewCallback(&PnaclCoordinator::ResourcesDidLoad,
pexe_url,
translation_unit_.get());
- resources_->AddResourceUrl(llc_url);
- resources_->AddResourceUrl(ld_url);
- string_vector link_resources = LinkResources(GetSandboxISA(), false);
+ resources_->AddResourceUrl(llc_url_);
+ resources_->AddResourceUrl(ld_url_);
+ string_vector link_resources = LinkResources(false);
for (string_vector::iterator
i = link_resources.begin(), e = link_resources.end();
i != e;
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h ('k') | ppapi/native_client/src/trusted/plugin/pnacl_resources.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698