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

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

Issue 6793054: Moved code that runs in both the browser and GPU process from content/gpu to content/common/gpu. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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.h ('k') | content/common/gpu/gpu_channel_manager.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 #if defined(OS_WIN) 5 #if defined(OS_WIN)
6 #include <windows.h> 6 #include <windows.h>
7 #endif 7 #endif
8 8
9 #include "content/gpu/gpu_channel.h" 9 #include "content/common/gpu/gpu_channel.h"
10 10
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/process_util.h" 12 #include "base/process_util.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "content/common/child_process.h" 14 #include "content/common/child_process.h"
15 #include "content/common/content_client.h" 15 #include "content/common/content_client.h"
16 #include "content/common/content_switches.h" 16 #include "content/common/content_switches.h"
17 #include "content/common/gpu_messages.h" 17 #include "content/common/gpu_messages.h"
18 #include "content/gpu/gpu_render_thread.h" 18 #include "content/common/gpu/gpu_channel_manager.h"
19 #include "content/gpu/gpu_video_service.h" 19 #include "content/common/gpu/gpu_video_service.h"
20 20
21 #if defined(OS_POSIX) 21 #if defined(OS_POSIX)
22 #include "ipc/ipc_channel_posix.h" 22 #include "ipc/ipc_channel_posix.h"
23 #endif 23 #endif
24 24
25 GpuChannel::GpuChannel(GpuRenderThread* gpu_render_thread, 25 GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
26 GpuWatchdogThread* gpu_watchdog_thread, 26 GpuWatchdogThread* gpu_watchdog_thread,
27 int renderer_id) 27 int renderer_id)
28 : gpu_render_thread_(gpu_render_thread), 28 : gpu_channel_manager_(gpu_channel_manager),
29 renderer_id_(renderer_id), 29 renderer_id_(renderer_id),
30 renderer_process_(base::kNullProcessHandle), 30 renderer_process_(base::kNullProcessHandle),
31 renderer_pid_(base::kNullProcessId), 31 renderer_pid_(base::kNullProcessId),
32 watchdog_thread_(gpu_watchdog_thread) { 32 watchdog_thread_(gpu_watchdog_thread) {
33 DCHECK(gpu_render_thread); 33 DCHECK(gpu_channel_manager);
34 DCHECK(renderer_id); 34 DCHECK(renderer_id);
35 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 35 const CommandLine* command_line = CommandLine::ForCurrentProcess();
36 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); 36 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages);
37 disallowed_extensions_.multisampling = 37 disallowed_extensions_.multisampling =
38 command_line->HasSwitch(switches::kDisableGLMultisampling); 38 command_line->HasSwitch(switches::kDisableGLMultisampling);
39 } 39 }
40 40
41 GpuChannel::~GpuChannel() { 41 GpuChannel::~GpuChannel() {
42 #if defined(OS_WIN) 42 #if defined(OS_WIN)
43 if (renderer_process_) 43 if (renderer_process_)
(...skipping 17 matching lines...) Expand all
61 reply->set_reply_error(); 61 reply->set_reply_error();
62 Send(reply); 62 Send(reply);
63 } 63 }
64 return false; 64 return false;
65 } 65 }
66 66
67 return true; 67 return true;
68 } 68 }
69 69
70 void GpuChannel::OnChannelError() { 70 void GpuChannel::OnChannelError() {
71 gpu_render_thread_->RemoveChannel(renderer_id_); 71 gpu_channel_manager_->RemoveChannel(renderer_id_);
72 } 72 }
73 73
74 void GpuChannel::OnChannelConnected(int32 peer_pid) { 74 void GpuChannel::OnChannelConnected(int32 peer_pid) {
75 renderer_pid_ = peer_pid; 75 renderer_pid_ = peer_pid;
76 } 76 }
77 77
78 bool GpuChannel::Send(IPC::Message* message) { 78 bool GpuChannel::Send(IPC::Message* message) {
79 if (log_messages_) { 79 if (log_messages_) {
80 VLOG(1) << "sending message @" << message << " on channel @" << this 80 VLOG(1) << "sending message @" << message << " on channel @" << this
81 << " with type " << message->type(); 81 << " with type " << message->type();
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 264
265 #if defined(OS_POSIX) 265 #if defined(OS_POSIX)
266 int GpuChannel::GetRendererFileDescriptor() { 266 int GpuChannel::GetRendererFileDescriptor() {
267 int fd = -1; 267 int fd = -1;
268 if (channel_.get()) { 268 if (channel_.get()) {
269 fd = channel_->GetClientFileDescriptor(); 269 fd = channel_->GetClientFileDescriptor();
270 } 270 }
271 return fd; 271 return fd;
272 } 272 }
273 #endif // defined(OS_POSIX) 273 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_channel_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698