OLD | NEW |
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 #include "content/browser/renderer_host/render_message_filter.h" | 5 #include "content/browser/renderer_host/render_message_filter.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 #if defined(OS_MACOSX) | 388 #if defined(OS_MACOSX) |
389 process_metrics_.reset(base::ProcessMetrics::CreateProcessMetrics(handle, | 389 process_metrics_.reset(base::ProcessMetrics::CreateProcessMetrics(handle, |
390 NULL)); | 390 NULL)); |
391 #else | 391 #else |
392 process_metrics_.reset(base::ProcessMetrics::CreateProcessMetrics(handle)); | 392 process_metrics_.reset(base::ProcessMetrics::CreateProcessMetrics(handle)); |
393 #endif | 393 #endif |
394 cpu_usage_ = process_metrics_->GetCPUUsage(); // Initialize CPU usage counters | 394 cpu_usage_ = process_metrics_->GetCPUUsage(); // Initialize CPU usage counters |
395 cpu_usage_sample_time_ = base::TimeTicks::Now(); | 395 cpu_usage_sample_time_ = base::TimeTicks::Now(); |
396 } | 396 } |
397 | 397 |
398 bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message, | 398 bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message) { |
399 bool* message_was_ok) { | |
400 bool handled = true; | 399 bool handled = true; |
401 IPC_BEGIN_MESSAGE_MAP_EX(RenderMessageFilter, message, *message_was_ok) | 400 IPC_BEGIN_MESSAGE_MAP(RenderMessageFilter, message) |
402 #if defined(OS_WIN) | 401 #if defined(OS_WIN) |
403 IPC_MESSAGE_HANDLER(ViewHostMsg_PreCacheFontCharacters, | 402 IPC_MESSAGE_HANDLER(ViewHostMsg_PreCacheFontCharacters, |
404 OnPreCacheFontCharacters) | 403 OnPreCacheFontCharacters) |
405 #endif | 404 #endif |
406 IPC_MESSAGE_HANDLER(ViewHostMsg_GetProcessMemorySizes, | 405 IPC_MESSAGE_HANDLER(ViewHostMsg_GetProcessMemorySizes, |
407 OnGetProcessMemorySizes) | 406 OnGetProcessMemorySizes) |
408 IPC_MESSAGE_HANDLER(ViewHostMsg_GenerateRoutingID, OnGenerateRoutingID) | 407 IPC_MESSAGE_HANDLER(ViewHostMsg_GenerateRoutingID, OnGenerateRoutingID) |
409 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWindow, OnCreateWindow) | 408 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWindow, OnCreateWindow) |
410 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWidget, OnCreateWidget) | 409 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWidget, OnCreateWidget) |
411 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateFullscreenWidget, | 410 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateFullscreenWidget, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 IPC_MESSAGE_HANDLER(ViewHostMsg_GetMonitorColorProfile, | 462 IPC_MESSAGE_HANDLER(ViewHostMsg_GetMonitorColorProfile, |
464 OnGetMonitorColorProfile) | 463 OnGetMonitorColorProfile) |
465 #endif | 464 #endif |
466 IPC_MESSAGE_HANDLER(ViewHostMsg_MediaLogEvents, OnMediaLogEvents) | 465 IPC_MESSAGE_HANDLER(ViewHostMsg_MediaLogEvents, OnMediaLogEvents) |
467 IPC_MESSAGE_HANDLER(ViewHostMsg_Are3DAPIsBlocked, OnAre3DAPIsBlocked) | 466 IPC_MESSAGE_HANDLER(ViewHostMsg_Are3DAPIsBlocked, OnAre3DAPIsBlocked) |
468 IPC_MESSAGE_HANDLER(ViewHostMsg_DidLose3DContext, OnDidLose3DContext) | 467 IPC_MESSAGE_HANDLER(ViewHostMsg_DidLose3DContext, OnDidLose3DContext) |
469 #if defined(OS_ANDROID) | 468 #if defined(OS_ANDROID) |
470 IPC_MESSAGE_HANDLER(ViewHostMsg_RunWebAudioMediaCodec, OnWebAudioMediaCodec) | 469 IPC_MESSAGE_HANDLER(ViewHostMsg_RunWebAudioMediaCodec, OnWebAudioMediaCodec) |
471 #endif | 470 #endif |
472 IPC_MESSAGE_UNHANDLED(handled = false) | 471 IPC_MESSAGE_UNHANDLED(handled = false) |
473 IPC_END_MESSAGE_MAP_EX() | 472 IPC_END_MESSAGE_MAP() |
474 | 473 |
475 return handled; | 474 return handled; |
476 } | 475 } |
477 | 476 |
478 void RenderMessageFilter::OnDestruct() const { | 477 void RenderMessageFilter::OnDestruct() const { |
479 BrowserThread::DeleteOnIOThread::Destruct(this); | 478 BrowserThread::DeleteOnIOThread::Destruct(this); |
480 } | 479 } |
481 | 480 |
482 base::TaskRunner* RenderMessageFilter::OverrideTaskRunnerForMessage( | 481 base::TaskRunner* RenderMessageFilter::OverrideTaskRunnerForMessage( |
483 const IPC::Message& message) { | 482 const IPC::Message& message) { |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 return; | 1318 return; |
1320 } | 1319 } |
1321 } | 1320 } |
1322 #endif | 1321 #endif |
1323 | 1322 |
1324 GpuMemoryBufferImpl::AllocateForChildProcess( | 1323 GpuMemoryBufferImpl::AllocateForChildProcess( |
1325 gfx::Size(width, height), internalformat, usage, PeerHandle(), handle); | 1324 gfx::Size(width, height), internalformat, usage, PeerHandle(), handle); |
1326 } | 1325 } |
1327 | 1326 |
1328 } // namespace content | 1327 } // namespace content |
OLD | NEW |