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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 #if defined(OS_WIN) | 177 #if defined(OS_WIN) |
178 #include "base/win/scoped_com_initializer.h" | 178 #include "base/win/scoped_com_initializer.h" |
179 #include "base/win/windows_version.h" | 179 #include "base/win/windows_version.h" |
180 #include "content/common/font_cache_dispatcher_win.h" | 180 #include "content/common/font_cache_dispatcher_win.h" |
181 #include "content/common/sandbox_win.h" | 181 #include "content/common/sandbox_win.h" |
182 #include "sandbox/win/src/sandbox_policy.h" | 182 #include "sandbox/win/src/sandbox_policy.h" |
183 #include "ui/gfx/win/dpi.h" | 183 #include "ui/gfx/win/dpi.h" |
184 #endif | 184 #endif |
185 | 185 |
| 186 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 187 #include "content/browser/browser_io_surface_manager_mac.h" |
| 188 #endif |
| 189 |
186 #if defined(ENABLE_BROWSER_CDMS) | 190 #if defined(ENABLE_BROWSER_CDMS) |
187 #include "content/browser/media/cdm/browser_cdm_manager.h" | 191 #include "content/browser/media/cdm/browser_cdm_manager.h" |
188 #endif | 192 #endif |
189 | 193 |
190 #if defined(ENABLE_PLUGINS) | 194 #if defined(ENABLE_PLUGINS) |
191 #include "content/browser/plugin_service_impl.h" | 195 #include "content/browser/plugin_service_impl.h" |
192 #endif | 196 #endif |
193 | 197 |
194 #if defined(ENABLE_WEBRTC) | 198 #if defined(ENABLE_WEBRTC) |
195 #include "content/browser/media/webrtc_internals.h" | 199 #include "content/browser/media/webrtc_internals.h" |
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 | 1547 |
1544 void RenderProcessHostImpl::OnChannelConnected(int32 peer_pid) { | 1548 void RenderProcessHostImpl::OnChannelConnected(int32 peer_pid) { |
1545 #if defined(IPC_MESSAGE_LOG_ENABLED) | 1549 #if defined(IPC_MESSAGE_LOG_ENABLED) |
1546 Send(new ChildProcessMsg_SetIPCLoggingEnabled( | 1550 Send(new ChildProcessMsg_SetIPCLoggingEnabled( |
1547 IPC::Logging::GetInstance()->Enabled())); | 1551 IPC::Logging::GetInstance()->Enabled())); |
1548 #endif | 1552 #endif |
1549 | 1553 |
1550 tracked_objects::ThreadData::Status status = | 1554 tracked_objects::ThreadData::Status status = |
1551 tracked_objects::ThreadData::status(); | 1555 tracked_objects::ThreadData::status(); |
1552 Send(new ChildProcessMsg_SetProfilerStatus(status)); | 1556 Send(new ChildProcessMsg_SetProfilerStatus(status)); |
| 1557 |
| 1558 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 1559 io_surface_manager_mailbox_ = |
| 1560 BrowserIOSurfaceManager::GetInstance()->GenerateChildProcessMailbox( |
| 1561 GetID()); |
| 1562 Send(new ChildProcessMsg_SetIOSurfaceManagerMailbox( |
| 1563 io_surface_manager_mailbox_)); |
| 1564 #endif |
1553 } | 1565 } |
1554 | 1566 |
1555 void RenderProcessHostImpl::OnChannelError() { | 1567 void RenderProcessHostImpl::OnChannelError() { |
1556 ProcessDied(true /* already_dead */, nullptr); | 1568 ProcessDied(true /* already_dead */, nullptr); |
1557 } | 1569 } |
1558 | 1570 |
1559 void RenderProcessHostImpl::OnBadMessageReceived(const IPC::Message& message) { | 1571 void RenderProcessHostImpl::OnBadMessageReceived(const IPC::Message& message) { |
1560 // Message de-serialization failed. We consider this a capital crime. Kill the | 1572 // Message de-serialization failed. We consider this a capital crime. Kill the |
1561 // renderer if we have one. | 1573 // renderer if we have one. |
1562 LOG(ERROR) << "bad message " << message.type() << " terminating renderer."; | 1574 LOG(ERROR) << "bad message " << message.type() << " terminating renderer."; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 #if defined(ENABLE_BROWSER_CDMS) | 1672 #if defined(ENABLE_BROWSER_CDMS) |
1661 browser_cdm_manager_ = NULL; | 1673 browser_cdm_manager_ = NULL; |
1662 #endif | 1674 #endif |
1663 | 1675 |
1664 RemoveUserData(kSessionStorageHolderKey); | 1676 RemoveUserData(kSessionStorageHolderKey); |
1665 | 1677 |
1666 // Remove ourself from the list of renderer processes so that we can't be | 1678 // Remove ourself from the list of renderer processes so that we can't be |
1667 // reused in between now and when the Delete task runs. | 1679 // reused in between now and when the Delete task runs. |
1668 UnregisterHost(GetID()); | 1680 UnregisterHost(GetID()); |
1669 } | 1681 } |
| 1682 |
| 1683 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 1684 if (!io_surface_manager_mailbox_.IsZero()) { |
| 1685 BrowserIOSurfaceManager::GetInstance()->InvalidateChildProcessMailbox( |
| 1686 io_surface_manager_mailbox_); |
| 1687 } |
| 1688 #endif |
1670 } | 1689 } |
1671 | 1690 |
1672 void RenderProcessHostImpl::AddPendingView() { | 1691 void RenderProcessHostImpl::AddPendingView() { |
1673 pending_views_++; | 1692 pending_views_++; |
1674 } | 1693 } |
1675 | 1694 |
1676 void RenderProcessHostImpl::RemovePendingView() { | 1695 void RenderProcessHostImpl::RemovePendingView() { |
1677 DCHECK(pending_views_); | 1696 DCHECK(pending_views_); |
1678 pending_views_--; | 1697 pending_views_--; |
1679 } | 1698 } |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2454 if (worker_ref_count_ == 0) | 2473 if (worker_ref_count_ == 0) |
2455 Cleanup(); | 2474 Cleanup(); |
2456 } | 2475 } |
2457 | 2476 |
2458 void RenderProcessHostImpl::GetAudioOutputControllers( | 2477 void RenderProcessHostImpl::GetAudioOutputControllers( |
2459 const GetAudioOutputControllersCallback& callback) const { | 2478 const GetAudioOutputControllersCallback& callback) const { |
2460 audio_renderer_host()->GetOutputControllers(callback); | 2479 audio_renderer_host()->GetOutputControllers(callback); |
2461 } | 2480 } |
2462 | 2481 |
2463 } // namespace content | 2482 } // namespace content |
OLD | NEW |