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

Side by Side Diff: content/browser/loader/wake_lock_resource_throttle.h

Issue 2921823002: Rationalize WakeLock naming conventions (Closed)
Patch Set: rebase Created 3 years, 6 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #ifndef CONTENT_BROWSER_LOADER_WAKE_LOCK_RESOURCE_THROTTLE_H_ 5 #ifndef CONTENT_BROWSER_LOADER_WAKE_LOCK_RESOURCE_THROTTLE_H_
6 #define CONTENT_BROWSER_LOADER_WAKE_LOCK_RESOURCE_THROTTLE_H_ 6 #define CONTENT_BROWSER_LOADER_WAKE_LOCK_RESOURCE_THROTTLE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/timer/timer.h" 13 #include "base/timer/timer.h"
14 #include "content/public/browser/resource_throttle.h" 14 #include "content/public/browser/resource_throttle.h"
15 #include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h" 15 #include "device/wake_lock/public/interfaces/wake_lock.mojom.h"
16 16
17 namespace content { 17 namespace content {
18 18
19 // This ResourceThrottle holds wake lock until large upload request finishes. 19 // This ResourceThrottle holds wake lock until large upload request finishes.
20 class WakeLockResourceThrottle : public ResourceThrottle { 20 class WakeLockResourceThrottle : public ResourceThrottle {
21 public: 21 public:
22 WakeLockResourceThrottle(const std::string& host); 22 WakeLockResourceThrottle(const std::string& host);
23 ~WakeLockResourceThrottle() override; 23 ~WakeLockResourceThrottle() override;
24 24
25 // ResourceThrottle overrides: 25 // ResourceThrottle overrides:
26 void WillStartRequest(bool* defer) override; 26 void WillStartRequest(bool* defer) override;
27 void WillProcessResponse(bool* defer) override; 27 void WillProcessResponse(bool* defer) override;
28 const char* GetNameForLogging() const override; 28 const char* GetNameForLogging() const override;
29 29
30 private: 30 private:
31 void RequestWakeLock(); 31 void RequestWakeLock();
32 32
33 const std::string host_; 33 const std::string host_;
34 base::OneShotTimer timer_; 34 base::OneShotTimer timer_;
35 35
36 // Destruction of wake_lock_ will trigger 36 // Destruction of wake_lock_ will trigger
37 // WakeLockServicImpl::OnConnectionError on the service side, so there is no 37 // WakeLock::OnConnectionError on the service side, so there is no
38 // need to call CancelWakeLock() in the destructor. 38 // need to call CancelWakeLock() in the destructor.
39 device::mojom::WakeLockServicePtr wake_lock_; 39 device::mojom::WakeLockPtr wake_lock_;
40 40
41 DISALLOW_COPY_AND_ASSIGN(WakeLockResourceThrottle); 41 DISALLOW_COPY_AND_ASSIGN(WakeLockResourceThrottle);
42 }; 42 };
43 43
44 } // namespace content 44 } // namespace content
45 45
46 #endif // CONTENT_BROWSER_LOADER_WAKE_LOCK_RESOURCE_THROTTLE_H_ 46 #endif // CONTENT_BROWSER_LOADER_WAKE_LOCK_RESOURCE_THROTTLE_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/media/capture/aura_window_capture_machine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698