OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 #if defined(OS_WIN) | 178 #if defined(OS_WIN) |
179 #include "base/win/scoped_com_initializer.h" | 179 #include "base/win/scoped_com_initializer.h" |
180 #include "base/win/windows_version.h" | 180 #include "base/win/windows_version.h" |
181 #include "content/common/font_cache_dispatcher_win.h" | 181 #include "content/common/font_cache_dispatcher_win.h" |
182 #include "content/common/sandbox_win.h" | 182 #include "content/common/sandbox_win.h" |
183 #include "sandbox/win/src/sandbox_policy.h" | 183 #include "sandbox/win/src/sandbox_policy.h" |
184 #include "ui/gfx/win/dpi.h" | 184 #include "ui/gfx/win/dpi.h" |
185 #endif | 185 #endif |
186 | 186 |
| 187 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 188 #include "content/browser/browser_io_surface_manager_mac.h" |
| 189 #endif |
| 190 |
187 #if defined(ENABLE_BROWSER_CDMS) | 191 #if defined(ENABLE_BROWSER_CDMS) |
188 #include "content/browser/media/cdm/browser_cdm_manager.h" | 192 #include "content/browser/media/cdm/browser_cdm_manager.h" |
189 #endif | 193 #endif |
190 | 194 |
191 #if defined(ENABLE_PLUGINS) | 195 #if defined(ENABLE_PLUGINS) |
192 #include "content/browser/plugin_service_impl.h" | 196 #include "content/browser/plugin_service_impl.h" |
193 #endif | 197 #endif |
194 | 198 |
195 #if defined(ENABLE_WEBRTC) | 199 #if defined(ENABLE_WEBRTC) |
196 #include "content/browser/media/webrtc_internals.h" | 200 #include "content/browser/media/webrtc_internals.h" |
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1554 | 1558 |
1555 void RenderProcessHostImpl::OnChannelConnected(int32 peer_pid) { | 1559 void RenderProcessHostImpl::OnChannelConnected(int32 peer_pid) { |
1556 #if defined(IPC_MESSAGE_LOG_ENABLED) | 1560 #if defined(IPC_MESSAGE_LOG_ENABLED) |
1557 Send(new ChildProcessMsg_SetIPCLoggingEnabled( | 1561 Send(new ChildProcessMsg_SetIPCLoggingEnabled( |
1558 IPC::Logging::GetInstance()->Enabled())); | 1562 IPC::Logging::GetInstance()->Enabled())); |
1559 #endif | 1563 #endif |
1560 | 1564 |
1561 tracked_objects::ThreadData::Status status = | 1565 tracked_objects::ThreadData::Status status = |
1562 tracked_objects::ThreadData::status(); | 1566 tracked_objects::ThreadData::status(); |
1563 Send(new ChildProcessMsg_SetProfilerStatus(status)); | 1567 Send(new ChildProcessMsg_SetProfilerStatus(status)); |
| 1568 |
| 1569 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 1570 io_surface_manager_token_ = |
| 1571 BrowserIOSurfaceManager::GetInstance()->GenerateChildProcessToken( |
| 1572 GetID()); |
| 1573 Send(new ChildProcessMsg_SetIOSurfaceManagerToken(io_surface_manager_token_)); |
| 1574 #endif |
1564 } | 1575 } |
1565 | 1576 |
1566 void RenderProcessHostImpl::OnChannelError() { | 1577 void RenderProcessHostImpl::OnChannelError() { |
1567 ProcessDied(true /* already_dead */, nullptr); | 1578 ProcessDied(true /* already_dead */, nullptr); |
1568 } | 1579 } |
1569 | 1580 |
1570 void RenderProcessHostImpl::OnBadMessageReceived(const IPC::Message& message) { | 1581 void RenderProcessHostImpl::OnBadMessageReceived(const IPC::Message& message) { |
1571 // Message de-serialization failed. We consider this a capital crime. Kill the | 1582 // Message de-serialization failed. We consider this a capital crime. Kill the |
1572 // renderer if we have one. | 1583 // renderer if we have one. |
1573 LOG(ERROR) << "bad message " << message.type() << " terminating renderer."; | 1584 LOG(ERROR) << "bad message " << message.type() << " terminating renderer."; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1671 #if defined(ENABLE_BROWSER_CDMS) | 1682 #if defined(ENABLE_BROWSER_CDMS) |
1672 browser_cdm_manager_ = NULL; | 1683 browser_cdm_manager_ = NULL; |
1673 #endif | 1684 #endif |
1674 | 1685 |
1675 RemoveUserData(kSessionStorageHolderKey); | 1686 RemoveUserData(kSessionStorageHolderKey); |
1676 | 1687 |
1677 // Remove ourself from the list of renderer processes so that we can't be | 1688 // Remove ourself from the list of renderer processes so that we can't be |
1678 // reused in between now and when the Delete task runs. | 1689 // reused in between now and when the Delete task runs. |
1679 UnregisterHost(GetID()); | 1690 UnregisterHost(GetID()); |
1680 } | 1691 } |
| 1692 |
| 1693 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 1694 if (!io_surface_manager_token_.IsZero()) { |
| 1695 BrowserIOSurfaceManager::GetInstance()->InvalidateChildProcessToken( |
| 1696 io_surface_manager_token_); |
| 1697 io_surface_manager_token_.SetZero(); |
| 1698 } |
| 1699 #endif |
1681 } | 1700 } |
1682 | 1701 |
1683 void RenderProcessHostImpl::AddPendingView() { | 1702 void RenderProcessHostImpl::AddPendingView() { |
1684 pending_views_++; | 1703 pending_views_++; |
1685 } | 1704 } |
1686 | 1705 |
1687 void RenderProcessHostImpl::RemovePendingView() { | 1706 void RenderProcessHostImpl::RemovePendingView() { |
1688 DCHECK(pending_views_); | 1707 DCHECK(pending_views_); |
1689 pending_views_--; | 1708 pending_views_--; |
1690 } | 1709 } |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2481 void RenderProcessHostImpl::GetAudioOutputControllers( | 2500 void RenderProcessHostImpl::GetAudioOutputControllers( |
2482 const GetAudioOutputControllersCallback& callback) const { | 2501 const GetAudioOutputControllersCallback& callback) const { |
2483 audio_renderer_host()->GetOutputControllers(callback); | 2502 audio_renderer_host()->GetOutputControllers(callback); |
2484 } | 2503 } |
2485 | 2504 |
2486 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2505 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2487 return bluetooth_dispatcher_host_.get(); | 2506 return bluetooth_dispatcher_host_.get(); |
2488 } | 2507 } |
2489 | 2508 |
2490 } // namespace content | 2509 } // namespace content |
OLD | NEW |