OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_LOADER_NULL_RESOURCE_CONTROLLER_H_ |
| 6 #define CONTENT_BROWSER_LOADER_NULL_RESOURCE_CONTROLLER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "content/browser/loader/resource_controller.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 // A pseudo-ResourceController that just tracks whether it was resumed or not. |
| 14 // Only intended when calling into ResourceHandlers that either much resume the |
| 15 // request, or when the consumer doesn't care if the request was resumed or not. |
| 16 // TODO(mmenke): Modify consumers so they don't need to use this class. |
| 17 class NullResourceController : public ResourceController { |
| 18 public: |
| 19 explicit NullResourceController(bool* was_resumed); |
| 20 ~NullResourceController() override; |
| 21 |
| 22 // ResourceController implementation: |
| 23 void Cancel() override; |
| 24 void CancelAndIgnore() override; |
| 25 void CancelWithError(int error_code) override; |
| 26 void Resume() override; |
| 27 |
| 28 private: |
| 29 bool* was_resumed_; |
| 30 |
| 31 DISALLOW_COPY_AND_ASSIGN(NullResourceController); |
| 32 }; |
| 33 |
| 34 } // namespace content |
| 35 |
| 36 #endif // CONTENT_BROWSER_LOADER_NULL_RESOURCE_CONTROLLER_H_ |
OLD | NEW |