Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2641 WebContentsImpl::GetGeolocationServiceContext() { | 2641 WebContentsImpl::GetGeolocationServiceContext() { |
| 2642 return geolocation_service_context_.get(); | 2642 return geolocation_service_context_.get(); |
| 2643 } | 2643 } |
| 2644 | 2644 |
| 2645 device::mojom::WakeLockContext* WebContentsImpl::GetWakeLockContext() { | 2645 device::mojom::WakeLockContext* WebContentsImpl::GetWakeLockContext() { |
| 2646 if (!wake_lock_context_host_) | 2646 if (!wake_lock_context_host_) |
| 2647 wake_lock_context_host_.reset(new WakeLockContextHost(this)); | 2647 wake_lock_context_host_.reset(new WakeLockContextHost(this)); |
| 2648 return wake_lock_context_host_->GetWakeLockContext(); | 2648 return wake_lock_context_host_->GetWakeLockContext(); |
| 2649 } | 2649 } |
| 2650 | 2650 |
| 2651 device::mojom::WakeLockService* WebContentsImpl::GetRendererWakeLock() { | 2651 device::mojom::WakeLock* WebContentsImpl::GetRendererWakeLock() { |
| 2652 // WebContents creates a long-lived connection to one WakeLockServiceImpl. | 2652 // WebContents creates a long-lived connection to one WakeLockServiceImpl. |
|
blundell
2017/06/05 11:48:10
nit: update naming in this comment. It would be a
juncai
2017/06/05 18:58:25
Done.
| |
| 2653 // All the frames' requests will be added into the BindingSet of | 2653 // All the frames' requests will be added into the BindingSet of |
| 2654 // WakeLockServiceImpl via this connection. | 2654 // WakeLockServiceImpl via this connection. |
| 2655 if (!renderer_wake_lock_) { | 2655 if (!renderer_wake_lock_) { |
| 2656 device::mojom::WakeLockContext* wake_lock_context = GetWakeLockContext(); | 2656 device::mojom::WakeLockContext* wake_lock_context = GetWakeLockContext(); |
| 2657 if (!wake_lock_context) { | 2657 if (!wake_lock_context) { |
| 2658 return nullptr; | 2658 return nullptr; |
| 2659 } | 2659 } |
| 2660 wake_lock_context->GetWakeLock( | 2660 wake_lock_context->GetWakeLock( |
| 2661 device::mojom::WakeLockType::PreventDisplaySleep, | 2661 device::mojom::WakeLockType::PreventDisplaySleep, |
| 2662 device::mojom::WakeLockReason::ReasonOther, "Wake Lock API", | 2662 device::mojom::WakeLockReason::ReasonOther, "Wake Lock API", |
| (...skipping 2991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5654 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5654 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
| 5655 if (!render_view_host) | 5655 if (!render_view_host) |
| 5656 continue; | 5656 continue; |
| 5657 render_view_host_set.insert(render_view_host); | 5657 render_view_host_set.insert(render_view_host); |
| 5658 } | 5658 } |
| 5659 for (RenderViewHost* render_view_host : render_view_host_set) | 5659 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5660 render_view_host->OnWebkitPreferencesChanged(); | 5660 render_view_host->OnWebkitPreferencesChanged(); |
| 5661 } | 5661 } |
| 5662 | 5662 |
| 5663 } // namespace content | 5663 } // namespace content |
| OLD | NEW |