| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_CONTEXT_H_ |
| 6 #define CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_CONTEXT_H_ | 6 #define CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class PowerSaveBlocker; | 21 class PowerSaveBlocker; |
| 22 class RenderFrameHost; | 22 class RenderFrameHost; |
| 23 class WebContents; | 23 class WebContents; |
| 24 | 24 |
| 25 class CONTENT_EXPORT WakeLockServiceContext : public WebContentsObserver { | 25 class CONTENT_EXPORT WakeLockServiceContext : public WebContentsObserver { |
| 26 public: | 26 public: |
| 27 explicit WakeLockServiceContext(WebContents* web_contents); | 27 explicit WakeLockServiceContext(WebContents* web_contents); |
| 28 ~WakeLockServiceContext() override; | 28 ~WakeLockServiceContext() override; |
| 29 | 29 |
| 30 // Creates a WakeLockServiceImpl that is strongly bound to |request|. | 30 // Creates a WakeLockServiceImpl that is strongly bound to |request|. |
| 31 void CreateService(int render_process_id, | 31 void CreateService( |
| 32 int render_frame_id, | 32 int render_process_id, |
| 33 mojo::InterfaceRequest<mojom::WakeLockService> request); | 33 int render_frame_id, |
| 34 mojo::InterfaceRequest<blink::mojom::WakeLockService> request); |
| 34 | 35 |
| 35 // WebContentsObserver implementation. | 36 // WebContentsObserver implementation. |
| 36 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; | 37 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; |
| 37 | 38 |
| 38 // Requests wake lock for RenderFrame identified by |render_process_id| and | 39 // Requests wake lock for RenderFrame identified by |render_process_id| and |
| 39 // |render_frame_id|. | 40 // |render_frame_id|. |
| 40 void RequestWakeLock(int render_process_id, int render_frame_id); | 41 void RequestWakeLock(int render_process_id, int render_frame_id); |
| 41 | 42 |
| 42 // Cancels wake lock request for RenderFrame identified by | 43 // Cancels wake lock request for RenderFrame identified by |
| 43 // |render_process_id| and |render_frame_id|. | 44 // |render_process_id| and |render_frame_id|. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 59 std::unique_ptr<PowerSaveBlocker> wake_lock_; | 60 std::unique_ptr<PowerSaveBlocker> wake_lock_; |
| 60 | 61 |
| 61 base::WeakPtrFactory<WakeLockServiceContext> weak_factory_; | 62 base::WeakPtrFactory<WakeLockServiceContext> weak_factory_; |
| 62 | 63 |
| 63 DISALLOW_COPY_AND_ASSIGN(WakeLockServiceContext); | 64 DISALLOW_COPY_AND_ASSIGN(WakeLockServiceContext); |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 } // namespace content | 67 } // namespace content |
| 67 | 68 |
| 68 #endif // CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_CONTEXT_H_ | 69 #endif // CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_CONTEXT_H_ |
| OLD | NEW |