| 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 #if defined(ENABLE_WEBRTC) | 199 #if defined(ENABLE_WEBRTC) |
| 200 // Creates a file used for diagnostic echo canceller recordings for handing | 200 // Creates a file used for diagnostic echo canceller recordings for handing |
| 201 // over to the renderer. | 201 // over to the renderer. |
| 202 IPC::PlatformFileForTransit CreateAecDumpFileForProcess( | 202 IPC::PlatformFileForTransit CreateAecDumpFileForProcess( |
| 203 base::FilePath file_path, | 203 base::FilePath file_path, |
| 204 base::ProcessHandle process) { | 204 base::ProcessHandle process) { |
| 205 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 205 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 206 base::PlatformFileError error = base::PLATFORM_FILE_OK; | 206 base::PlatformFileError error = base::PLATFORM_FILE_OK; |
| 207 base::PlatformFile aec_dump_file = base::CreatePlatformFile( | 207 base::PlatformFile aec_dump_file = base::CreatePlatformFile( |
| 208 file_path, | 208 file_path, |
| 209 base::PLATFORM_FILE_CREATE_ALWAYS | base::PLATFORM_FILE_WRITE, | 209 base::PLATFORM_FILE_OPEN_ALWAYS | base::PLATFORM_FILE_APPEND, |
| 210 NULL, | 210 NULL, |
| 211 &error); | 211 &error); |
| 212 if (error != base::PLATFORM_FILE_OK) { | 212 if (error != base::PLATFORM_FILE_OK) { |
| 213 VLOG(1) << "Could not open AEC dump file, error=" << error; | 213 VLOG(1) << "Could not open AEC dump file, error=" << error; |
| 214 return IPC::InvalidPlatformFileForTransit(); | 214 return IPC::InvalidPlatformFileForTransit(); |
| 215 } | 215 } |
| 216 return IPC::GetFileHandleForProcess(aec_dump_file, process, true); | 216 return IPC::GetFileHandleForProcess(aec_dump_file, process, true); |
| 217 } | 217 } |
| 218 | 218 |
| 219 // Does nothing. Just to avoid races between enable and disable. | 219 // Does nothing. Just to avoid races between enable and disable. |
| 220 void DisableAecDumpOnFileThread() { | 220 void DisableAecDumpOnFileThread() { |
| 221 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 221 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 222 } | 222 } |
| 223 | |
| 224 #endif | 223 #endif |
| 225 | 224 |
| 226 // the global list of all renderer processes | 225 // the global list of all renderer processes |
| 227 base::LazyInstance<IDMap<RenderProcessHost> >::Leaky | 226 base::LazyInstance<IDMap<RenderProcessHost> >::Leaky |
| 228 g_all_hosts = LAZY_INSTANCE_INITIALIZER; | 227 g_all_hosts = LAZY_INSTANCE_INITIALIZER; |
| 229 | 228 |
| 230 base::LazyInstance<scoped_refptr<BrowserPluginGeolocationPermissionContext> > | 229 base::LazyInstance<scoped_refptr<BrowserPluginGeolocationPermissionContext> > |
| 231 g_browser_plugin_geolocation_context = LAZY_INSTANCE_INITIALIZER; | 230 g_browser_plugin_geolocation_context = LAZY_INSTANCE_INITIALIZER; |
| 232 | 231 |
| 233 // Map of site to process, to ensure we only have one RenderProcessHost per | 232 // Map of site to process, to ensure we only have one RenderProcessHost per |
| (...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2075 return; | 2074 return; |
| 2076 Send(new MediaStreamMsg_EnableAecDump(file_for_transit)); | 2075 Send(new MediaStreamMsg_EnableAecDump(file_for_transit)); |
| 2077 } | 2076 } |
| 2078 | 2077 |
| 2079 void RenderProcessHostImpl::SendDisableAecDumpToRenderer() { | 2078 void RenderProcessHostImpl::SendDisableAecDumpToRenderer() { |
| 2080 Send(new MediaStreamMsg_DisableAecDump()); | 2079 Send(new MediaStreamMsg_DisableAecDump()); |
| 2081 } | 2080 } |
| 2082 #endif | 2081 #endif |
| 2083 | 2082 |
| 2084 } // namespace content | 2083 } // namespace content |
| OLD | NEW |