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

Side by Side Diff: components/filesystem/file_system_impl.h

Issue 1718123004: mojo filesystem: Further clean ups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows compile. Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « components/filesystem/file_system_app.cc ('k') | components/filesystem/file_system_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_FILESYSTEM_FILE_SYSTEM_IMPL_H_ 5 #ifndef COMPONENTS_FILESYSTEM_FILE_SYSTEM_IMPL_H_
6 #define COMPONENTS_FILESYSTEM_FILE_SYSTEM_IMPL_H_ 6 #define COMPONENTS_FILESYSTEM_FILE_SYSTEM_IMPL_H_
7 7
8 #include "base/files/file_path.h"
8 #include "base/macros.h" 9 #include "base/macros.h"
9 #include "components/filesystem/public/interfaces/file_system.mojom.h" 10 #include "components/filesystem/public/interfaces/file_system.mojom.h"
10 #include "mojo/public/cpp/bindings/interface_request.h" 11 #include "mojo/public/cpp/bindings/interface_request.h"
11 #include "mojo/public/cpp/bindings/strong_binding.h" 12 #include "mojo/public/cpp/bindings/strong_binding.h"
12 13
13 namespace base { 14 namespace base {
14 class FilePath; 15 class FilePath;
15 } 16 }
16 17
17 namespace mojo { 18 namespace mojo {
18 class Connection; 19 class Connection;
19 } 20 }
20 21
21 namespace filesystem { 22 namespace filesystem {
22 class FileSystemApp; 23 class FileSystemApp;
23 24
24 class LockTable; 25 class LockTable;
25 26
27 // The base implementation of FileSystemImpl.
26 class FileSystemImpl : public FileSystem { 28 class FileSystemImpl : public FileSystem {
27 public: 29 public:
28 FileSystemImpl(mojo::Connection* connection, 30 FileSystemImpl(mojo::Connection* connection,
29 mojo::InterfaceRequest<FileSystem> request, 31 mojo::InterfaceRequest<FileSystem> request,
32 base::FilePath user_data_dir,
jam 2016/02/23 16:51:25 nit: add comment to this constructor explaining th
30 LockTable* lock_table); 33 LockTable* lock_table);
31 ~FileSystemImpl() override; 34 ~FileSystemImpl() override;
32 35
33 // |Files| implementation: 36 // |Files| implementation:
34 37 void OpenTempDirectory(
35 // Current valid values for |file_system| are "temp" for a temporary 38 mojo::InterfaceRequest<Directory> directory,
36 // filesystem and "origin" for a persistent filesystem bound to the origin of 39 const OpenTempDirectoryCallback& callback) override;
37 // the URL of the caller. 40 void OpenPersistentFileSystem(
38 void OpenFileSystem(const mojo::String& file_system, 41 mojo::InterfaceRequest<Directory> directory,
39 mojo::InterfaceRequest<Directory> directory, 42 const OpenPersistentFileSystemCallback& callback) override;
40 FileSystemClientPtr client,
41 const OpenFileSystemCallback& callback) override;
42 43
43 private: 44 private:
44 // Gets the system specific toplevel profile directory.
45 base::FilePath GetSystemProfileDir() const;
46
47 // Takes the origin string from |remote_application_url_|.
48 std::string GetOriginFromRemoteApplicationURL() const;
49
50 // Sanitizes |origin| so it is an acceptable filesystem name.
51 void BuildSanitizedOrigin(const std::string& origin,
52 std::string* sanitized_origin);
53
54 const std::string remote_application_url_; 45 const std::string remote_application_url_;
55 mojo::StrongBinding<FileSystem> binding_; 46 mojo::StrongBinding<FileSystem> binding_;
56 LockTable* lock_table_; 47 LockTable* lock_table_;
57 48
49 base::FilePath user_data_dir_;
50
58 DISALLOW_COPY_AND_ASSIGN(FileSystemImpl); 51 DISALLOW_COPY_AND_ASSIGN(FileSystemImpl);
59 }; 52 };
60 53
61 } // namespace filesystem 54 } // namespace filesystem
62 55
63 #endif // COMPONENTS_FILESYSTEM_FILE_SYSTEM_IMPL_H_ 56 #endif // COMPONENTS_FILESYSTEM_FILE_SYSTEM_IMPL_H_
OLDNEW
« no previous file with comments | « components/filesystem/file_system_app.cc ('k') | components/filesystem/file_system_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698