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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 #include "base/win/scoped_com_initializer.h" | 188 #include "base/win/scoped_com_initializer.h" |
189 #include "base/win/windows_version.h" | 189 #include "base/win/windows_version.h" |
190 #include "content/common/font_cache_dispatcher_win.h" | 190 #include "content/common/font_cache_dispatcher_win.h" |
191 #include "content/common/sandbox_win.h" | 191 #include "content/common/sandbox_win.h" |
192 #include "sandbox/win/src/sandbox_policy.h" | 192 #include "sandbox/win/src/sandbox_policy.h" |
193 #include "ui/gfx/win/dpi.h" | 193 #include "ui/gfx/win/dpi.h" |
194 #endif | 194 #endif |
195 | 195 |
196 #if defined(OS_MACOSX) && !defined(OS_IOS) | 196 #if defined(OS_MACOSX) && !defined(OS_IOS) |
197 #include "content/browser/bootstrap_sandbox_manager_mac.h" | 197 #include "content/browser/bootstrap_sandbox_manager_mac.h" |
198 #include "content/browser/browser_io_surface_manager_mac.h" | |
199 #include "content/browser/mach_broker_mac.h" | 198 #include "content/browser/mach_broker_mac.h" |
200 #endif | 199 #endif |
201 | 200 |
202 #if defined(USE_OZONE) | 201 #if defined(USE_OZONE) |
203 #include "ui/ozone/public/client_native_pixmap_factory.h" | 202 #include "ui/ozone/public/client_native_pixmap_factory.h" |
204 #include "ui/ozone/public/ozone_platform.h" | 203 #include "ui/ozone/public/ozone_platform.h" |
205 #include "ui/ozone/public/ozone_switches.h" | 204 #include "ui/ozone/public/ozone_switches.h" |
206 #endif | 205 #endif |
207 | 206 |
208 #if defined(ENABLE_BROWSER_CDMS) | 207 #if defined(ENABLE_BROWSER_CDMS) |
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 // the current MessageLoop, but MessageLoop deletes all its pending | 1874 // the current MessageLoop, but MessageLoop deletes all its pending |
1876 // callbacks on shutdown. Since the deleter takes |this| as a raw pointer, | 1875 // callbacks on shutdown. Since the deleter takes |this| as a raw pointer, |
1877 // deleting the callback doesn't delete |this| resulting in a memory leak. | 1876 // deleting the callback doesn't delete |this| resulting in a memory leak. |
1878 // Valgrind complains, so delete |mojo_application_host_| explicitly here to | 1877 // Valgrind complains, so delete |mojo_application_host_| explicitly here to |
1879 // stop valgrind from complaining. | 1878 // stop valgrind from complaining. |
1880 mojo_application_host_.reset(); | 1879 mojo_application_host_.reset(); |
1881 | 1880 |
1882 // Remove ourself from the list of renderer processes so that we can't be | 1881 // Remove ourself from the list of renderer processes so that we can't be |
1883 // reused in between now and when the Delete task runs. | 1882 // reused in between now and when the Delete task runs. |
1884 UnregisterHost(GetID()); | 1883 UnregisterHost(GetID()); |
1885 | |
1886 #if defined(OS_MACOSX) && !defined(OS_IOS) | |
1887 if (!io_surface_manager_token_.IsZero()) { | |
1888 BrowserIOSurfaceManager::GetInstance()->InvalidateChildProcessToken( | |
1889 io_surface_manager_token_); | |
1890 io_surface_manager_token_.SetZero(); | |
1891 } | |
1892 #endif | |
1893 } | 1884 } |
1894 } | 1885 } |
1895 | 1886 |
1896 void RenderProcessHostImpl::AddPendingView() { | 1887 void RenderProcessHostImpl::AddPendingView() { |
1897 pending_views_++; | 1888 pending_views_++; |
1898 } | 1889 } |
1899 | 1890 |
1900 void RenderProcessHostImpl::RemovePendingView() { | 1891 void RenderProcessHostImpl::RemovePendingView() { |
1901 DCHECK(pending_views_); | 1892 DCHECK(pending_views_); |
1902 pending_views_--; | 1893 pending_views_--; |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2467 | 2458 |
2468 // Not all platforms launch processes in the same backgrounded state. Make | 2459 // Not all platforms launch processes in the same backgrounded state. Make |
2469 // sure |is_process_backgrounded_| reflects this platform's initial process | 2460 // sure |is_process_backgrounded_| reflects this platform's initial process |
2470 // state. | 2461 // state. |
2471 is_process_backgrounded_ = | 2462 is_process_backgrounded_ = |
2472 child_process_launcher_->GetProcess().IsProcessBackgrounded(); | 2463 child_process_launcher_->GetProcess().IsProcessBackgrounded(); |
2473 | 2464 |
2474 UpdateProcessPriority(); | 2465 UpdateProcessPriority(); |
2475 } | 2466 } |
2476 | 2467 |
2477 #if defined(OS_MACOSX) && !defined(OS_IOS) | |
2478 io_surface_manager_token_ = | |
2479 BrowserIOSurfaceManager::GetInstance()->GenerateChildProcessToken( | |
2480 GetID()); | |
2481 Send(new ChildProcessMsg_SetIOSurfaceManagerToken(io_surface_manager_token_)); | |
2482 #endif | |
2483 | |
2484 // NOTE: This needs to be before sending queued messages because | 2468 // NOTE: This needs to be before sending queued messages because |
2485 // ExtensionService uses this notification to initialize the renderer process | 2469 // ExtensionService uses this notification to initialize the renderer process |
2486 // with state that must be there before any JavaScript executes. | 2470 // with state that must be there before any JavaScript executes. |
2487 // | 2471 // |
2488 // The queued messages contain such things as "navigate". If this notification | 2472 // The queued messages contain such things as "navigate". If this notification |
2489 // was after, we can end up executing JavaScript before the initialization | 2473 // was after, we can end up executing JavaScript before the initialization |
2490 // happens. | 2474 // happens. |
2491 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, | 2475 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, |
2492 Source<RenderProcessHost>(this), | 2476 Source<RenderProcessHost>(this), |
2493 NotificationService::NoDetails()); | 2477 NotificationService::NoDetails()); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2665 void RenderProcessHostImpl::GetAudioOutputControllers( | 2649 void RenderProcessHostImpl::GetAudioOutputControllers( |
2666 const GetAudioOutputControllersCallback& callback) const { | 2650 const GetAudioOutputControllersCallback& callback) const { |
2667 audio_renderer_host()->GetOutputControllers(callback); | 2651 audio_renderer_host()->GetOutputControllers(callback); |
2668 } | 2652 } |
2669 | 2653 |
2670 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2654 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2671 return bluetooth_dispatcher_host_.get(); | 2655 return bluetooth_dispatcher_host_.get(); |
2672 } | 2656 } |
2673 | 2657 |
2674 } // namespace content | 2658 } // namespace content |
OLD | NEW |