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

Unified Diff: sql/mojo/enable_mojo_fs.h

Issue 1176653002: mandoline filesystem: add a sqlite3 vfs to proxy filesystem usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch cleanup now that gn check passes. Created 5 years, 6 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
Index: sql/mojo/enable_mojo_fs.h
diff --git a/sql/mojo/enable_mojo_fs.h b/sql/mojo/enable_mojo_fs.h
new file mode 100644
index 0000000000000000000000000000000000000000..93d61ac85515ce1ea687df859d3b9574e1b8e07a
--- /dev/null
+++ b/sql/mojo/enable_mojo_fs.h
@@ -0,0 +1,33 @@
+// Copyright 2015 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 SQL_MOJO_ENABLE_MOJO_FS_H_
+#define SQL_MOJO_ENABLE_MOJO_FS_H_
+
+#include "base/macros.h"
+#include "components/filesystem/public/interfaces/directory.mojom.h"
+
+namespace sql {
+
+// Changes the default sqlite3 vfs to a vfs that uses proxies calls to the
+// mojo:filesystem service. Instantiating this object transparently changes how
+// the entire //sql/ subsystem works in the process of the caller; all paths
+// are treated as relative to |directory|.
+class ScopedMojoFilesystemVFS {
+ public:
+ ScopedMojoFilesystemVFS(filesystem::DirectoryPtr directory);
sky 2015/06/10 21:26:27 explicit?
Elliot Glaysher 2015/06/12 22:36:44 Done.
+ ~ScopedMojoFilesystemVFS();
+
+ // Returns the directory of the current VFS.
+ filesystem::DirectoryPtr& GetDirectory();
+
+ private:
+ static bool vfs_set_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedMojoFilesystemVFS);
+};
+
+} // namespace sql
+
+#endif // SQL_MOJO_ENABLE_MOJO_FS_H_

Powered by Google App Engine
This is Rietveld 408576698