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

Unified Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 649533003: C++11 declares a type safe null pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Presubmit errors Created 6 years, 2 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
Index: content/common/gpu/client/command_buffer_proxy_impl.cc
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index f25120c80d99422bbeb01073ae72e21efa3f7e02..683d62c5288eabd055874bd4616181939278e033 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -62,7 +62,7 @@ void CommandBufferProxyImpl::OnChannelError() {
void CommandBufferProxyImpl::OnDestroyed(gpu::error::ContextLostReason reason) {
// Prevent any further messages from being sent.
- channel_ = NULL;
+ channel_ = nullptr;
// When the client sees that the context is lost, they should delete this
// CommandBufferProxyImpl and create a new one.
@@ -251,18 +251,18 @@ scoped_refptr<gpu::Buffer> CommandBufferProxyImpl::CreateTransferBuffer(
*id = -1;
if (last_state_.error != gpu::error::kNoError)
- return NULL;
+ return nullptr;
int32 new_id = channel_->ReserveTransferBufferId();
scoped_ptr<base::SharedMemory> shared_memory(
channel_->factory()->AllocateSharedMemory(size));
if (!shared_memory)
- return NULL;
+ return nullptr;
DCHECK(!shared_memory->memory());
if (!shared_memory->Map(size))
- return NULL;
+ return nullptr;
// This handle is owned by the GPU process and must be passed to it or it
// will leak. In otherwords, do not early out on error between here and the
@@ -270,13 +270,13 @@ scoped_refptr<gpu::Buffer> CommandBufferProxyImpl::CreateTransferBuffer(
base::SharedMemoryHandle handle =
channel_->ShareToGpuProcess(shared_memory->handle());
if (!base::SharedMemory::IsHandleValid(handle))
- return NULL;
+ return nullptr;
if (!Send(new GpuCommandBufferMsg_RegisterTransferBuffer(route_id_,
new_id,
handle,
size))) {
- return NULL;
+ return nullptr;
}
*id = new_id;
@@ -305,13 +305,13 @@ gfx::GpuMemoryBuffer* CommandBufferProxyImpl::CreateGpuMemoryBuffer(
*id = -1;
if (last_state_.error != gpu::error::kNoError)
- return NULL;
+ return nullptr;
scoped_ptr<gfx::GpuMemoryBuffer> buffer(
channel_->factory()->AllocateGpuMemoryBuffer(
width, height, internalformat, usage));
if (!buffer)
- return NULL;
+ return nullptr;
DCHECK(GpuChannelHost::IsValidGpuMemoryBuffer(buffer->GetHandle()));
@@ -330,7 +330,7 @@ gfx::GpuMemoryBuffer* CommandBufferProxyImpl::CreateGpuMemoryBuffer(
width,
height,
internalformat))) {
- return NULL;
+ return nullptr;
}
*id = new_id;
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/client/context_provider_command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698