OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 CHROME_BROWSER_LIFETIME_SCOPED_KEEP_ALIVE_H_ |
| 6 #define CHROME_BROWSER_LIFETIME_SCOPED_KEEP_ALIVE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "chrome/browser/lifetime/keep_alive_registry.h" |
| 12 |
| 13 struct KeepAliveOptions; |
| 14 |
| 15 // Registers with KeepAliveRegistry on creation and unregisters them |
| 16 // on destruction. Use these objects with a scoped_ptr for easy management. |
| 17 class ScopedKeepAlive { |
| 18 public: |
| 19 explicit ScopedKeepAlive(const KeepAliveOptions* options); |
| 20 ~ScopedKeepAlive(); |
| 21 |
| 22 private: |
| 23 const KeepAliveOptions* options_; |
| 24 |
| 25 DISALLOW_COPY_AND_ASSIGN(ScopedKeepAlive); |
| 26 }; |
| 27 |
| 28 #endif // CHROME_BROWSER_LIFETIME_SCOPED_KEEP_ALIVE_H_ |
OLD | NEW |