Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1107333002: Wake Lock API implementation (Chromium part) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 23 matching lines...) Expand all
34 #include "content/browser/permissions/permission_service_impl.h" 34 #include "content/browser/permissions/permission_service_impl.h"
35 #include "content/browser/presentation/presentation_service_impl.h" 35 #include "content/browser/presentation/presentation_service_impl.h"
36 #include "content/browser/renderer_host/input/input_router.h" 36 #include "content/browser/renderer_host/input/input_router.h"
37 #include "content/browser/renderer_host/input/timeout_monitor.h" 37 #include "content/browser/renderer_host/input/timeout_monitor.h"
38 #include "content/browser/renderer_host/render_process_host_impl.h" 38 #include "content/browser/renderer_host/render_process_host_impl.h"
39 #include "content/browser/renderer_host/render_view_host_delegate.h" 39 #include "content/browser/renderer_host/render_view_host_delegate.h"
40 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 40 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
41 #include "content/browser/renderer_host/render_view_host_impl.h" 41 #include "content/browser/renderer_host/render_view_host_impl.h"
42 #include "content/browser/renderer_host/render_widget_host_impl.h" 42 #include "content/browser/renderer_host/render_widget_host_impl.h"
43 #include "content/browser/renderer_host/render_widget_host_view_base.h" 43 #include "content/browser/renderer_host/render_widget_host_view_base.h"
44 #include "content/browser/wake_lock/wake_lock_service_context.h"
44 #include "content/common/accessibility_messages.h" 45 #include "content/common/accessibility_messages.h"
45 #include "content/common/frame_messages.h" 46 #include "content/common/frame_messages.h"
46 #include "content/common/input_messages.h" 47 #include "content/common/input_messages.h"
47 #include "content/common/inter_process_time_ticks_converter.h" 48 #include "content/common/inter_process_time_ticks_converter.h"
48 #include "content/common/navigation_params.h" 49 #include "content/common/navigation_params.h"
49 #include "content/common/render_frame_setup.mojom.h" 50 #include "content/common/render_frame_setup.mojom.h"
50 #include "content/common/site_isolation_policy.h" 51 #include "content/common/site_isolation_policy.h"
51 #include "content/common/swapped_out_messages.h" 52 #include "content/common/swapped_out_messages.h"
52 #include "content/public/browser/ax_event_notification_details.h" 53 #include "content/public/browser/ax_event_notification_details.h"
53 #include "content/public/browser/browser_accessibility_state.h" 54 #include "content/public/browser/browser_accessibility_state.h"
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 // TODO(creis): Bind process ID here so that GeolocationServiceImpl 1584 // TODO(creis): Bind process ID here so that GeolocationServiceImpl
1584 // can perform permissions checks once site isolation is complete. 1585 // can perform permissions checks once site isolation is complete.
1585 // crbug.com/426384 1586 // crbug.com/426384
1586 GetServiceRegistry()->AddService<GeolocationService>( 1587 GetServiceRegistry()->AddService<GeolocationService>(
1587 base::Bind(&GeolocationServiceContext::CreateService, 1588 base::Bind(&GeolocationServiceContext::CreateService,
1588 base::Unretained(geolocation_service_context), 1589 base::Unretained(geolocation_service_context),
1589 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, 1590 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission,
1590 base::Unretained(this)))); 1591 base::Unretained(this))));
1591 } 1592 }
1592 1593
1594 WakeLockServiceContext* wake_lock_service_context =
1595 delegate_ ? delegate_->GetWakeLockServiceContext() : nullptr;
1596 if (wake_lock_service_context) {
1597 // WakeLockServiceContext is owned by WebContentsImpl so it will outlive
1598 // this RenderFrameHostImpl, hence a raw pointer can be bound to service
1599 // factory callback.
1600 // WakeLockServiceContext uses RenderFrameHost pointers as opaque frame
1601 // identifiers and never dereferences them, so it is safe to pass raw
1602 // RenderFrameHost pointers. Additionally, WakeLockServiceContext observes
nasko 2015/09/03 17:53:37 This comment is good, but the intention doesn't se
alogvinov 2015/09/04 15:39:25 Switched to using FrameTreeNode ids.
1603 // frame removal so it doesn't keep stale frame pointers.
1604 GetServiceRegistry()->AddService<WakeLockService>(
1605 base::Bind(&WakeLockServiceContext::CreateService,
1606 base::Unretained(wake_lock_service_context),
1607 base::Unretained(this)));
1608 }
1609
1593 if (!permission_service_context_) 1610 if (!permission_service_context_)
1594 permission_service_context_.reset(new PermissionServiceContext(this)); 1611 permission_service_context_.reset(new PermissionServiceContext(this));
1595 1612
1596 GetServiceRegistry()->AddService<PermissionService>( 1613 GetServiceRegistry()->AddService<PermissionService>(
1597 base::Bind(&PermissionServiceContext::CreateService, 1614 base::Bind(&PermissionServiceContext::CreateService,
1598 base::Unretained(permission_service_context_.get()))); 1615 base::Unretained(permission_service_context_.get())));
1599 1616
1600 GetServiceRegistry()->AddService<presentation::PresentationService>( 1617 GetServiceRegistry()->AddService<presentation::PresentationService>(
1601 base::Bind(&PresentationServiceImpl::CreateMojoService, 1618 base::Bind(&PresentationServiceImpl::CreateMojoService,
1602 base::Unretained(this))); 1619 base::Unretained(this)));
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
2215 BrowserPluginInstanceIDToAXTreeID(value))); 2232 BrowserPluginInstanceIDToAXTreeID(value)));
2216 break; 2233 break;
2217 case AX_CONTENT_INT_ATTRIBUTE_LAST: 2234 case AX_CONTENT_INT_ATTRIBUTE_LAST:
2218 NOTREACHED(); 2235 NOTREACHED();
2219 break; 2236 break;
2220 } 2237 }
2221 } 2238 }
2222 } 2239 }
2223 2240
2224 } // namespace content 2241 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698