Skip to content

Commit

Permalink
Make NaCl/Chromium startup interface easier to maintain
Browse files Browse the repository at this point in the history
Use the new NaClMainForChromium() from the NaCl tree, instead of
sel_main.cc in the Chromium tree.

Use the new variant of RegisterInternalNaClPlugin() that can receive
multiple functions instead of just one.

This depends on r2744 from NaCl.

BUG=http://code.google.com/p/nativeclient/issues/detail?id=642
BUG=http://code.google.com/p/nativeclient/issues/detail?id=469
TEST=Chromium's nacl_ui_tests

Review URL: http://codereview.chromium.org/3039016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53333 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
mseaborn@chromium.org committed Jul 22, 2010
1 parent 1f4016d commit 492e3b0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 204 deletions.
1 change: 0 additions & 1 deletion chrome/nacl.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
'nacl/nacl_main_platform_delegate_win.cc',
'nacl/nacl_thread.cc',
'nacl/nacl_thread.h',
'nacl/sel_main.cc',
],
# TODO(gregoryd): consider switching NaCl to use Chrome OS defines
'conditions': [
Expand Down
7 changes: 5 additions & 2 deletions chrome/nacl/nacl_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ typedef HANDLE NaClHandle;
typedef int NaClHandle;
#endif // NaClHandle

int SelMain(const int desc, const NaClHandle handle);
// This is currently necessary because we have a conflict between
// NaCl's "struct NaClThread" and Chromium's "class NaClThread".
extern "C" int NaClMainForChromium(int handle_count, const NaClHandle* handles);

NaClThread::NaClThread() {
}
Expand All @@ -36,5 +38,6 @@ void NaClThread::OnControlMessageReceived(const IPC::Message& msg) {

void NaClThread::OnStartSelLdr(int channel_descriptor,
nacl::FileDescriptor handle) {
SelMain(channel_descriptor, nacl::ToNativeHandle(handle));
NaClHandle nacl_handle = nacl::ToNativeHandle(handle);
NaClMainForChromium(/* handle_count= */ 1, &nacl_handle);
}
199 changes: 0 additions & 199 deletions chrome/nacl/sel_main.cc

This file was deleted.

8 changes: 6 additions & 2 deletions chrome/renderer/render_process_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,12 @@ RenderProcessImpl::RenderProcessImpl()
}

#ifndef DISABLE_NACL
if (command_line.HasSwitch(switches::kInternalNaCl))
RegisterInternalNaClPlugin(LaunchNaClProcess);
if (command_line.HasSwitch(switches::kInternalNaCl)) {
std::map<std::string, uintptr_t> funcs;
funcs["launch_nacl_process"] =
reinterpret_cast<uintptr_t>(LaunchNaClProcess);
RegisterInternalNaClPlugin(funcs);
}
#endif

if (!command_line.HasSwitch(switches::kDisableByteRangeSupport)) {
Expand Down

0 comments on commit 492e3b0

Please sign in to comment.