| OLD | NEW |
| 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/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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateSharedMemory, | 349 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateSharedMemory, |
| 350 OnAllocateSharedMemory) | 350 OnAllocateSharedMemory) |
| 351 #if defined(OS_MACOSX) | 351 #if defined(OS_MACOSX) |
| 352 IPC_MESSAGE_HANDLER(ViewHostMsg_AllocTransportDIB, OnAllocTransportDIB) | 352 IPC_MESSAGE_HANDLER(ViewHostMsg_AllocTransportDIB, OnAllocTransportDIB) |
| 353 IPC_MESSAGE_HANDLER(ViewHostMsg_FreeTransportDIB, OnFreeTransportDIB) | 353 IPC_MESSAGE_HANDLER(ViewHostMsg_FreeTransportDIB, OnFreeTransportDIB) |
| 354 #endif | 354 #endif |
| 355 IPC_MESSAGE_HANDLER(ViewHostMsg_DidGenerateCacheableMetadata, | 355 IPC_MESSAGE_HANDLER(ViewHostMsg_DidGenerateCacheableMetadata, |
| 356 OnCacheableMetadataAvailable) | 356 OnCacheableMetadataAvailable) |
| 357 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_Keygen, OnKeygen) | 357 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_Keygen, OnKeygen) |
| 358 IPC_MESSAGE_HANDLER(ViewHostMsg_AsyncOpenFile, OnAsyncOpenFile) | 358 IPC_MESSAGE_HANDLER(ViewHostMsg_AsyncOpenFile, OnAsyncOpenFile) |
| 359 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareBufferSize, |
| 360 OnGetHardwareBufferSize) |
| 359 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputSampleRate, | 361 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputSampleRate, |
| 360 OnGetHardwareInputSampleRate) | 362 OnGetHardwareInputSampleRate) |
| 361 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareSampleRate, | 363 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareSampleRate, |
| 362 OnGetHardwareSampleRate) | 364 OnGetHardwareSampleRate) |
| 363 IPC_MESSAGE_HANDLER(ViewHostMsg_MediaLogEvent, OnMediaLogEvent) | 365 IPC_MESSAGE_HANDLER(ViewHostMsg_MediaLogEvent, OnMediaLogEvent) |
| 364 IPC_MESSAGE_UNHANDLED(handled = false) | 366 IPC_MESSAGE_UNHANDLED(handled = false) |
| 365 IPC_END_MESSAGE_MAP_EX() | 367 IPC_END_MESSAGE_MAP_EX() |
| 366 | 368 |
| 367 return handled; | 369 return handled; |
| 368 } | 370 } |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 int request_id, | 601 int request_id, |
| 600 const FilePath& path) { | 602 const FilePath& path) { |
| 601 plugin_service_->OpenChannelToPpapiBroker( | 603 plugin_service_->OpenChannelToPpapiBroker( |
| 602 path, new OpenChannelToPpapiBrokerCallback(this, routing_id, request_id)); | 604 path, new OpenChannelToPpapiBrokerCallback(this, routing_id, request_id)); |
| 603 } | 605 } |
| 604 | 606 |
| 605 void RenderMessageFilter::OnGenerateRoutingID(int* route_id) { | 607 void RenderMessageFilter::OnGenerateRoutingID(int* route_id) { |
| 606 *route_id = render_widget_helper_->GetNextRoutingID(); | 608 *route_id = render_widget_helper_->GetNextRoutingID(); |
| 607 } | 609 } |
| 608 | 610 |
| 611 void RenderMessageFilter::OnGetHardwareBufferSize(size_t* buffer_size) { |
| 612 *buffer_size = media::GetAudioHardwareBufferSize(); |
| 613 } |
| 614 |
| 609 void RenderMessageFilter::OnGetHardwareInputSampleRate(double* sample_rate) { | 615 void RenderMessageFilter::OnGetHardwareInputSampleRate(double* sample_rate) { |
| 610 *sample_rate = media::GetAudioInputHardwareSampleRate(); | 616 *sample_rate = media::GetAudioInputHardwareSampleRate(); |
| 611 } | 617 } |
| 612 | 618 |
| 613 void RenderMessageFilter::OnGetHardwareSampleRate(double* sample_rate) { | 619 void RenderMessageFilter::OnGetHardwareSampleRate(double* sample_rate) { |
| 614 *sample_rate = media::GetAudioHardwareSampleRate(); | 620 *sample_rate = media::GetAudioHardwareSampleRate(); |
| 615 } | 621 } |
| 616 | 622 |
| 617 void RenderMessageFilter::OnDownloadUrl(const IPC::Message& message, | 623 void RenderMessageFilter::OnDownloadUrl(const IPC::Message& message, |
| 618 const GURL& url, | 624 const GURL& url, |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 ViewHostMsg_GetRawCookies::WriteReplyParams(reply_msg, cookies); | 848 ViewHostMsg_GetRawCookies::WriteReplyParams(reply_msg, cookies); |
| 843 Send(reply_msg); | 849 Send(reply_msg); |
| 844 } | 850 } |
| 845 | 851 |
| 846 void RenderMessageFilter::OnCompletedOpenChannelToNpapiPlugin( | 852 void RenderMessageFilter::OnCompletedOpenChannelToNpapiPlugin( |
| 847 OpenChannelToNpapiPluginCallback* client) { | 853 OpenChannelToNpapiPluginCallback* client) { |
| 848 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 854 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 849 DCHECK(ContainsKey(plugin_host_clients_, client)); | 855 DCHECK(ContainsKey(plugin_host_clients_, client)); |
| 850 plugin_host_clients_.erase(client); | 856 plugin_host_clients_.erase(client); |
| 851 } | 857 } |
| OLD | NEW |