| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1826 if (geolocation_service_context) { | 1826 if (geolocation_service_context) { |
| 1827 // TODO(creis): Bind process ID here so that GeolocationServiceImpl | 1827 // TODO(creis): Bind process ID here so that GeolocationServiceImpl |
| 1828 // can perform permissions checks once site isolation is complete. | 1828 // can perform permissions checks once site isolation is complete. |
| 1829 // crbug.com/426384 | 1829 // crbug.com/426384 |
| 1830 // NOTE: At shutdown, there is no guaranteed ordering between destruction of | 1830 // NOTE: At shutdown, there is no guaranteed ordering between destruction of |
| 1831 // this object and destruction of any GeolocationServicesImpls created via | 1831 // this object and destruction of any GeolocationServicesImpls created via |
| 1832 // the below service registry, the reason being that the destruction of the | 1832 // the below service registry, the reason being that the destruction of the |
| 1833 // latter is triggered by receiving a message that the pipe was closed from | 1833 // latter is triggered by receiving a message that the pipe was closed from |
| 1834 // the renderer side. Hence, supply the reference to this object as a weak | 1834 // the renderer side. Hence, supply the reference to this object as a weak |
| 1835 // pointer. | 1835 // pointer. |
| 1836 GetServiceRegistry()->AddService<GeolocationService>( | 1836 GetServiceRegistry()->AddService( |
| 1837 base::Bind(&GeolocationServiceContext::CreateService, | 1837 base::Bind(&GeolocationServiceContext::CreateService, |
| 1838 base::Unretained(geolocation_service_context), | 1838 base::Unretained(geolocation_service_context), |
| 1839 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, | 1839 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, |
| 1840 weak_ptr_factory_.GetWeakPtr()))); | 1840 weak_ptr_factory_.GetWeakPtr()))); |
| 1841 } | 1841 } |
| 1842 | 1842 |
| 1843 WakeLockServiceContext* wake_lock_service_context = | 1843 WakeLockServiceContext* wake_lock_service_context = |
| 1844 delegate_ ? delegate_->GetWakeLockServiceContext() : nullptr; | 1844 delegate_ ? delegate_->GetWakeLockServiceContext() : nullptr; |
| 1845 if (wake_lock_service_context) { | 1845 if (wake_lock_service_context) { |
| 1846 // WakeLockServiceContext is owned by WebContentsImpl so it will outlive | 1846 // WakeLockServiceContext is owned by WebContentsImpl so it will outlive |
| 1847 // this RenderFrameHostImpl, hence a raw pointer can be bound to service | 1847 // this RenderFrameHostImpl, hence a raw pointer can be bound to service |
| 1848 // factory callback. | 1848 // factory callback. |
| 1849 GetServiceRegistry()->AddService<WakeLockService>( | 1849 GetServiceRegistry()->AddService<WakeLockService>( |
| 1850 base::Bind(&WakeLockServiceContext::CreateService, | 1850 base::Bind(&WakeLockServiceContext::CreateService, |
| 1851 base::Unretained(wake_lock_service_context), | 1851 base::Unretained(wake_lock_service_context), |
| 1852 GetProcess()->GetID(), GetRoutingID())); | 1852 GetProcess()->GetID(), GetRoutingID())); |
| 1853 } | 1853 } |
| 1854 | 1854 |
| 1855 if (!permission_service_context_) | 1855 if (!permission_service_context_) |
| 1856 permission_service_context_.reset(new PermissionServiceContext(this)); | 1856 permission_service_context_.reset(new PermissionServiceContext(this)); |
| 1857 | 1857 |
| 1858 GetServiceRegistry()->AddService<PermissionService>( | 1858 GetServiceRegistry()->AddService( |
| 1859 base::Bind(&PermissionServiceContext::CreateService, | 1859 base::Bind(&PermissionServiceContext::CreateService, |
| 1860 base::Unretained(permission_service_context_.get()))); | 1860 base::Unretained(permission_service_context_.get()))); |
| 1861 | 1861 |
| 1862 GetServiceRegistry()->AddService(base::Bind( | 1862 GetServiceRegistry()->AddService(base::Bind( |
| 1863 &PresentationServiceImpl::CreateMojoService, base::Unretained(this))); | 1863 &PresentationServiceImpl::CreateMojoService, base::Unretained(this))); |
| 1864 | 1864 |
| 1865 if (!frame_mojo_shell_) | 1865 if (!frame_mojo_shell_) |
| 1866 frame_mojo_shell_.reset(new FrameMojoShell(this)); | 1866 frame_mojo_shell_.reset(new FrameMojoShell(this)); |
| 1867 | 1867 |
| 1868 GetServiceRegistry()->AddService<mojo::shell::mojom::Connector>(base::Bind( | 1868 GetServiceRegistry()->AddService<mojo::shell::mojom::Connector>(base::Bind( |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2631 *dst = src; | 2631 *dst = src; |
| 2632 | 2632 |
| 2633 if (src.routing_id != -1) | 2633 if (src.routing_id != -1) |
| 2634 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2634 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
| 2635 | 2635 |
| 2636 if (src.parent_routing_id != -1) | 2636 if (src.parent_routing_id != -1) |
| 2637 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2637 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
| 2638 } | 2638 } |
| 2639 | 2639 |
| 2640 } // namespace content | 2640 } // namespace content |
| OLD | NEW |