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

Unified Diff: components/filesystem/shared_temp_dir.h

Issue 1935863002: mojo: Fix leveldb unittests by making fs::Directories cloneable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Gyp continues to exist. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/filesystem/public/interfaces/directory.mojom ('k') | components/filesystem/shared_temp_dir.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/filesystem/shared_temp_dir.h
diff --git a/components/filesystem/shared_temp_dir.h b/components/filesystem/shared_temp_dir.h
new file mode 100644
index 0000000000000000000000000000000000000000..c4002e8d4cb943549e921dbc9631df1a188d085b
--- /dev/null
+++ b/components/filesystem/shared_temp_dir.h
@@ -0,0 +1,33 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_FILESYSTEM_SHARED_TEMP_DIR_H_
+#define COMPONENTS_FILESYSTEM_SHARED_TEMP_DIR_H_
+
+#include "base/memory/ref_counted.h"
+
+namespace base {
+class ScopedTempDir;
+}
+
+namespace filesystem {
+
+// A class to allow multiple Directory objects to hold a reference to a
+// temporary directory.
+class SharedTempDir : public base::RefCounted<SharedTempDir> {
+ public:
+ SharedTempDir(std::unique_ptr<base::ScopedTempDir> temp_dir);
+
+ private:
+ friend class base::RefCounted<SharedTempDir>;
+ ~SharedTempDir();
+
+ std::unique_ptr<base::ScopedTempDir> temp_dir_;
+
+ DISALLOW_COPY_AND_ASSIGN(SharedTempDir);
+};
+
+} // namespace filesystem
+
+#endif // COMPONENTS_FILESYSTEM_SHARED_TEMP_DIR_H_
« no previous file with comments | « components/filesystem/public/interfaces/directory.mojom ('k') | components/filesystem/shared_temp_dir.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698