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

Side by Side Diff: chrome/browser/file_system/file_system_host_context.h

Issue 3244002: (2nd try) Add a helper class that keeps per-profile information for FileSystem API (Closed)
Patch Set: Created 10 years, 3 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
OLDNEW
(Empty)
1 // Copyright (c) 2010 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 CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_HOST_CONTEXT_H_
6 #define CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_HOST_CONTEXT_H_
7
8 #include "base/file_path.h"
9 #include "base/ref_counted.h"
10 #include "base/scoped_ptr.h"
11 #include "googleurl/src/gurl.h"
12 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h"
13
14 // This is owned by profile and shared by all the FileSystemDispatcherHost
15 // that shared by the same profile.
16 class FileSystemHostContext
17 : public base::RefCountedThreadSafe<FileSystemHostContext> {
18 public:
19 FileSystemHostContext(const FilePath& data_path, bool is_incognito);
20 const FilePath& base_path() const { return base_path_; }
21 bool is_incognito() const { return is_incognito_; }
22
23 // Returns the root path and name for the file system specified by given
24 // |origin_url| and |type|. Returns true if the file system is available
25 // for the profile and |root_path| and |name| are filled successfully.
26 bool GetFileSystemRootPath(
27 const GURL& origin_url,
28 WebKit::WebFileSystem::Type type,
29 FilePath* root_path,
30 std::string* name) const;
31
32 // Check if the given |path| is in the FileSystem base directory.
33 bool CheckValidFileSystemPath(const FilePath& path) const;
34
35 // Returns the storage identifier string for the given |url|.
36 static std::string GetStorageIdentifierFromURL(const GURL& url);
37
38 // The FileSystem directory name.
39 static const FilePath::CharType kFileSystemDirectory[];
40
41 static const char kPersistentName[];
42 static const char kTemporaryName[];
43
44 private:
45 const FilePath base_path_;
46 const bool is_incognito_;
47
48 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemHostContext);
49 };
50
51 #endif // CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_HOST_CONTEXT_H_
OLDNEW
« no previous file with comments | « chrome/browser/file_system/file_system_dispatcher_host.cc ('k') | chrome/browser/file_system/file_system_host_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698