Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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 SQL_MOJO_ENABLE_MOJO_FS_H_ | |
| 6 #define SQL_MOJO_ENABLE_MOJO_FS_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "components/filesystem/public/interfaces/directory.mojom.h" | |
| 10 | |
| 11 namespace sql { | |
| 12 | |
| 13 // Changes the default sqlite3 vfs to a vfs that uses proxies calls to the | |
| 14 // mojo:filesystem service. Instantiating this object transparently changes how | |
| 15 // the entire //sql/ subsystem works in the process of the caller; all paths | |
| 16 // are treated as relative to |directory|. | |
| 17 class ScopedMojoFilesystemVFS { | |
| 18 public: | |
| 19 ScopedMojoFilesystemVFS(filesystem::DirectoryPtr directory); | |
|
sky
2015/06/10 21:26:27
explicit?
Elliot Glaysher
2015/06/12 22:36:44
Done.
| |
| 20 ~ScopedMojoFilesystemVFS(); | |
| 21 | |
| 22 // Returns the directory of the current VFS. | |
| 23 filesystem::DirectoryPtr& GetDirectory(); | |
| 24 | |
| 25 private: | |
| 26 static bool vfs_set_; | |
| 27 | |
| 28 DISALLOW_COPY_AND_ASSIGN(ScopedMojoFilesystemVFS); | |
| 29 }; | |
| 30 | |
| 31 } // namespace sql | |
| 32 | |
| 33 #endif // SQL_MOJO_ENABLE_MOJO_FS_H_ | |
| OLD | NEW |