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

Side by Side Diff: ppapi/proxy/message_handler.cc

Issue 467303005: Remove implicit conversions from scoped_refptr to T* in ppapi/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 "ppapi/proxy/message_handler.h" 5 #include "ppapi/proxy/message_handler.h"
6 6
7 #include "ipc/ipc_message.h" 7 #include "ipc/ipc_message.h"
8 #include "ppapi/proxy/plugin_dispatcher.h" 8 #include "ppapi/proxy/plugin_dispatcher.h"
9 #include "ppapi/proxy/ppapi_messages.h" 9 #include "ppapi/proxy/ppapi_messages.h"
10 #include "ppapi/proxy/ppb_message_loop_proxy.h" 10 #include "ppapi/proxy/ppb_message_loop_proxy.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 result.reset(new MessageHandler( 79 result.reset(new MessageHandler(
80 instance, handler_if, user_data, message_loop_resource)); 80 instance, handler_if, user_data, message_loop_resource));
81 *error = PP_OK; 81 *error = PP_OK;
82 return result.Pass(); 82 return result.Pass();
83 } 83 }
84 84
85 MessageHandler::~MessageHandler() { 85 MessageHandler::~MessageHandler() {
86 // It's possible the message_loop_proxy is NULL if that loop has been quit. 86 // It's possible the message_loop_proxy is NULL if that loop has been quit.
87 // In that case, we unfortunately just can't call Destroy. 87 // In that case, we unfortunately just can't call Destroy.
88 if (message_loop_->message_loop_proxy()) { 88 if (message_loop_->message_loop_proxy().get()) {
89 // The posted task won't have the proxy lock, but that's OK, it doesn't 89 // The posted task won't have the proxy lock, but that's OK, it doesn't
90 // touch any internal state; it's a direct call on the plugin's function. 90 // touch any internal state; it's a direct call on the plugin's function.
91 message_loop_->message_loop_proxy()->PostTask(FROM_HERE, 91 message_loop_->message_loop_proxy()->PostTask(FROM_HERE,
92 base::Bind(handler_if_->Destroy, 92 base::Bind(handler_if_->Destroy,
93 instance_, 93 instance_,
94 user_data_)); 94 user_data_));
95 } 95 }
96 } 96 }
97 97
98 bool MessageHandler::LoopIsValid() const { 98 bool MessageHandler::LoopIsValid() const {
99 return !!message_loop_->message_loop_proxy(); 99 return !!message_loop_->message_loop_proxy().get();
100 } 100 }
101 101
102 void MessageHandler::HandleMessage(ScopedPPVar var) { 102 void MessageHandler::HandleMessage(ScopedPPVar var) {
103 message_loop_->message_loop_proxy()->PostTask(FROM_HERE, 103 message_loop_->message_loop_proxy()->PostTask(FROM_HERE,
104 RunWhileLocked(base::Bind(&HandleMessageWrapper, 104 RunWhileLocked(base::Bind(&HandleMessageWrapper,
105 handler_if_->HandleMessage, 105 handler_if_->HandleMessage,
106 instance_, 106 instance_,
107 user_data_, 107 user_data_,
108 var))); 108 var)));
109 } 109 }
(...skipping 15 matching lines...) Expand all
125 void* user_data, 125 void* user_data,
126 scoped_refptr<MessageLoopResource> message_loop) 126 scoped_refptr<MessageLoopResource> message_loop)
127 : instance_(instance), 127 : instance_(instance),
128 handler_if_(handler_if), 128 handler_if_(handler_if),
129 user_data_(user_data), 129 user_data_(user_data),
130 message_loop_(message_loop) { 130 message_loop_(message_loop) {
131 } 131 }
132 132
133 } // namespace proxy 133 } // namespace proxy
134 } // namespace ppapi 134 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698