summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-21 16:38:22 +0000
committermseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-21 16:38:22 +0000
commit3cb95308104ebdba3027b54dd1051182def2f0a2 (patch)
tree48c85c7924fe4968ce94034d78a8eccb12098f6b
parent845ca3d65a75ab814900860886c3585d21e74a38 (diff)
downloadchromium_src-3cb95308104ebdba3027b54dd1051182def2f0a2.zip
chromium_src-3cb95308104ebdba3027b54dd1051182def2f0a2.tar.gz
chromium_src-3cb95308104ebdba3027b54dd1051182def2f0a2.tar.bz2
Rename NaClThread to NaClLauncherThread
This avoids a conflict with NaCl's own "struct NaClThread". NaClLauncherThread is also a more descriptive name. The goal is to be able to #include NaCl's sel_ldr.h so that we do not have to duplicate the prototype for NaClMainForChromium(). However, we cannot do that immediately because there is still a conflict between NaCl's LOG_FATAL and Chromium's LOG_FATAL. BUG=http://code.google.com/p/nativeclient/issues/detail?id=1595 TEST=trybots Review URL: http://codereview.chromium.org/6880074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82496 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/nacl.gypi6
-rw-r--r--chrome/nacl/nacl_launcher_thread.cc (renamed from chrome/nacl/nacl_thread.cc)20
-rw-r--r--chrome/nacl/nacl_launcher_thread.h (renamed from chrome/nacl/nacl_thread.h)16
-rw-r--r--chrome/nacl/nacl_main.cc6
4 files changed, 25 insertions, 23 deletions
diff --git a/chrome/nacl.gypi b/chrome/nacl.gypi
index f125393..1d9ab38 100644
--- a/chrome/nacl.gypi
+++ b/chrome/nacl.gypi
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -28,8 +28,8 @@
'nacl/nacl_main_platform_delegate_linux.cc',
'nacl/nacl_main_platform_delegate_mac.mm',
'nacl/nacl_main_platform_delegate_win.cc',
- 'nacl/nacl_thread.cc',
- 'nacl/nacl_thread.h',
+ 'nacl/nacl_launcher_thread.cc',
+ 'nacl/nacl_launcher_thread.h',
],
# TODO(gregoryd): consider switching NaCl to use Chrome OS defines
'conditions': [
diff --git a/chrome/nacl/nacl_thread.cc b/chrome/nacl/nacl_launcher_thread.cc
index 9c966f4..1a435a0 100644
--- a/chrome/nacl/nacl_thread.cc
+++ b/chrome/nacl/nacl_launcher_thread.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/nacl/nacl_thread.h"
+#include "chrome/nacl/nacl_launcher_thread.h"
#include <vector>
@@ -61,31 +61,33 @@ typedef int NaClHandle;
#endif // NaClHandle
// This is currently necessary because we have a conflict between
-// NaCl's "struct NaClThread" and Chromium's "class NaClThread".
+// NaCl's LOG_FATAL (from platform/nacl_log.h) and Chromium's
+// LOG_FATAL (from base/logging.h).
extern "C" int NaClMainForChromium(int handle_count, const NaClHandle* handles,
int debug);
-NaClThread::NaClThread(bool debug) {
+NaClLauncherThread::NaClLauncherThread(bool debug) {
debug_enabled_ = debug ? 1 : 0;
}
-NaClThread::~NaClThread() {
+NaClLauncherThread::~NaClLauncherThread() {
}
-NaClThread* NaClThread::current() {
- return static_cast<NaClThread*>(ChildThread::current());
+NaClLauncherThread* NaClLauncherThread::current() {
+ return static_cast<NaClLauncherThread*>(ChildThread::current());
}
-bool NaClThread::OnControlMessageReceived(const IPC::Message& msg) {
+bool NaClLauncherThread::OnControlMessageReceived(const IPC::Message& msg) {
bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(NaClThread, msg)
+ IPC_BEGIN_MESSAGE_MAP(NaClLauncherThread, msg)
IPC_MESSAGE_HANDLER(NaClProcessMsg_Start, OnStartSelLdr)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
}
-void NaClThread::OnStartSelLdr(std::vector<nacl::FileDescriptor> handles) {
+void NaClLauncherThread::OnStartSelLdr(
+ std::vector<nacl::FileDescriptor> handles) {
#if defined(OS_LINUX)
nacl::SetCreateMemoryObjectFunc(
renderer_sandbox_support::MakeSharedMemorySegmentViaIPC);
diff --git a/chrome/nacl/nacl_thread.h b/chrome/nacl/nacl_launcher_thread.h
index bf9645a..4452ef1 100644
--- a/chrome/nacl/nacl_thread.h
+++ b/chrome/nacl/nacl_launcher_thread.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,14 +10,14 @@
#include "chrome/common/nacl_types.h"
#include "content/common/child_thread.h"
-// The NaClThread class represents a background thread where NaCl app gets
-// started.
-class NaClThread : public ChildThread {
+// The NaClLauncherThread class represents a background thread where
+// NaCl app gets started.
+class NaClLauncherThread : public ChildThread {
public:
- explicit NaClThread(bool debug);
- ~NaClThread();
+ explicit NaClLauncherThread(bool debug);
+ ~NaClLauncherThread();
// Returns the one NaCl thread.
- static NaClThread* current();
+ static NaClLauncherThread* current();
private:
virtual bool OnControlMessageReceived(const IPC::Message& msg);
@@ -26,7 +26,7 @@ class NaClThread : public ChildThread {
int debug_enabled_;
// TODO(gregoryd): do we need to override Cleanup as in PluginThread?
- DISALLOW_COPY_AND_ASSIGN(NaClThread);
+ DISALLOW_COPY_AND_ASSIGN(NaClLauncherThread);
};
#endif // CHROME_NACL_NACL_THREAD_H_
diff --git a/chrome/nacl/nacl_main.cc b/chrome/nacl/nacl_main.cc
index 548f21f..51c57b8 100644
--- a/chrome/nacl/nacl_main.cc
+++ b/chrome/nacl/nacl_main.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -15,8 +15,8 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/common/sandbox_policy.h"
+#include "chrome/nacl/nacl_launcher_thread.h"
#include "chrome/nacl/nacl_main_platform_delegate.h"
-#include "chrome/nacl/nacl_thread.h"
#include "content/common/child_process.h"
#include "content/common/hi_res_timer_manager.h"
#include "content/common/main_function_params.h"
@@ -119,7 +119,7 @@ int NaClMain(const MainFunctionParams& parameters) {
if (sandbox_test_result) {
ChildProcess nacl_process;
bool debug = parsed_command_line.HasSwitch(switches::kEnableNaClDebug);
- nacl_process.set_main_thread(new NaClThread(debug));
+ nacl_process.set_main_thread(new NaClLauncherThread(debug));
MessageLoop::current()->Run();
} else {
// This indirectly prevents the test-harness-success-cookie from being set,