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

Unified Diff: shell/out_of_process_native_runner.cc

Issue 1341873002: Enabling 64-bit mojo shell to launch 32-bit child to handle nonsfi content. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 months 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
« shell/child_process_host.cc ('K') | « shell/child_process_host_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/out_of_process_native_runner.cc
diff --git a/shell/out_of_process_native_runner.cc b/shell/out_of_process_native_runner.cc
index 39cf1f7003abfef747ed59f21afdebf9d08b04ab..b5c24c7de7a705e7e9cee45b53304b137831b0ed 100644
--- a/shell/out_of_process_native_runner.cc
+++ b/shell/out_of_process_native_runner.cc
@@ -4,10 +4,14 @@
#include "shell/out_of_process_native_runner.h"
+#include <string>
+
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/files/file_util.h"
#include "base/logging.h"
+#include "base/strings/string_util.h"
+#include "elf.h"
Mark Seaborn 2015/09/15 19:42:58 Should be <elf.h> since this is a system header
Sean Klein 2015/09/15 21:35:40 Done.
#include "shell/child_controller.mojom.h"
#include "shell/child_process_host.h"
#include "shell/in_process_native_runner.h"
@@ -37,7 +41,14 @@ void OutOfProcessNativeRunner::Start(
app_completed_callback_ = app_completed_callback;
child_process_host_.reset(new ChildProcessHost(context_));
- child_process_host_->Start();
+
+ bool require_32_bit = false;
+ char data[EI_NIDENT];
Mark Seaborn 2015/09/15 19:42:58 This new code could also be conditionalised on "#i
Sean Klein 2015/09/15 21:35:40 It seems a bit misleading to use a conditional her
+ if (EI_NIDENT != ReadFile(app_path, data, EI_NIDENT))
Mark Seaborn 2015/09/15 19:42:58 How about ReadFile(app_path, data, sizeof(data)),
Sean Klein 2015/09/15 21:35:40 Done.
+ assert(false);
Mark Seaborn 2015/09/15 19:42:58 Chromium style is to avoid assert() and use CHECK(
Sean Klein 2015/09/15 21:35:40 This seems misleading to me (I am not a fan of sil
Mark Seaborn 2015/09/15 22:25:43 Maybe: size_t bytes_read = ReadFile(...); DCHECK_
+ if (data[EI_CLASS] == ELFCLASS32)
+ require_32_bit = true;
Mark Seaborn 2015/09/15 19:42:58 How about splitting this new code into a Require32
Sean Klein 2015/09/15 21:35:40 Done.
+ child_process_host_->Start(require_32_bit);
// TODO(vtl): |app_path.AsUTF8Unsafe()| is unsafe.
child_process_host_->StartApp(
« shell/child_process_host.cc ('K') | « shell/child_process_host_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698