summaryrefslogtreecommitdiffstats
path: root/components/nacl/common
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-11-24 11:13:43 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-24 19:16:04 +0000
commitdf07d905b283b05c3461d55bff06142ec6b8a2c4 (patch)
treedf905ed0cd4d52c8f4125cd2a068919ee8f922f8 /components/nacl/common
parentaa0a5047cb7d49101c63344c210d0bdc4f828421 (diff)
downloadchromium_src-df07d905b283b05c3461d55bff06142ec6b8a2c4.zip
chromium_src-df07d905b283b05c3461d55bff06142ec6b8a2c4.tar.gz
chromium_src-df07d905b283b05c3461d55bff06142ec6b8a2c4.tar.bz2
Fix implicit conversion of scoped_refptr<T> to T* in components/nacl
Since it's generally an anti-pattern to keep a pointer to a MessageLoopProxy without ref'ing it, the message_loop_ member is now a scoped_refptr<T>. BUG=110610 Review URL: https://codereview.chromium.org/750263002 Cr-Commit-Position: refs/heads/master@{#305466}
Diffstat (limited to 'components/nacl/common')
-rw-r--r--components/nacl/common/nacl_debug_exception_handler_win.cc16
-rw-r--r--components/nacl/common/nacl_debug_exception_handler_win.h3
2 files changed, 10 insertions, 9 deletions
diff --git a/components/nacl/common/nacl_debug_exception_handler_win.cc b/components/nacl/common/nacl_debug_exception_handler_win.cc
index 9819869..fdf4a59 100644
--- a/components/nacl/common/nacl_debug_exception_handler_win.cc
+++ b/components/nacl/common/nacl_debug_exception_handler_win.cc
@@ -13,15 +13,15 @@ namespace {
class DebugExceptionHandler : public base::PlatformThread::Delegate {
public:
- DebugExceptionHandler(base::ProcessHandle nacl_process,
- const std::string& startup_info,
- base::MessageLoopProxy* message_loop,
- const base::Callback<void(bool)>& on_connected)
+ DebugExceptionHandler(
+ base::ProcessHandle nacl_process,
+ const std::string& startup_info,
+ const scoped_refptr<base::MessageLoopProxy>& message_loop,
+ const base::Callback<void(bool)>& on_connected)
: nacl_process_(nacl_process),
startup_info_(startup_info),
message_loop_(message_loop),
- on_connected_(on_connected) {
- }
+ on_connected_(on_connected) {}
virtual void ThreadMain() override {
// In the Windows API, the set of processes being debugged is
@@ -54,7 +54,7 @@ class DebugExceptionHandler : public base::PlatformThread::Delegate {
private:
base::win::ScopedHandle nacl_process_;
std::string startup_info_;
- base::MessageLoopProxy* message_loop_;
+ const scoped_refptr<base::MessageLoopProxy> message_loop_;
base::Callback<void(bool)> on_connected_;
DISALLOW_COPY_AND_ASSIGN(DebugExceptionHandler);
@@ -65,7 +65,7 @@ class DebugExceptionHandler : public base::PlatformThread::Delegate {
void NaClStartDebugExceptionHandlerThread(
base::ProcessHandle nacl_process,
const std::string& startup_info,
- base::MessageLoopProxy* message_loop,
+ const scoped_refptr<base::MessageLoopProxy>& message_loop,
const base::Callback<void(bool)>& on_connected) {
// The new PlatformThread will take ownership of the
// DebugExceptionHandler object, which will delete itself on exit.
diff --git a/components/nacl/common/nacl_debug_exception_handler_win.h b/components/nacl/common/nacl_debug_exception_handler_win.h
index 42beefe..5c49d30 100644
--- a/components/nacl/common/nacl_debug_exception_handler_win.h
+++ b/components/nacl/common/nacl_debug_exception_handler_win.h
@@ -6,13 +6,14 @@
#define COMPONENTS_NACL_COMMON_NACL_DEBUG_EXCEPTION_HANDLER_WIN_H_
#include "base/callback.h"
+#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
#include "base/process/process.h"
void NaClStartDebugExceptionHandlerThread(
base::ProcessHandle nacl_process,
const std::string& startup_info,
- base::MessageLoopProxy* message_loop,
+ const scoped_refptr<base::MessageLoopProxy>& message_loop,
const base::Callback<void(bool)>& on_connected);
#endif // COMPONENTS_NACL_COMMON_NACL_DEBUG_EXCEPTION_HANDLER_WIN_H_