| OLD | NEW |
| 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_POWER_SAVE_BLOCK_RESOURCE_THROTTLE_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_POWER_SAVE_BLOCK_RESOURCE_THROTTLE_H_ |
| 6 #define CONTENT_BROWSER_LOADER_POWER_SAVE_BLOCK_RESOURCE_THROTTLE_H_ | 6 #define CONTENT_BROWSER_LOADER_POWER_SAVE_BLOCK_RESOURCE_THROTTLE_H_ |
| 7 | 7 |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 13 #include "content/public/browser/resource_throttle.h" | 11 #include "content/public/browser/resource_throttle.h" |
| 14 | 12 |
| 15 namespace content { | 13 namespace content { |
| 16 | 14 |
| 17 class PowerSaveBlocker; | 15 // This ResourceThrottle blocks power save until large upload request finishes. |
| 18 | |
| 19 // This ResourceThrottle blocks power save until request finishes. | |
| 20 class PowerSaveBlockResourceThrottle : public ResourceThrottle { | 16 class PowerSaveBlockResourceThrottle : public ResourceThrottle { |
| 21 public: | 17 public: |
| 22 explicit PowerSaveBlockResourceThrottle(const std::string& reason); | 18 PowerSaveBlockResourceThrottle(); |
| 23 virtual ~PowerSaveBlockResourceThrottle(); | 19 virtual ~PowerSaveBlockResourceThrottle(); |
| 24 | 20 |
| 25 // ResourceThrottle override. | 21 // ResourceThrottle overrides: |
| 22 virtual void WillStartRequest(bool* defer) OVERRIDE; |
| 26 virtual void WillProcessResponse(bool* defer) OVERRIDE; | 23 virtual void WillProcessResponse(bool* defer) OVERRIDE; |
| 27 | 24 |
| 28 private: | 25 private: |
| 29 scoped_ptr<PowerSaveBlocker> power_save_blocker_; | 26 // A class responsible to control power save block. |
| 27 class PowerSaveBlockerOwner; |
| 28 |
| 29 scoped_ptr<PowerSaveBlockerOwner> power_save_blocker_owner_; |
| 30 | 30 |
| 31 DISALLOW_COPY_AND_ASSIGN(PowerSaveBlockResourceThrottle); | 31 DISALLOW_COPY_AND_ASSIGN(PowerSaveBlockResourceThrottle); |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 } // namespace content | 34 } // namespace content |
| 35 | 35 |
| 36 #endif // CONTENT_BROWSER_LOADER_POWER_SAVE_BLOCK_RESOURCE_THROTTLE_H_ | 36 #endif // CONTENT_BROWSER_LOADER_POWER_SAVE_BLOCK_RESOURCE_THROTTLE_H_ |
| OLD | NEW |