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

Side by Side Diff: content/common/gpu/gpu_channel_manager.cc

Issue 7129006: Make EstablishGpuChannel synchronous. Remove obsolete Synchronize msg. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fix indentation and rebase Created 9 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « content/common/gpu/gpu_channel_manager.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/common/gpu/gpu_channel_manager.h" 5 #include "content/common/gpu/gpu_channel_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "app/win/scoped_com_initializer.h" 10 #include "app/win/scoped_com_initializer.h"
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) { 42 bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) {
43 bool msg_is_ok = true; 43 bool msg_is_ok = true;
44 bool handled = true; 44 bool handled = true;
45 IPC_BEGIN_MESSAGE_MAP_EX(GpuChannelManager, msg, msg_is_ok) 45 IPC_BEGIN_MESSAGE_MAP_EX(GpuChannelManager, msg, msg_is_ok)
46 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel) 46 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel)
47 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel) 47 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel)
48 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer, 48 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer,
49 OnCreateViewCommandBuffer) 49 OnCreateViewCommandBuffer)
50 IPC_MESSAGE_HANDLER(GpuMsg_Synchronize, OnSynchronize)
51 IPC_MESSAGE_HANDLER(GpuMsg_VisibilityChanged, OnVisibilityChanged) 50 IPC_MESSAGE_HANDLER(GpuMsg_VisibilityChanged, OnVisibilityChanged)
52 #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) || defined(OS_WIN) 51 #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) || defined(OS_WIN)
53 IPC_MESSAGE_HANDLER(GpuMsg_ResizeViewACK, OnResizeViewACK); 52 IPC_MESSAGE_HANDLER(GpuMsg_ResizeViewACK, OnResizeViewACK);
54 #elif defined(OS_MACOSX) 53 #elif defined(OS_MACOSX)
55 IPC_MESSAGE_HANDLER(GpuMsg_AcceleratedSurfaceBuffersSwappedACK, 54 IPC_MESSAGE_HANDLER(GpuMsg_AcceleratedSurfaceBuffersSwappedACK,
56 OnAcceleratedSurfaceBuffersSwappedACK) 55 OnAcceleratedSurfaceBuffersSwappedACK)
57 IPC_MESSAGE_HANDLER(GpuMsg_DestroyCommandBuffer, 56 IPC_MESSAGE_HANDLER(GpuMsg_DestroyCommandBuffer,
58 OnDestroyCommandBuffer) 57 OnDestroyCommandBuffer)
59 #endif 58 #endif
60 IPC_MESSAGE_UNHANDLED(handled = false) 59 IPC_MESSAGE_UNHANDLED(handled = false)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 const IPC::ChannelHandle& channel_handle) { 100 const IPC::ChannelHandle& channel_handle) {
102 for (GpuChannelMap::iterator iter = gpu_channels_.begin(); 101 for (GpuChannelMap::iterator iter = gpu_channels_.begin();
103 iter != gpu_channels_.end(); ++iter) { 102 iter != gpu_channels_.end(); ++iter) {
104 if (iter->second->GetChannelName() == channel_handle.name) { 103 if (iter->second->GetChannelName() == channel_handle.name) {
105 gpu_channels_.erase(iter); 104 gpu_channels_.erase(iter);
106 return; 105 return;
107 } 106 }
108 } 107 }
109 } 108 }
110 109
111 void GpuChannelManager::OnSynchronize() {
112 Send(new GpuHostMsg_SynchronizeReply());
113 }
114
115 void GpuChannelManager::OnVisibilityChanged( 110 void GpuChannelManager::OnVisibilityChanged(
116 int32 render_view_id, int32 renderer_id, bool visible) { 111 int32 render_view_id, int32 renderer_id, bool visible) {
117 // TODO(amarinichev): this will be used for context eviction 112 // TODO(amarinichev): this will be used for context eviction
118 } 113 }
119 114
120 void GpuChannelManager::OnCreateViewCommandBuffer( 115 void GpuChannelManager::OnCreateViewCommandBuffer(
121 gfx::PluginWindowHandle window, 116 gfx::PluginWindowHandle window,
122 int32 render_view_id, 117 int32 render_view_id,
123 int32 renderer_id, 118 int32 renderer_id,
124 const GPUCreateCommandBufferConfig& init_params) { 119 const GPUCreateCommandBufferConfig& init_params) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 160
166 void GpuChannelManager::LoseAllContexts() { 161 void GpuChannelManager::LoseAllContexts() {
167 MessageLoop::current()->PostTask( 162 MessageLoop::current()->PostTask(
168 FROM_HERE, method_factory_.NewRunnableMethod( 163 FROM_HERE, method_factory_.NewRunnableMethod(
169 &GpuChannelManager::OnLoseAllContexts)); 164 &GpuChannelManager::OnLoseAllContexts));
170 } 165 }
171 166
172 void GpuChannelManager::OnLoseAllContexts() { 167 void GpuChannelManager::OnLoseAllContexts() {
173 gpu_channels_.clear(); 168 gpu_channels_.clear();
174 } 169 }
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel_manager.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698