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

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

Issue 17074009: Created multi-process-friendly PowerMonitor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Uber-refactor Created 7 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/gpu/gpu_channel.h" 9 #include "content/common/gpu/gpu_channel.h"
10 10
11 #include <queue> 11 #include <queue>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/debug/trace_event.h" 16 #include "base/debug/trace_event.h"
17 #include "base/message_loop/message_loop_proxy.h" 17 #include "base/message_loop/message_loop_proxy.h"
18 #include "base/power_monitor/power_monitor.h"
18 #include "base/process_util.h" 19 #include "base/process_util.h"
19 #include "base/rand_util.h" 20 #include "base/rand_util.h"
20 #include "base/strings/string_util.h" 21 #include "base/strings/string_util.h"
21 #include "base/timer.h" 22 #include "base/timer.h"
22 #include "content/common/gpu/gpu_channel_manager.h" 23 #include "content/common/gpu/gpu_channel_manager.h"
23 #include "content/common/gpu/gpu_messages.h" 24 #include "content/common/gpu/gpu_messages.h"
24 #include "content/common/gpu/sync_point_manager.h" 25 #include "content/common/gpu/sync_point_manager.h"
26 #include "content/common/power_monitor_message_filter.h"
25 #include "content/public/common/content_switches.h" 27 #include "content/public/common/content_switches.h"
26 #include "crypto/hmac.h" 28 #include "crypto/hmac.h"
27 #include "gpu/command_buffer/common/mailbox.h" 29 #include "gpu/command_buffer/common/mailbox.h"
28 #include "gpu/command_buffer/service/gpu_scheduler.h" 30 #include "gpu/command_buffer/service/gpu_scheduler.h"
29 #include "gpu/command_buffer/service/image_manager.h" 31 #include "gpu/command_buffer/service/image_manager.h"
30 #include "gpu/command_buffer/service/mailbox_manager.h" 32 #include "gpu/command_buffer/service/mailbox_manager.h"
31 #include "ipc/ipc_channel.h" 33 #include "ipc/ipc_channel.h"
32 #include "ipc/ipc_channel_proxy.h" 34 #include "ipc/ipc_channel_proxy.h"
33 #include "ui/gl/gl_context.h" 35 #include "ui/gl/gl_context.h"
34 #include "ui/gl/gl_image.h" 36 #include "ui/gl/gl_image.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 weak_factory_.GetWeakPtr())); 482 weak_factory_.GetWeakPtr()));
481 483
482 filter_ = new GpuChannelMessageFilter( 484 filter_ = new GpuChannelMessageFilter(
483 mailbox_manager_->private_key(), 485 mailbox_manager_->private_key(),
484 weak_ptr, 486 weak_ptr,
485 gpu_channel_manager_->sync_point_manager(), 487 gpu_channel_manager_->sync_point_manager(),
486 base::MessageLoopProxy::current()); 488 base::MessageLoopProxy::current());
487 io_message_loop_ = io_message_loop; 489 io_message_loop_ = io_message_loop;
488 channel_->AddFilter(filter_.get()); 490 channel_->AddFilter(filter_.get());
489 491
492 PowerMonitorBroadcastSource* power_monitor_source_ =
493 static_cast<PowerMonitorBroadcastSource*>(
vandebo (ex-Chrome) 2013/06/26 21:40:33 Is it easy to get at the original source instead o
494 base::PowerMonitor::Get()->Source());
495 channel_->AddFilter(power_monitor_source_->MessageFilter());
vandebo (ex-Chrome) 2013/06/26 21:40:33 Is there ever a RemoveFilter call? The concern is
Ken Russell (switch to Gerrit) 2013/06/27 13:08:23 This setup doesn't look correct to me. You want to
bajones 2013/07/01 20:21:58 I don't see any examples of a filter being removed
bajones 2013/07/01 20:21:58 I've moved the addition of the message filter into
496
490 return true; 497 return true;
491 } 498 }
492 499
493 std::string GpuChannel::GetChannelName() { 500 std::string GpuChannel::GetChannelName() {
494 return channel_id_; 501 return channel_id_;
495 } 502 }
496 503
497 #if defined(OS_POSIX) 504 #if defined(OS_POSIX)
498 int GpuChannel::TakeRendererFileDescriptor() { 505 int GpuChannel::TakeRendererFileDescriptor() {
499 if (!channel_) { 506 if (!channel_) {
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 } 957 }
951 } 958 }
952 959
953 void GpuChannel::CacheShader(const std::string& key, 960 void GpuChannel::CacheShader(const std::string& key,
954 const std::string& shader) { 961 const std::string& shader) {
955 gpu_channel_manager_->Send( 962 gpu_channel_manager_->Send(
956 new GpuHostMsg_CacheShader(client_id_, key, shader)); 963 new GpuHostMsg_CacheShader(client_id_, key, shader));
957 } 964 }
958 965
959 } // namespace content 966 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698