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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 #include "base/win/scoped_com_initializer.h" | 190 #include "base/win/scoped_com_initializer.h" |
191 #include "base/win/windows_version.h" | 191 #include "base/win/windows_version.h" |
192 #include "content/common/font_cache_dispatcher_win.h" | 192 #include "content/common/font_cache_dispatcher_win.h" |
193 #include "content/common/sandbox_win.h" | 193 #include "content/common/sandbox_win.h" |
194 #include "sandbox/win/src/sandbox_policy.h" | 194 #include "sandbox/win/src/sandbox_policy.h" |
195 #include "ui/gfx/win/dpi.h" | 195 #include "ui/gfx/win/dpi.h" |
196 #endif | 196 #endif |
197 | 197 |
198 #if defined(OS_MACOSX) && !defined(OS_IOS) | 198 #if defined(OS_MACOSX) && !defined(OS_IOS) |
199 #include "content/browser/bootstrap_sandbox_manager_mac.h" | 199 #include "content/browser/bootstrap_sandbox_manager_mac.h" |
200 #include "content/browser/browser_io_surface_manager_mac.h" | |
201 #include "content/browser/mach_broker_mac.h" | 200 #include "content/browser/mach_broker_mac.h" |
202 #endif | 201 #endif |
203 | 202 |
204 #if defined(USE_OZONE) | 203 #if defined(USE_OZONE) |
205 #include "ui/ozone/public/client_native_pixmap_factory.h" | 204 #include "ui/ozone/public/client_native_pixmap_factory.h" |
206 #include "ui/ozone/public/ozone_platform.h" | 205 #include "ui/ozone/public/ozone_platform.h" |
207 #include "ui/ozone/public/ozone_switches.h" | 206 #include "ui/ozone/public/ozone_switches.h" |
208 #endif | 207 #endif |
209 | 208 |
210 #if defined(ENABLE_BROWSER_CDMS) | 209 #if defined(ENABLE_BROWSER_CDMS) |
(...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 // the current MessageLoop, but MessageLoop deletes all its pending | 1879 // the current MessageLoop, but MessageLoop deletes all its pending |
1881 // callbacks on shutdown. Since the deleter takes |this| as a raw pointer, | 1880 // callbacks on shutdown. Since the deleter takes |this| as a raw pointer, |
1882 // deleting the callback doesn't delete |this| resulting in a memory leak. | 1881 // deleting the callback doesn't delete |this| resulting in a memory leak. |
1883 // Valgrind complains, so delete |mojo_application_host_| explicitly here to | 1882 // Valgrind complains, so delete |mojo_application_host_| explicitly here to |
1884 // stop valgrind from complaining. | 1883 // stop valgrind from complaining. |
1885 mojo_application_host_.reset(); | 1884 mojo_application_host_.reset(); |
1886 | 1885 |
1887 // Remove ourself from the list of renderer processes so that we can't be | 1886 // Remove ourself from the list of renderer processes so that we can't be |
1888 // reused in between now and when the Delete task runs. | 1887 // reused in between now and when the Delete task runs. |
1889 UnregisterHost(GetID()); | 1888 UnregisterHost(GetID()); |
1890 | |
1891 #if defined(OS_MACOSX) && !defined(OS_IOS) | |
1892 if (!io_surface_manager_token_.IsZero()) { | |
1893 BrowserIOSurfaceManager::GetInstance()->InvalidateChildProcessToken( | |
1894 io_surface_manager_token_); | |
1895 io_surface_manager_token_.SetZero(); | |
1896 } | |
1897 #endif | |
1898 } | 1889 } |
1899 } | 1890 } |
1900 | 1891 |
1901 void RenderProcessHostImpl::AddPendingView() { | 1892 void RenderProcessHostImpl::AddPendingView() { |
1902 pending_views_++; | 1893 pending_views_++; |
1903 } | 1894 } |
1904 | 1895 |
1905 void RenderProcessHostImpl::RemovePendingView() { | 1896 void RenderProcessHostImpl::RemovePendingView() { |
1906 DCHECK(pending_views_); | 1897 DCHECK(pending_views_); |
1907 pending_views_--; | 1898 pending_views_--; |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2494 | 2485 |
2495 // Not all platforms launch processes in the same backgrounded state. Make | 2486 // Not all platforms launch processes in the same backgrounded state. Make |
2496 // sure |is_process_backgrounded_| reflects this platform's initial process | 2487 // sure |is_process_backgrounded_| reflects this platform's initial process |
2497 // state. | 2488 // state. |
2498 is_process_backgrounded_ = | 2489 is_process_backgrounded_ = |
2499 child_process_launcher_->GetProcess().IsProcessBackgrounded(); | 2490 child_process_launcher_->GetProcess().IsProcessBackgrounded(); |
2500 | 2491 |
2501 UpdateProcessPriority(); | 2492 UpdateProcessPriority(); |
2502 } | 2493 } |
2503 | 2494 |
2504 #if defined(OS_MACOSX) && !defined(OS_IOS) | |
2505 io_surface_manager_token_ = | |
2506 BrowserIOSurfaceManager::GetInstance()->GenerateChildProcessToken( | |
2507 GetID()); | |
2508 Send(new ChildProcessMsg_SetIOSurfaceManagerToken(io_surface_manager_token_)); | |
2509 #endif | |
2510 | |
2511 // NOTE: This needs to be before sending queued messages because | 2495 // NOTE: This needs to be before sending queued messages because |
2512 // ExtensionService uses this notification to initialize the renderer process | 2496 // ExtensionService uses this notification to initialize the renderer process |
2513 // with state that must be there before any JavaScript executes. | 2497 // with state that must be there before any JavaScript executes. |
2514 // | 2498 // |
2515 // The queued messages contain such things as "navigate". If this notification | 2499 // The queued messages contain such things as "navigate". If this notification |
2516 // was after, we can end up executing JavaScript before the initialization | 2500 // was after, we can end up executing JavaScript before the initialization |
2517 // happens. | 2501 // happens. |
2518 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, | 2502 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, |
2519 Source<RenderProcessHost>(this), | 2503 Source<RenderProcessHost>(this), |
2520 NotificationService::NoDetails()); | 2504 NotificationService::NoDetails()); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2757 void RenderProcessHostImpl::GetAudioOutputControllers( | 2741 void RenderProcessHostImpl::GetAudioOutputControllers( |
2758 const GetAudioOutputControllersCallback& callback) const { | 2742 const GetAudioOutputControllersCallback& callback) const { |
2759 audio_renderer_host()->GetOutputControllers(callback); | 2743 audio_renderer_host()->GetOutputControllers(callback); |
2760 } | 2744 } |
2761 | 2745 |
2762 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2746 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2763 return bluetooth_dispatcher_host_.get(); | 2747 return bluetooth_dispatcher_host_.get(); |
2764 } | 2748 } |
2765 | 2749 |
2766 } // namespace content | 2750 } // namespace content |
OLD | NEW |