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

Side by Side Diff: shell/child_process_host.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "shell/child_process_host.h" 5 #include "shell/child_process_host.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 24 matching lines...) Expand all
35 }; 35 };
36 36
37 ChildProcessHost::ChildProcessHost(Context* context) 37 ChildProcessHost::ChildProcessHost(Context* context)
38 : context_(context), channel_info_(nullptr) { 38 : context_(context), channel_info_(nullptr) {
39 } 39 }
40 40
41 ChildProcessHost::~ChildProcessHost() { 41 ChildProcessHost::~ChildProcessHost() {
42 DCHECK(!child_process_.IsValid()); 42 DCHECK(!child_process_.IsValid());
43 } 43 }
44 44
45 void ChildProcessHost::Start() { 45 void ChildProcessHost::Start(bool require_32_bit) {
46 DCHECK(!child_process_.IsValid()); 46 DCHECK(!child_process_.IsValid());
47 47
48 scoped_ptr<LaunchData> launch_data(new LaunchData()); 48 scoped_ptr<LaunchData> launch_data(new LaunchData());
49 launch_data->child_path = context_->mojo_shell_child_path(); 49 launch_data->child_path = context_->mojo_shell_child_path();
50 if (require_32_bit)
51 launch_data->child_path =
52 context_->mojo_shell_child_path().InsertBeforeExtensionASCII("_32");
Mark Seaborn 2015/09/15 19:42:58 It seems like this should be inside an "#if define
Sean Klein 2015/09/15 21:35:40 Using ARCH_CPU_64_BITS to work with ARM too.
50 53
51 // TODO(vtl): Add something for |slave_info|. 54 // TODO(vtl): Add something for |slave_info|.
52 // TODO(vtl): The "unretained this" is wrong (see also below). 55 // TODO(vtl): The "unretained this" is wrong (see also below).
53 mojo::ScopedMessagePipeHandle handle(mojo::embedder::ConnectToSlave( 56 mojo::ScopedMessagePipeHandle handle(mojo::embedder::ConnectToSlave(
54 nullptr, launch_data->platform_channel_pair.PassServerHandle(), 57 nullptr, launch_data->platform_channel_pair.PassServerHandle(),
55 base::Bind(&ChildProcessHost::DidConnectToSlave, base::Unretained(this)), 58 base::Bind(&ChildProcessHost::DidConnectToSlave, base::Unretained(this)),
56 base::MessageLoop::current()->message_loop_proxy(), 59 base::MessageLoop::current()->message_loop_proxy(),
57 &launch_data->child_connection_id, &channel_info_)); 60 &launch_data->child_connection_id, &channel_info_));
58 // TODO(vtl): We should destroy the channel on destruction (using 61 // TODO(vtl): We should destroy the channel on destruction (using
59 // |channel_info_|, but only after the callback has been called. 62 // |channel_info_|, but only after the callback has been called.
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 on_app_complete_.reset(); 150 on_app_complete_.reset();
148 on_app_complete.Run(result); 151 on_app_complete.Run(result);
149 } 152 }
150 } 153 }
151 154
152 void ChildProcessHost::OnConnectionError() { 155 void ChildProcessHost::OnConnectionError() {
153 AppCompleted(MOJO_RESULT_UNKNOWN); 156 AppCompleted(MOJO_RESULT_UNKNOWN);
154 } 157 }
155 158
156 } // namespace shell 159 } // namespace shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698