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

Side by Side Diff: gpu/command_buffer/service/in_process_command_buffer.cc

Issue 655963002: gpu: Fix webview parent compositor crash in context loss (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/in_process_command_buffer.h" 5 #include "gpu/command_buffer/service/in_process_command_buffer.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 740
741 bool InProcessCommandBuffer::Initialize() { 741 bool InProcessCommandBuffer::Initialize() {
742 NOTREACHED(); 742 NOTREACHED();
743 return false; 743 return false;
744 } 744 }
745 745
746 namespace { 746 namespace {
747 747
748 void PostCallback(const scoped_refptr<base::MessageLoopProxy>& loop, 748 void PostCallback(const scoped_refptr<base::MessageLoopProxy>& loop,
749 const base::Closure& callback) { 749 const base::Closure& callback) {
750 if (!loop->BelongsToCurrentThread()) { 750 // The loop.get() check is to support using InProcessCommandBuffer on a thread
751 // without a message loop.
752 if (loop.get() && !loop->BelongsToCurrentThread()) {
751 loop->PostTask(FROM_HERE, callback); 753 loop->PostTask(FROM_HERE, callback);
752 } else { 754 } else {
753 callback.Run(); 755 callback.Run();
754 } 756 }
755 } 757 }
756 758
757 void RunOnTargetThread(scoped_ptr<base::Closure> callback) { 759 void RunOnTargetThread(scoped_ptr<base::Closure> callback) {
758 DCHECK(callback.get()); 760 DCHECK(callback.get());
759 callback->Run(); 761 callback->Run();
760 } 762 }
(...skipping 15 matching lines...) Expand all
776 778
777 #if defined(OS_ANDROID) 779 #if defined(OS_ANDROID)
778 scoped_refptr<gfx::SurfaceTexture> 780 scoped_refptr<gfx::SurfaceTexture>
779 InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) { 781 InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) {
780 DCHECK(stream_texture_manager_); 782 DCHECK(stream_texture_manager_);
781 return stream_texture_manager_->GetSurfaceTexture(stream_id); 783 return stream_texture_manager_->GetSurfaceTexture(stream_id);
782 } 784 }
783 #endif 785 #endif
784 786
785 } // namespace gpu 787 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698