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

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: Created 7 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
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/process_util.h" 18 #include "base/process_util.h"
19 #include "base/rand_util.h" 19 #include "base/rand_util.h"
20 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
21 #include "base/timer.h" 21 #include "base/timer.h"
22 #include "content/common/gpu/gpu_channel_manager.h" 22 #include "content/common/gpu/gpu_channel_manager.h"
23 #include "content/common/gpu/gpu_messages.h" 23 #include "content/common/gpu/gpu_messages.h"
24 #include "content/common/gpu/sync_point_manager.h" 24 #include "content/common/gpu/sync_point_manager.h"
25 #include "content/common/power_monitor_message_filter.h"
25 #include "content/public/common/content_switches.h" 26 #include "content/public/common/content_switches.h"
26 #include "crypto/hmac.h" 27 #include "crypto/hmac.h"
27 #include "gpu/command_buffer/common/mailbox.h" 28 #include "gpu/command_buffer/common/mailbox.h"
28 #include "gpu/command_buffer/service/gpu_scheduler.h" 29 #include "gpu/command_buffer/service/gpu_scheduler.h"
29 #include "gpu/command_buffer/service/image_manager.h" 30 #include "gpu/command_buffer/service/image_manager.h"
30 #include "gpu/command_buffer/service/mailbox_manager.h" 31 #include "gpu/command_buffer/service/mailbox_manager.h"
31 #include "ipc/ipc_channel.h" 32 #include "ipc/ipc_channel.h"
32 #include "ipc/ipc_channel_proxy.h" 33 #include "ipc/ipc_channel_proxy.h"
33 #include "ui/gl/gl_context.h" 34 #include "ui/gl/gl_context.h"
34 #include "ui/gl/gl_image.h" 35 #include "ui/gl/gl_image.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 weak_factory_.GetWeakPtr())); 481 weak_factory_.GetWeakPtr()));
481 482
482 filter_ = new GpuChannelMessageFilter( 483 filter_ = new GpuChannelMessageFilter(
483 mailbox_manager_->private_key(), 484 mailbox_manager_->private_key(),
484 weak_ptr, 485 weak_ptr,
485 gpu_channel_manager_->sync_point_manager(), 486 gpu_channel_manager_->sync_point_manager(),
486 base::MessageLoopProxy::current()); 487 base::MessageLoopProxy::current());
487 io_message_loop_ = io_message_loop; 488 io_message_loop_ = io_message_loop;
488 channel_->AddFilter(filter_.get()); 489 channel_->AddFilter(filter_.get());
489 490
491 power_monitor_filter_ = new PowerMonitorMessageFilter();
492 channel_->AddFilter(power_monitor_filter_.get());
493
490 return true; 494 return true;
491 } 495 }
492 496
493 std::string GpuChannel::GetChannelName() { 497 std::string GpuChannel::GetChannelName() {
494 return channel_id_; 498 return channel_id_;
495 } 499 }
496 500
497 #if defined(OS_POSIX) 501 #if defined(OS_POSIX)
498 int GpuChannel::TakeRendererFileDescriptor() { 502 int GpuChannel::TakeRendererFileDescriptor() {
499 if (!channel_) { 503 if (!channel_) {
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 } 954 }
951 } 955 }
952 956
953 void GpuChannel::CacheShader(const std::string& key, 957 void GpuChannel::CacheShader(const std::string& key,
954 const std::string& shader) { 958 const std::string& shader) {
955 gpu_channel_manager_->Send( 959 gpu_channel_manager_->Send(
956 new GpuHostMsg_CacheShader(client_id_, key, shader)); 960 new GpuHostMsg_CacheShader(client_id_, key, shader));
957 } 961 }
958 962
959 } // namespace content 963 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698