diff options
author | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 11:09:52 +0000 |
---|---|---|
committer | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 11:09:52 +0000 |
commit | 9876476a3a3d99ab52a7705d3038363b7eab30fb (patch) | |
tree | d24f174e1361668a6aedbf688a5d36aa7a5ca899 | |
parent | 03eb8e9122528a2c35da2c3d0bc2694918f8b574 (diff) | |
download | chromium_src-9876476a3a3d99ab52a7705d3038363b7eab30fb.zip chromium_src-9876476a3a3d99ab52a7705d3038363b7eab30fb.tar.gz chromium_src-9876476a3a3d99ab52a7705d3038363b7eab30fb.tar.bz2 |
Revert 61718 - GPU process terminates on hang.
I added a watchdog thread that intermitently checks the main thread can respond to tasks posted on its message queue.
I fixed some bugs that preventede GGL from failing when the GPU channel was lost.
Added a command line swith to disable the watchdog thread for debugging purposes.
TEST=try, check WebGL works, check about:gpuhang terminates process.
BUG=38739,53871
Review URL: http://codereview.chromium.org/3528012
TBR=apatrick@chromium.org
Review URL: http://codereview.chromium.org/3616011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61782 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser_about_handler.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gpu_process_host.cc | 25 | ||||
-rw-r--r-- | chrome/browser/gpu_process_host.h | 7 | ||||
-rw-r--r-- | chrome/chrome.gyp | 2 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/gpu/gpu_main.cc | 10 | ||||
-rw-r--r-- | chrome/gpu/gpu_watchdog_thread.cc | 104 | ||||
-rw-r--r-- | chrome/gpu/gpu_watchdog_thread.h | 40 | ||||
-rw-r--r-- | chrome/renderer/command_buffer_proxy.cc | 77 | ||||
-rw-r--r-- | chrome/renderer/command_buffer_proxy.h | 12 | ||||
-rw-r--r-- | chrome/renderer/ggl/ggl.cc | 2 | ||||
-rw-r--r-- | chrome/renderer/gpu_channel_host.cc | 17 | ||||
-rw-r--r-- | chrome/renderer/gpu_channel_host.h | 6 | ||||
-rw-r--r-- | chrome/renderer/render_thread.cc | 8 | ||||
-rw-r--r-- | chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc | 5 |
16 files changed, 48 insertions, 276 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 0395051..69ad244 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -1162,11 +1162,11 @@ bool WillHandleBrowserAboutURL(GURL* url, Profile* profile) { // Handle URLs to wreck the gpu process. if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutGpuCrashURL)) { - GpuProcessHost::Get()->SendAboutGpuCrash(); + GpuProcessHost::SendAboutGpuCrash(); return true; } if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutGpuHangURL)) { - GpuProcessHost::Get()->SendAboutGpuHang(); + GpuProcessHost::SendAboutGpuHang(); return true; } diff --git a/chrome/browser/gpu_process_host.cc b/chrome/browser/gpu_process_host.cc index 3825c2f..8e2242e 100644 --- a/chrome/browser/gpu_process_host.cc +++ b/chrome/browser/gpu_process_host.cc @@ -91,7 +91,6 @@ bool GpuProcessHost::Init() { // Propagate relevant command line switches. static const char* const kSwitchNames[] = { switches::kUseGL, - switches::kDisableGpuWatchdog, switches::kDisableLogging, switches::kEnableLogging, switches::kGpuStartupDialog, @@ -123,18 +122,14 @@ GpuProcessHost* GpuProcessHost::Get() { return sole_instance_; } +// static void GpuProcessHost::SendAboutGpuCrash() { - ChromeThread::PostTask( - ChromeThread::IO, - FROM_HERE, - NewRunnableFunction(&GpuProcessHost::SendAboutGpuCrashInternal)); + Get()->Send(new GpuMsg_Crash()); } +// static void GpuProcessHost::SendAboutGpuHang() { - ChromeThread::PostTask( - ChromeThread::IO, - FROM_HERE, - NewRunnableFunction(&GpuProcessHost::SendAboutGpuHangInternal)); + Get()->Send(new GpuMsg_Hang()); } bool GpuProcessHost::Send(IPC::Message* msg) { @@ -353,15 +348,3 @@ URLRequestContext* GpuProcessHost::GetRequestContext( bool GpuProcessHost::CanShutdown() { return true; } - -// static -void GpuProcessHost::SendAboutGpuCrashInternal() { - DCHECK(Get()); - Get()->Send(new GpuMsg_Crash()); -} - -// static -void GpuProcessHost::SendAboutGpuHangInternal() { - DCHECK(Get()); - Get()->Send(new GpuMsg_Hang()); -} diff --git a/chrome/browser/gpu_process_host.h b/chrome/browser/gpu_process_host.h index ec43ca8..a5268ba 100644 --- a/chrome/browser/gpu_process_host.h +++ b/chrome/browser/gpu_process_host.h @@ -29,11 +29,11 @@ class GpuProcessHost : public BrowserChildProcessHost { static GpuProcessHost* Get(); // Tells the GPU process to crash. Useful for testing. - void SendAboutGpuCrash(); + static void SendAboutGpuCrash(); // Tells the GPU process to let its main thread enter an infinite loop. // Useful for testing. - void SendAboutGpuHang(); + static void SendAboutGpuHang(); // Shutdown routine, which should only be called upon process // termination. @@ -115,9 +115,6 @@ class GpuProcessHost : public BrowserChildProcessHost { virtual bool CanShutdown(); - static void SendAboutGpuCrashInternal(); - static void SendAboutGpuHangInternal(); - bool initialized_; bool initialized_successfully_; diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index fca575b..a5b89184 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -723,8 +723,6 @@ 'gpu/gpu_video_service.h', 'gpu/gpu_view_win.cc', 'gpu/gpu_view_win.h', - 'gpu/gpu_watchdog_thread.cc', - 'gpu/gpu_watchdog_thread.h', 'gpu/media/gpu_video_device.h', 'gpu/media/fake_gl_video_decode_engine.cc', 'gpu/media/fake_gl_video_decode_engine.h', diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index f571137..d6ff1d6 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -204,10 +204,6 @@ const char kDisableGeolocation[] = "disable-geolocation"; // Disable the GLSL translator. const char kDisableGLSLTranslator[] = "disable-glsl-translator"; -// Disable the thread that crashes the GPU process if it stops responding to -// messages. -const char kDisableGpuWatchdog[] = "disable-gpu-watchdog"; - // Suppresses hang monitor dialogs in renderer processes. This may allow slow // unload handlers on a page to prevent the tab from closing, but the Task // Manager can be used to terminate the offending process in this case. diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 158da97..75aefc5 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -70,7 +70,6 @@ extern const char kDisableExtensions[]; extern const char kDisableExtensionsFileAccessCheck[]; extern const char kDisableGeolocation[]; extern const char kDisableGLSLTranslator[]; -extern const char kDisableGpuWatchdog[]; extern const char kDisableHangMonitor[]; extern const char kDisableInternalFlash[]; extern const char kDisableIPv6[]; diff --git a/chrome/gpu/gpu_main.cc b/chrome/gpu/gpu_main.cc index e1dd911..5ffd39f 100644 --- a/chrome/gpu/gpu_main.cc +++ b/chrome/gpu/gpu_main.cc @@ -11,7 +11,6 @@ #include "chrome/gpu/gpu_config.h" #include "chrome/gpu/gpu_process.h" #include "chrome/gpu/gpu_thread.h" -#include "chrome/gpu/gpu_watchdog_thread.h" #if defined(USE_LINUX_BREAKPAD) #include "chrome/app/breakpad_linux.h" @@ -66,21 +65,12 @@ int GpuMain(const MainFunctionParams& parameters) { GpuProcess gpu_process; gpu_process.set_main_thread(new GpuThread()); - scoped_refptr<GpuWatchdogThread> watchdog_thread( - new GpuWatchdogThread(MessageLoop::current())); - - if (!command_line.HasSwitch(switches::kDisableGpuWatchdog)) - watchdog_thread->Start(); - #if defined(USE_X11) SetGpuX11ErrorHandlers(); #endif main_message_loop.Run(); - if (!command_line.HasSwitch(switches::kDisableGpuWatchdog)) - watchdog_thread->Stop(); - return 0; } diff --git a/chrome/gpu/gpu_watchdog_thread.cc b/chrome/gpu/gpu_watchdog_thread.cc deleted file mode 100644 index ccd9ff3..0000000 --- a/chrome/gpu/gpu_watchdog_thread.cc +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#if defined(OS_WIN) -#include <windows.h> -#endif - -#include "chrome/gpu/gpu_watchdog_thread.h" - -#include "base/compiler_specific.h" -#include "build/build_config.h" - -namespace { -const int64 kCheckPeriod = 2000; -const int64 kTimeoutPeriod = 2000; -} - -GpuWatchdogThread::GpuWatchdogThread(MessageLoop* watched_message_loop) - : base::Thread("Watchdog"), - watched_message_loop_(watched_message_loop) { - DCHECK(watched_message_loop); -} - -GpuWatchdogThread::~GpuWatchdogThread() { - // Verify that the thread was explicitly stopped. If the thread is stopped - // implicitly by the destructor, CleanUp() will not be called. - DCHECK(!method_factory_.get()); -} - -void GpuWatchdogThread::Init() { - // The method factory must be created on the watchdog thread. - method_factory_.reset(new MethodFactory(this)); - - // Schedule the first check. - OnCheck(); -} - -void GpuWatchdogThread::CleanUp() { - // The method factory must be destroyed on the watchdog thread. - method_factory_->RevokeAll(); - method_factory_.reset(); - - // Prevent any more delayed tasks from being posted. - watched_message_loop_ = NULL; -} - -void GpuWatchdogThread::OnAcknowledge() { - // Revoke any pending OnExit. - method_factory_->RevokeAll(); - - // The monitored thread has responded. Post a task to check it again. - if (watched_message_loop_) { - message_loop()->PostDelayedTask( - FROM_HERE, - method_factory_->NewRunnableMethod(&GpuWatchdogThread::OnCheck), - kCheckPeriod); - } -} - -void GpuWatchdogThread::OnCheck() { - if (watched_message_loop_) { - // Post a task to the monitored thread that simply responds with a task that - // calls OnAcknowldge. - watched_message_loop_->PostTask( - FROM_HERE, - NewRunnableMethod(this, &GpuWatchdogThread::PostAcknowledge)); - - // Post a task to the watchdog thread to exit if the nmonitored thread does - // not respond in time. - message_loop()->PostDelayedTask( - FROM_HERE, - method_factory_->NewRunnableMethod(&GpuWatchdogThread::OnExit), - kTimeoutPeriod); - } -} - -void GpuWatchdogThread::PostAcknowledge() { - // Called on the monitored thread. Responds with OnAcknowledge. Cannot use - // the method factory. Rely on reference counting instead. - message_loop()->PostTask( - FROM_HERE, - NewRunnableMethod(this, &GpuWatchdogThread::OnAcknowledge)); -} - -// Use the --disable-gpu-watchdog command line switch to disable this. -void GpuWatchdogThread::OnExit() { - // For minimal developer annoyance, don't keep crashing. - static bool crashed = false; - if (crashed) - return; - -#if defined(OS_WIN) - if (IsDebuggerPresent()) - return; -#endif - - LOG(ERROR) << "The GPU process hung. Restarting."; - - volatile int* null_pointer = NULL; - *null_pointer = 0xb0a710ad; // Boatload (of cycles) - - crashed = true; -} diff --git a/chrome/gpu/gpu_watchdog_thread.h b/chrome/gpu/gpu_watchdog_thread.h deleted file mode 100644 index 6dbbc32..0000000 --- a/chrome/gpu/gpu_watchdog_thread.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_GPU_GPU_WATCHDOG_THREAD_H_ -#define CHROME_GPU_GPU_WATCHDOG_THREAD_H_ - -#include "base/ref_counted.h" -#include "base/scoped_ptr.h" -#include "base/task.h" -#include "base/thread.h" - -// A thread that intermitently sends tasks to a group of watched message loops -// and deliberately crashes if one of them does not respond after a timeout. -class GpuWatchdogThread : public base::Thread, - public base::RefCountedThreadSafe<GpuWatchdogThread> { - public: - explicit GpuWatchdogThread(MessageLoop* watched_message_loop); - virtual ~GpuWatchdogThread(); - - protected: - virtual void Init(); - virtual void CleanUp(); - - private: - void OnAcknowledge(); - void OnCheck(); - void PostAcknowledge(); - void OnExit(); - void Disable(); - - MessageLoop* watched_message_loop_; - - typedef ScopedRunnableMethodFactory<GpuWatchdogThread> MethodFactory; - scoped_ptr<MethodFactory> method_factory_; - - DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); -}; - -#endif // CHROME_GPU_GPU_WATCHDOG_THREAD_H_ diff --git a/chrome/renderer/command_buffer_proxy.cc b/chrome/renderer/command_buffer_proxy.cc index 43fe0c0..aade75f 100644 --- a/chrome/renderer/command_buffer_proxy.cc +++ b/chrome/renderer/command_buffer_proxy.cc @@ -53,6 +53,16 @@ void CommandBufferProxy::OnChannelError() { last_state_.error = gpu::error::kLostContext; } +bool CommandBufferProxy::Send(IPC::Message* msg) { + if (channel_) + return channel_->Send(msg); + + // Callee takes ownership of message, regardless of whether Send is + // successful. See IPC::Message::Sender. + delete msg; + return false; +} + bool CommandBufferProxy::Initialize(int32 size) { DCHECK(!ring_buffer_.get()); @@ -84,21 +94,14 @@ Buffer CommandBufferProxy::GetRingBuffer() { } gpu::CommandBuffer::State CommandBufferProxy::GetState() { - // Send will flag state with lost context if IPC fails. - if (last_state_.error == gpu::error::kNoError) - Send(new GpuCommandBufferMsg_GetState(route_id_, &last_state_)); - + Send(new GpuCommandBufferMsg_GetState(route_id_, &last_state_)); return last_state_; } gpu::CommandBuffer::State CommandBufferProxy::Flush(int32 put_offset) { - // Send will flag state with lost context if IPC fails. - if (last_state_.error == gpu::error::kNoError) { - Send(new GpuCommandBufferMsg_Flush(route_id_, - put_offset, - &last_state_)); - } - + Send(new GpuCommandBufferMsg_Flush(route_id_, + put_offset, + &last_state_)); return last_state_; } @@ -108,22 +111,14 @@ void CommandBufferProxy::SetGetOffset(int32 get_offset) { } int32 CommandBufferProxy::CreateTransferBuffer(size_t size) { - if (last_state_.error == gpu::error::kNoError) { - int32 id; - if (Send(new GpuCommandBufferMsg_CreateTransferBuffer(route_id_, - size, - &id))) { - return id; - } - } + int32 id; + if (Send(new GpuCommandBufferMsg_CreateTransferBuffer(route_id_, size, &id))) + return id; return -1; } void CommandBufferProxy::DestroyTransferBuffer(int32 id) { - if (last_state_.error != gpu::error::kNoError) - return; - // Remove the transfer buffer from the client side4 cache. TransferBufferMap::iterator it = transfer_buffers_.find(id); DCHECK(it != transfer_buffers_.end()); @@ -137,9 +132,6 @@ void CommandBufferProxy::DestroyTransferBuffer(int32 id) { } Buffer CommandBufferProxy::GetTransferBuffer(int32 id) { - if (last_state_.error != gpu::error::kNoError) - return Buffer(); - // Check local cache to see if there is already a client side shared memory // object for this id. TransferBufferMap::iterator it = transfer_buffers_.find(id); @@ -205,12 +197,8 @@ void CommandBufferProxy::SetSwapBuffersCallback(Callback0::Type* callback) { } void CommandBufferProxy::ResizeOffscreenFrameBuffer(const gfx::Size& size) { - if (last_state_.error != gpu::error::kNoError) - return; - IPC::Message* message = new GpuCommandBufferMsg_ResizeOffscreenFrameBuffer(route_id_, size); - // We need to set the unblock flag on this message to guarantee the // order in which it is processed in the GPU process. Ordinarily in // certain situations, namely if a synchronous message is being @@ -232,17 +220,11 @@ void CommandBufferProxy::SetNotifyRepaintTask(Task* task) { #if defined(OS_MACOSX) void CommandBufferProxy::SetWindowSize(const gfx::Size& size) { - if (last_state_.error != gpu::error::kNoError) - return; - Send(new GpuCommandBufferMsg_SetWindowSize(route_id_, size)); } #endif void CommandBufferProxy::AsyncGetState(Task* completion_task) { - if (last_state_.error != gpu::error::kNoError) - return; - IPC::Message* message = new GpuCommandBufferMsg_AsyncGetState(route_id_); // Do not let a synchronous flush hold up this message. If this handler is @@ -255,9 +237,6 @@ void CommandBufferProxy::AsyncGetState(Task* completion_task) { } void CommandBufferProxy::AsyncFlush(int32 put_offset, Task* completion_task) { - if (last_state_.error != gpu::error::kNoError) - return; - IPC::Message* message = new GpuCommandBufferMsg_AsyncFlush(route_id_, put_offset); @@ -270,28 +249,6 @@ void CommandBufferProxy::AsyncFlush(int32 put_offset, Task* completion_task) { pending_async_flush_tasks_.push(linked_ptr<Task>(completion_task)); } -bool CommandBufferProxy::Send(IPC::Message* msg) { - // Caller should not intentionally send a message if the context is lost. - DCHECK(last_state_.error == gpu::error::kNoError); - - if (channel_) { - if (channel_->Send(msg)) { - return true; - } else { - // Flag the command buffer as lost. Defer deleting the channel until - // OnChannelError is called after returning to the message loop in case - // it is referenced elsewhere. - last_state_.error = gpu::error::kLostContext; - return false; - } - } - - // Callee takes ownership of message, regardless of whether Send is - // successful. See IPC::Message::Sender. - delete msg; - return false; -} - void CommandBufferProxy::OnUpdateState(gpu::CommandBuffer::State state) { last_state_ = state; diff --git a/chrome/renderer/command_buffer_proxy.h b/chrome/renderer/command_buffer_proxy.h index b425074..9b8e3f7 100644 --- a/chrome/renderer/command_buffer_proxy.h +++ b/chrome/renderer/command_buffer_proxy.h @@ -32,7 +32,8 @@ class Task; // Client side proxy that forwards messages synchronously to a // CommandBufferStub. class CommandBufferProxy : public gpu::CommandBuffer, - public IPC::Channel::Listener { + public IPC::Channel::Listener, + public IPC::Message::Sender { public: CommandBufferProxy(IPC::Channel::Sender* channel, int route_id); virtual ~CommandBufferProxy(); @@ -41,6 +42,9 @@ class CommandBufferProxy : public gpu::CommandBuffer, virtual void OnMessageReceived(const IPC::Message& message); virtual void OnChannelError(); + // IPC::Message::Sender implementation: + virtual bool Send(IPC::Message* msg); + int route_id() const { return route_id_; } // CommandBuffer implementation: @@ -85,12 +89,6 @@ class CommandBufferProxy : public gpu::CommandBuffer, void AsyncFlush(int32 put_offset, Task* completion_task); private: - - // Send an IPC message over the GPU channel. This is private to fully - // encapsulate the channel; all callers of this function must explicitly - // verify that the context has not been lost. - bool Send(IPC::Message* msg); - // Message handlers: void OnUpdateState(gpu::CommandBuffer::State state); void OnNotifyRepaint(); diff --git a/chrome/renderer/ggl/ggl.cc b/chrome/renderer/ggl/ggl.cc index 16fe691..efe2072 100644 --- a/chrome/renderer/ggl/ggl.cc +++ b/chrome/renderer/ggl/ggl.cc @@ -154,7 +154,7 @@ bool Context::Initialize(gfx::NativeViewId view, const int32* attrib_list) { DCHECK(size.width() >= 0 && size.height() >= 0); - if (channel_->state() != GpuChannelHost::kConnected) + if (channel_->state() != GpuChannelHost::CONNECTED) return false; // Ensure the gles2 library is initialized first in a thread safe way. diff --git a/chrome/renderer/gpu_channel_host.cc b/chrome/renderer/gpu_channel_host.cc index c8def6c..0b576b8 100644 --- a/chrome/renderer/gpu_channel_host.cc +++ b/chrome/renderer/gpu_channel_host.cc @@ -9,7 +9,7 @@ #include "chrome/renderer/command_buffer_proxy.h" #include "chrome/renderer/gpu_video_service_host.h" -GpuChannelHost::GpuChannelHost() : state_(kUnconnected) { +GpuChannelHost::GpuChannelHost() : state_(UNCONNECTED) { } GpuChannelHost::~GpuChannelHost() { @@ -25,7 +25,7 @@ void GpuChannelHost::Connect(const std::string& channel_name) { // It is safe to send IPC messages before the channel completes the connection // and receives the hello message from the GPU process. The messages get // cached. - state_ = kConnected; + state_ = CONNECTED; } void GpuChannelHost::set_gpu_info(const GPUInfo& gpu_info) { @@ -53,7 +53,7 @@ void GpuChannelHost::OnChannelConnected(int32 peer_pid) { } void GpuChannelHost::OnChannelError() { - state_ = kLost; + state_ = LOST; // Channel is invalid and will be reinitialized if this host is requested // again. @@ -74,13 +74,12 @@ void GpuChannelHost::OnChannelError() { } bool GpuChannelHost::Send(IPC::Message* message) { - if (channel_.get()) - return channel_->Send(message); + if (!channel_.get()) { + delete message; + return false; + } - // Callee takes ownership of message, regardless of whether Send is - // successful. See IPC::Message::Sender. - delete message; - return false; + return channel_->Send(message); } CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer( diff --git a/chrome/renderer/gpu_channel_host.h b/chrome/renderer/gpu_channel_host.h index 847d918..c139219 100644 --- a/chrome/renderer/gpu_channel_host.h +++ b/chrome/renderer/gpu_channel_host.h @@ -29,12 +29,12 @@ class GpuChannelHost : public IPC::Channel::Listener, public: enum State { // Not yet connected. - kUnconnected, + UNCONNECTED, // Ready to use. - kConnected, + CONNECTED, // An error caused the host to become disconnected. Recreate channel to // reestablish connection. - kLost + LOST }; // Called on the render thread diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index d1acd2c..bef96f9 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -774,12 +774,12 @@ void RenderThread::EstablishGpuChannel() { if (gpu_channel_.get()) { // Do nothing if we already have a GPU channel or are already // establishing one. - if (gpu_channel_->state() == GpuChannelHost::kUnconnected || - gpu_channel_->state() == GpuChannelHost::kConnected) + if (gpu_channel_->state() == GpuChannelHost::UNCONNECTED || + gpu_channel_->state() == GpuChannelHost::CONNECTED) return; // Recreate the channel if it has been lost. - if (gpu_channel_->state() == GpuChannelHost::kLost) + if (gpu_channel_->state() == GpuChannelHost::LOST) gpu_channel_ = NULL; } @@ -800,7 +800,7 @@ GpuChannelHost* RenderThread::GetGpuChannel() { if (!gpu_channel_.get()) return NULL; - if (gpu_channel_->state() != GpuChannelHost::kConnected) + if (gpu_channel_->state() != GpuChannelHost::CONNECTED) return NULL; return gpu_channel_.get(); diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc index a08904a..cc4118c 100644 --- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc +++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc @@ -56,7 +56,7 @@ bool WebGraphicsContext3DCommandBufferImpl::initialize( GpuChannelHost* host = render_thread->EstablishGpuChannelSync(); if (!host) return false; - DCHECK(host->state() == GpuChannelHost::kConnected); + DCHECK(host->state() == GpuChannelHost::CONNECTED); // Convert WebGL context creation attributes into GGL/EGL size requests. const int alpha_size = attributes.alpha ? 8 : 0; @@ -187,8 +187,7 @@ bool WebGraphicsContext3DCommandBufferImpl::isGLES2NPOTStrict() { return false; } -bool WebGraphicsContext3DCommandBufferImpl:: - isErrorGeneratedOnOutOfBoundsAccesses() { +bool WebGraphicsContext3DCommandBufferImpl::isErrorGeneratedOnOutOfBoundsAccesses() { return false; } |