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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 503253003: Remove implicit conversions from scoped_refptr to T* in content/*/gpu/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/gpu/gpu_ipc_browsertests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/browser_gpu_channel_host_factory.cc
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index 156dd89576fb65f20bd11802b5f4663dc98b62ff..de4e791683b05fcc57f8184051c6a49ccacaee56 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -216,7 +216,7 @@ BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory()
BrowserGpuChannelHostFactory::~BrowserGpuChannelHostFactory() {
DCHECK(IsMainThread());
- if (pending_request_)
+ if (pending_request_.get())
pending_request_->Cancel();
for (size_t n = 0; n < established_callbacks_.size(); n++)
established_callbacks_[n].Run();
@@ -301,7 +301,7 @@ GpuChannelHost* BrowserGpuChannelHostFactory::EstablishGpuChannelSync(
CauseForGpuLaunch cause_for_gpu_launch) {
EstablishGpuChannel(cause_for_gpu_launch, base::Closure());
- if (pending_request_)
+ if (pending_request_.get())
pending_request_->Wait();
return gpu_channel_.get();
@@ -311,19 +311,19 @@ void BrowserGpuChannelHostFactory::EstablishGpuChannel(
CauseForGpuLaunch cause_for_gpu_launch,
const base::Closure& callback) {
if (gpu_channel_.get() && gpu_channel_->IsLost()) {
- DCHECK(!pending_request_);
+ DCHECK(!pending_request_.get());
// Recreate the channel if it has been lost.
gpu_channel_ = NULL;
}
- if (!gpu_channel_ && !pending_request_) {
+ if (!gpu_channel_.get() && !pending_request_.get()) {
// We should only get here if the context was lost.
pending_request_ = EstablishRequest::Create(
cause_for_gpu_launch, gpu_client_id_, gpu_host_id_);
}
if (!callback.is_null()) {
- if (gpu_channel_)
+ if (gpu_channel_.get())
callback.Run();
else
established_callbacks_.push_back(callback);
@@ -331,17 +331,17 @@ void BrowserGpuChannelHostFactory::EstablishGpuChannel(
}
GpuChannelHost* BrowserGpuChannelHostFactory::GetGpuChannel() {
- if (gpu_channel_ && !gpu_channel_->IsLost())
- return gpu_channel_;
+ if (gpu_channel_.get() && !gpu_channel_->IsLost())
+ return gpu_channel_.get();
return NULL;
}
void BrowserGpuChannelHostFactory::GpuChannelEstablished() {
DCHECK(IsMainThread());
- DCHECK(pending_request_);
+ DCHECK(pending_request_.get());
if (pending_request_->channel_handle().name.empty()) {
- DCHECK(!gpu_channel_);
+ DCHECK(!gpu_channel_.get());
} else {
GetContentClient()->SetGpuInfo(pending_request_->gpu_info());
gpu_channel_ = GpuChannelHost::Create(this,
« no previous file with comments | « no previous file | content/browser/gpu/gpu_ipc_browsertests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698