summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorDaniel Cheng <dcheng@chromium.org>2014-08-25 17:27:38 -0700
committerDaniel Cheng <dcheng@chromium.org>2014-08-26 00:31:37 +0000
commit6d3ae97888924f8b6456c6f34c8da561da3797c6 (patch)
tree61532996a9bd5033dd23599465be8ae271ae9ed3 /ppapi
parent3d7ce9f4a3fd04b148bd9afc128965b020525410 (diff)
downloadchromium_src-6d3ae97888924f8b6456c6f34c8da561da3797c6.zip
chromium_src-6d3ae97888924f8b6456c6f34c8da561da3797c6.tar.gz
chromium_src-6d3ae97888924f8b6456c6f34c8da561da3797c6.tar.bz2
Remove implicit conversions from scoped_refptr to T* in ppapi/
This patch was generated by running the rewrite_scoped_refptr clang tool on a Linux build. BUG=110610 R=dmichael@chromium.org Review URL: https://codereview.chromium.org/467303005 Cr-Commit-Position: refs/heads/master@{#291806}
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/nacl_irt/manifest_service.cc2
-rw-r--r--ppapi/proxy/file_io_resource.cc8
-rw-r--r--ppapi/proxy/message_handler.cc4
-rw-r--r--ppapi/proxy/platform_verification_private_resource.cc2
-rw-r--r--ppapi/proxy/plugin_resource.cc2
-rw-r--r--ppapi/proxy/plugin_resource.h2
-rw-r--r--ppapi/proxy/plugin_resource_var.cc2
-rw-r--r--ppapi/proxy/ppapi_proxy_test.cc2
-rw-r--r--ppapi/proxy/ppb_graphics_3d_proxy.cc2
-rw-r--r--ppapi/proxy/resource_reply_thread_registrar.cc4
-rw-r--r--ppapi/proxy/truetype_font_resource.cc2
-rw-r--r--ppapi/proxy/uma_private_resource.cc2
-rw-r--r--ppapi/proxy/video_decoder_resource.cc22
-rw-r--r--ppapi/shared_impl/tracked_callback.cc2
14 files changed, 29 insertions, 29 deletions
diff --git a/ppapi/nacl_irt/manifest_service.cc b/ppapi/nacl_irt/manifest_service.cc
index 441c401..d84b3f3 100644
--- a/ppapi/nacl_irt/manifest_service.cc
+++ b/ppapi/nacl_irt/manifest_service.cc
@@ -68,7 +68,7 @@ ManifestService::ManifestService(
channel_ = IPC::ChannelProxy::Create(handle,
IPC::Channel::MODE_SERVER,
NULL, // Listener
- io_message_loop);
+ io_message_loop.get());
channel_->AddFilter(filter_.get());
}
diff --git a/ppapi/proxy/file_io_resource.cc b/ppapi/proxy/file_io_resource.cc
index 29335ba..e119dd5 100644
--- a/ppapi/proxy/file_io_resource.cc
+++ b/ppapi/proxy/file_io_resource.cc
@@ -49,7 +49,7 @@ namespace proxy {
FileIOResource::QueryOp::QueryOp(scoped_refptr<FileHolder> file_holder)
: file_holder_(file_holder) {
- DCHECK(file_holder_);
+ DCHECK(file_holder_.get());
}
FileIOResource::QueryOp::~QueryOp() {
@@ -65,7 +65,7 @@ FileIOResource::ReadOp::ReadOp(scoped_refptr<FileHolder> file_holder,
: file_holder_(file_holder),
offset_(offset),
bytes_to_read_(bytes_to_read) {
- DCHECK(file_holder_);
+ DCHECK(file_holder_.get());
}
FileIOResource::ReadOp::~ReadOp() {
@@ -397,7 +397,7 @@ void FileIOResource::Close() {
pp_resource());
}
- if (file_holder_)
+ if (file_holder_.get())
file_holder_ = NULL;
Post(BROWSER, PpapiHostMsg_FileIO_Close(
@@ -428,7 +428,7 @@ FileIOResource::FileHolder::FileHolder(PP_FileHandle file_handle)
// static
bool FileIOResource::FileHolder::IsValid(
const scoped_refptr<FileIOResource::FileHolder>& handle) {
- return handle && handle->file_.IsValid();
+ return handle.get() && handle->file_.IsValid();
}
FileIOResource::FileHolder::~FileHolder() {
diff --git a/ppapi/proxy/message_handler.cc b/ppapi/proxy/message_handler.cc
index 6e44d0e..fff8788 100644
--- a/ppapi/proxy/message_handler.cc
+++ b/ppapi/proxy/message_handler.cc
@@ -85,7 +85,7 @@ scoped_ptr<MessageHandler> MessageHandler::Create(
MessageHandler::~MessageHandler() {
// It's possible the message_loop_proxy is NULL if that loop has been quit.
// In that case, we unfortunately just can't call Destroy.
- if (message_loop_->message_loop_proxy()) {
+ if (message_loop_->message_loop_proxy().get()) {
// The posted task won't have the proxy lock, but that's OK, it doesn't
// touch any internal state; it's a direct call on the plugin's function.
message_loop_->message_loop_proxy()->PostTask(FROM_HERE,
@@ -96,7 +96,7 @@ MessageHandler::~MessageHandler() {
}
bool MessageHandler::LoopIsValid() const {
- return !!message_loop_->message_loop_proxy();
+ return !!message_loop_->message_loop_proxy().get();
}
void MessageHandler::HandleMessage(ScopedPPVar var) {
diff --git a/ppapi/proxy/platform_verification_private_resource.cc b/ppapi/proxy/platform_verification_private_resource.cc
index d361f4f..76d5148 100644
--- a/ppapi/proxy/platform_verification_private_resource.cc
+++ b/ppapi/proxy/platform_verification_private_resource.cc
@@ -52,7 +52,7 @@ int32_t PlatformVerificationPrivateResource::ChallengePlatform(
scoped_refptr<ArrayBufferVar> challenge_buffer =
ArrayBufferVar::FromPPVar(challenge);
- if (!challenge_buffer)
+ if (!challenge_buffer.get())
return PP_ERROR_BADARGUMENT;
uint8_t* challenge_data = static_cast<uint8_t*>(challenge_buffer->Map());
diff --git a/ppapi/proxy/plugin_resource.cc b/ppapi/proxy/plugin_resource.cc
index 23094fe..f228a5e 100644
--- a/ppapi/proxy/plugin_resource.cc
+++ b/ppapi/proxy/plugin_resource.cc
@@ -34,7 +34,7 @@ PluginResource::~PluginResource() {
new PpapiHostMsg_ResourceDestroyed(pp_resource()));
}
- if (resource_reply_thread_registrar_)
+ if (resource_reply_thread_registrar_.get())
resource_reply_thread_registrar_->Unregister(pp_resource());
}
diff --git a/ppapi/proxy/plugin_resource.h b/ppapi/proxy/plugin_resource.h
index e6d3065..a9c68c9 100644
--- a/ppapi/proxy/plugin_resource.h
+++ b/ppapi/proxy/plugin_resource.h
@@ -207,7 +207,7 @@ int32_t PluginResource::Call(
callbacks_.insert(std::make_pair(params.sequence(), plugin_callback));
params.set_has_callback();
- if (resource_reply_thread_registrar_) {
+ if (resource_reply_thread_registrar_.get()) {
resource_reply_thread_registrar_->Register(
pp_resource(), params.sequence(), reply_thread_hint);
}
diff --git a/ppapi/proxy/plugin_resource_var.cc b/ppapi/proxy/plugin_resource_var.cc
index be4eec5b..84657c0 100644
--- a/ppapi/proxy/plugin_resource_var.cc
+++ b/ppapi/proxy/plugin_resource_var.cc
@@ -10,7 +10,7 @@ PluginResourceVar::PluginResourceVar(ppapi::Resource* resource)
: resource_(resource) {}
PP_Resource PluginResourceVar::GetPPResource() const {
- return resource_ ? resource_->pp_resource() : 0;
+ return resource_.get() ? resource_->pp_resource() : 0;
}
bool PluginResourceVar::IsPending() const {
diff --git a/ppapi/proxy/ppapi_proxy_test.cc b/ppapi/proxy/ppapi_proxy_test.cc
index 87aa22b..fa23bfd 100644
--- a/ppapi/proxy/ppapi_proxy_test.cc
+++ b/ppapi/proxy/ppapi_proxy_test.cc
@@ -322,7 +322,7 @@ void PluginProxyMultiThreadTest::RunTest() {
main_thread_message_loop_proxy_ =
PpapiGlobals::Get()->GetMainThreadMessageLoop();
ASSERT_EQ(main_thread_message_loop_proxy_.get(),
- base::MessageLoopProxy::current());
+ base::MessageLoopProxy::current().get());
nested_main_thread_message_loop_.reset(new base::RunLoop());
secondary_thread_.reset(new base::DelegateSimpleThread(
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.cc b/ppapi/proxy/ppb_graphics_3d_proxy.cc
index 0d383c9..4bb7b8d 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.cc
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.cc
@@ -290,7 +290,7 @@ void PPB_Graphics3D_Proxy::OnMsgCreateTransferBuffer(
if (enter.succeeded()) {
scoped_refptr<gpu::Buffer> buffer =
enter.object()->CreateTransferBuffer(size, id);
- if (!buffer)
+ if (!buffer.get())
return;
gpu::SharedMemoryBufferBacking* backing =
static_cast<gpu::SharedMemoryBufferBacking*>(buffer->backing());
diff --git a/ppapi/proxy/resource_reply_thread_registrar.cc b/ppapi/proxy/resource_reply_thread_registrar.cc
index 0c49cf5..1332987 100644
--- a/ppapi/proxy/resource_reply_thread_registrar.cc
+++ b/ppapi/proxy/resource_reply_thread_registrar.cc
@@ -27,7 +27,7 @@ void ResourceReplyThreadRegistrar::Register(
ProxyLock::AssertAcquiredDebugOnly();
// Use the default thread if |reply_thread_hint| is NULL or blocking.
- if (!reply_thread_hint || reply_thread_hint->is_blocking())
+ if (!reply_thread_hint.get() || reply_thread_hint->is_blocking())
return;
DCHECK(reply_thread_hint->target_loop());
@@ -36,7 +36,7 @@ void ResourceReplyThreadRegistrar::Register(
{
base::AutoLock auto_lock(lock_);
- if (reply_thread == default_thread_)
+ if (reply_thread.get() == default_thread_.get())
return;
map_[resource][sequence_number] = reply_thread;
diff --git a/ppapi/proxy/truetype_font_resource.cc b/ppapi/proxy/truetype_font_resource.cc
index a637f7e..e4b851e 100644
--- a/ppapi/proxy/truetype_font_resource.cc
+++ b/ppapi/proxy/truetype_font_resource.cc
@@ -45,7 +45,7 @@ PPB_TrueTypeFont_API* TrueTypeFontResource::AsPPB_TrueTypeFont_API() {
int32_t TrueTypeFontResource::Describe(
PP_TrueTypeFontDesc_Dev* desc,
scoped_refptr<TrackedCallback> callback) {
- if (describe_callback_)
+ if (describe_callback_.get())
return PP_ERROR_INPROGRESS;
if (create_result_ == PP_OK) {
diff --git a/ppapi/proxy/uma_private_resource.cc b/ppapi/proxy/uma_private_resource.cc
index 2932e6c..ba0ccdd 100644
--- a/ppapi/proxy/uma_private_resource.cc
+++ b/ppapi/proxy/uma_private_resource.cc
@@ -87,7 +87,7 @@ void UMAPrivateResource::HistogramEnumeration(
int32_t UMAPrivateResource::IsCrashReportingEnabled(
PP_Instance instance,
scoped_refptr<TrackedCallback> callback) {
- if (pending_callback_ != NULL)
+ if (pending_callback_.get() != NULL)
return PP_ERROR_INPROGRESS;
pending_callback_ = callback;
Call<PpapiPluginMsg_UMA_IsCrashReportingEnabledReply>(
diff --git a/ppapi/proxy/video_decoder_resource.cc b/ppapi/proxy/video_decoder_resource.cc
index d430edc..733e6f8 100644
--- a/ppapi/proxy/video_decoder_resource.cc
+++ b/ppapi/proxy/video_decoder_resource.cc
@@ -107,7 +107,7 @@ int32_t VideoDecoderResource::Initialize(
return PP_ERROR_FAILED;
if (profile < 0 || profile > PP_VIDEOPROFILE_MAX)
return PP_ERROR_BADARGUMENT;
- if (initialize_callback_)
+ if (initialize_callback_.get())
return PP_ERROR_INPROGRESS;
if (!graphics_context)
return PP_ERROR_BADRESOURCE;
@@ -153,9 +153,9 @@ int32_t VideoDecoderResource::Decode(uint32_t decode_id,
scoped_refptr<TrackedCallback> callback) {
if (decoder_last_error_)
return decoder_last_error_;
- if (flush_callback_ || reset_callback_)
+ if (flush_callback_.get() || reset_callback_.get())
return PP_ERROR_FAILED;
- if (decode_callback_)
+ if (decode_callback_.get())
return PP_ERROR_INPROGRESS;
if (size > kMaximumBitstreamBufferSize)
return PP_ERROR_NOMEMORY;
@@ -254,9 +254,9 @@ int32_t VideoDecoderResource::GetPicture(
scoped_refptr<TrackedCallback> callback) {
if (decoder_last_error_)
return decoder_last_error_;
- if (reset_callback_)
+ if (reset_callback_.get())
return PP_ERROR_FAILED;
- if (get_picture_callback_)
+ if (get_picture_callback_.get())
return PP_ERROR_INPROGRESS;
// If the next picture is ready, return it synchronously.
@@ -280,9 +280,9 @@ void VideoDecoderResource::RecyclePicture(const PP_VideoPicture* picture) {
int32_t VideoDecoderResource::Flush(scoped_refptr<TrackedCallback> callback) {
if (decoder_last_error_)
return decoder_last_error_;
- if (reset_callback_)
+ if (reset_callback_.get())
return PP_ERROR_FAILED;
- if (flush_callback_)
+ if (flush_callback_.get())
return PP_ERROR_INPROGRESS;
flush_callback_ = callback;
@@ -297,9 +297,9 @@ int32_t VideoDecoderResource::Flush(scoped_refptr<TrackedCallback> callback) {
int32_t VideoDecoderResource::Reset(scoped_refptr<TrackedCallback> callback) {
if (decoder_last_error_)
return decoder_last_error_;
- if (flush_callback_)
+ if (flush_callback_.get())
return PP_ERROR_FAILED;
- if (reset_callback_)
+ if (reset_callback_.get())
return PP_ERROR_INPROGRESS;
reset_callback_ = callback;
@@ -455,7 +455,7 @@ void VideoDecoderResource::OnPluginMsgDecodeComplete(
// Make the shm buffer available.
available_shm_buffers_.push_back(shm_buffers_[shm_id]);
// If the plugin is waiting, let it call Decode again.
- if (decode_callback_) {
+ if (decode_callback_.get()) {
scoped_refptr<TrackedCallback> callback;
callback.swap(decode_callback_);
callback->Run(PP_OK);
@@ -467,7 +467,7 @@ void VideoDecoderResource::OnPluginMsgFlushComplete(
// All shm buffers should have been made available by now.
DCHECK_EQ(shm_buffers_.size(), available_shm_buffers_.size());
- if (get_picture_callback_) {
+ if (get_picture_callback_.get()) {
scoped_refptr<TrackedCallback> callback;
callback.swap(get_picture_callback_);
callback->Abort();
diff --git a/ppapi/shared_impl/tracked_callback.cc b/ppapi/shared_impl/tracked_callback.cc
index 70565a1..7ddfd39 100644
--- a/ppapi/shared_impl/tracked_callback.cc
+++ b/ppapi/shared_impl/tracked_callback.cc
@@ -167,7 +167,7 @@ void TrackedCallback::PostRun(int32_t result) {
} else {
base::Closure callback_closure(
RunWhileLocked(base::Bind(&TrackedCallback::Run, this, result)));
- if (target_loop_) {
+ if (target_loop_.get()) {
target_loop_->PostClosure(FROM_HERE, callback_closure, 0);
} else {
// We must be running in-process and on the main thread (the Enter