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

Side by Side Diff: webkit/fileapi/isolated_context.h

Issue 10447055: Move fileapi into its own component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes and use FILEAPI_EXPORT_PRIVATE Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 WEBKIT_FILEAPI_ISOLATED_CONTEXT_H_ 5 #ifndef WEBKIT_FILEAPI_ISOLATED_CONTEXT_H_
6 #define WEBKIT_FILEAPI_ISOLATED_CONTEXT_H_ 6 #define WEBKIT_FILEAPI_ISOLATED_CONTEXT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/file_path.h" 14 #include "base/file_path.h"
15 #include "base/memory/singleton.h" 15 #include "base/memory/singleton.h"
16 #include "base/synchronization/lock.h" 16 #include "base/synchronization/lock.h"
17 #include "base/lazy_instance.h" 17 #include "base/lazy_instance.h"
18 #include "webkit/fileapi/fileapi_export.h"
18 19
19 namespace fileapi { 20 namespace fileapi {
20 21
21 // Manages isolated filename namespaces. A namespace is simply defined as a 22 // Manages isolated filename namespaces. A namespace is simply defined as a
22 // set of file paths and corresponding filesystem ID. This context class is 23 // set of file paths and corresponding filesystem ID. This context class is
23 // a singleton and access to the context is thread-safe (protected with a 24 // a singleton and access to the context is thread-safe (protected with a
24 // lock). 25 // lock).
25 // Some methods of this class are virtual just for mocking. 26 // Some methods of this class are virtual just for mocking.
26 class IsolatedContext { 27 class FILEAPI_EXPORT IsolatedContext {
27 public: 28 public:
28 // The instance is lazily created per browser process. 29 // The instance is lazily created per browser process.
29 static IsolatedContext* GetInstance(); 30 static IsolatedContext* GetInstance();
30 31
31 // Registers a new file isolated filesystem with the given set of files 32 // Registers a new file isolated filesystem with the given set of files
32 // and returns the new filesystem_id. The files are registered with their 33 // and returns the new filesystem_id. The files are registered with their
33 // basenames as their keys so that later we can resolve the full paths 34 // basenames as their keys so that later we can resolve the full paths
34 // for the given file name in the isolated filesystem. We only expose the 35 // for the given file name in the isolated filesystem. We only expose the
35 // key and the ID for the newly created filesystem to the renderer for 36 // key and the ID for the newly created filesystem to the renderer for
36 // the sake of security. 37 // the sake of security.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 103
103 // Maps the toplevel entries to the filesystem id. 104 // Maps the toplevel entries to the filesystem id.
104 IDToPathMap toplevel_map_; 105 IDToPathMap toplevel_map_;
105 106
106 DISALLOW_COPY_AND_ASSIGN(IsolatedContext); 107 DISALLOW_COPY_AND_ASSIGN(IsolatedContext);
107 }; 108 };
108 109
109 } // namespace fileapi 110 } // namespace fileapi
110 111
111 #endif // WEBKIT_FILEAPI_ISOLATED_CONTEXT_H_ 112 #endif // WEBKIT_FILEAPI_ISOLATED_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698