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 COMPONENTS_FILESYSTEM_SHARED_TEMP_DIR_H_ |
| 6 #define COMPONENTS_FILESYSTEM_SHARED_TEMP_DIR_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 |
| 10 namespace base { |
| 11 class ScopedTempDir; |
| 12 } |
| 13 |
| 14 namespace filesystem { |
| 15 |
| 16 // A class to allow multiple Directory objects to hold a reference to a |
| 17 // temporary directory. |
| 18 class SharedTempDir : public base::RefCounted<SharedTempDir> { |
| 19 public: |
| 20 SharedTempDir(std::unique_ptr<base::ScopedTempDir> temp_dir); |
| 21 |
| 22 private: |
| 23 friend class base::RefCounted<SharedTempDir>; |
| 24 ~SharedTempDir(); |
| 25 |
| 26 std::unique_ptr<base::ScopedTempDir> temp_dir_; |
| 27 |
| 28 DISALLOW_COPY_AND_ASSIGN(SharedTempDir); |
| 29 }; |
| 30 |
| 31 } // namespace filesystem |
| 32 |
| 33 #endif // COMPONENTS_FILESYSTEM_SHARED_TEMP_DIR_H_ |
OLD | NEW |