summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-07 04:48:27 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-07 04:48:27 +0000
commit0a68ac87d596b9756dcb168eda822230892c4356 (patch)
treec965deb846a7ae051dc81ab30cab23ed5a79c0b5 /gpu
parent0149b7207b1227bd626a3e3c97a9467004926e69 (diff)
downloadchromium_src-0a68ac87d596b9756dcb168eda822230892c4356.zip
chromium_src-0a68ac87d596b9756dcb168eda822230892c4356.tar.gz
chromium_src-0a68ac87d596b9756dcb168eda822230892c4356.tar.bz2
Send message to renderer on command buffer error
If there's a command buffer error, no more swap buffers callbacks will be sent, which could cause the renderer to hang forever. Prevent that by sending a message to the renderer, which will invoke the lost context callback. BUG= TEST= Review URL: http://codereview.chromium.org/7024011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88097 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/command_buffer_service.cc7
-rw-r--r--gpu/command_buffer/service/command_buffer_service.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc
index bc36fa3..b042a23 100644
--- a/gpu/command_buffer/service/command_buffer_service.cc
+++ b/gpu/command_buffer/service/command_buffer_service.cc
@@ -249,6 +249,8 @@ void CommandBufferService::SetToken(int32 token) {
void CommandBufferService::SetParseError(error::Error error) {
if (error_ == error::kNoError) {
error_ = error;
+ if (parse_error_callback_.get())
+ parse_error_callback_->Run();
}
}
@@ -257,4 +259,9 @@ void CommandBufferService::SetPutOffsetChangeCallback(
put_offset_change_callback_.reset(callback);
}
+void CommandBufferService::SetParseErrorCallback(
+ Callback0::Type* callback) {
+ parse_error_callback_.reset(callback);
+}
+
} // namespace gpu
diff --git a/gpu/command_buffer/service/command_buffer_service.h b/gpu/command_buffer/service/command_buffer_service.h
index f8d3744..cffef5f 100644
--- a/gpu/command_buffer/service/command_buffer_service.h
+++ b/gpu/command_buffer/service/command_buffer_service.h
@@ -50,6 +50,7 @@ class CommandBufferService : public CommandBuffer {
// attempting to write more to the command buffer. Takes ownership of
// callback.
virtual void SetPutOffsetChangeCallback(Callback1<bool>::Type* callback);
+ virtual void SetParseErrorCallback(Callback0::Type* callback);
private:
Buffer ring_buffer_;
@@ -57,6 +58,7 @@ class CommandBufferService : public CommandBuffer {
int32 get_offset_;
int32 put_offset_;
scoped_ptr<Callback1<bool>::Type> put_offset_change_callback_;
+ scoped_ptr<Callback0::Type> parse_error_callback_;
std::vector<Buffer> registered_objects_;
std::set<int32> unused_registered_object_elements_;
int32 token_;