OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 LIBRARIES_NACL_IO_HTTPFS_HTTP_FS_H_ | 5 #ifndef LIBRARIES_NACL_IO_HTTPFS_HTTP_FS_H_ |
6 #define LIBRARIES_NACL_IO_HTTPFS_HTTP_FS_H_ | 6 #define LIBRARIES_NACL_IO_HTTPFS_HTTP_FS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "nacl_io/filesystem.h" | 9 #include "nacl_io/filesystem.h" |
10 #include "nacl_io/pepper_interface.h" | 10 #include "nacl_io/pepper_interface.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 PP_Resource MakeUrlRequestInfo(const std::string& url, | 29 PP_Resource MakeUrlRequestInfo(const std::string& url, |
30 const char* method, | 30 const char* method, |
31 StringMap_t* additional_headers); | 31 StringMap_t* additional_headers); |
32 | 32 |
33 protected: | 33 protected: |
34 HttpFs(); | 34 HttpFs(); |
35 | 35 |
36 virtual Error Init(const FsInitArgs& args); | 36 virtual Error Init(const FsInitArgs& args); |
37 virtual void Destroy(); | 37 virtual void Destroy(); |
| 38 ScopedNode FindExistingNode(const Path& path); |
38 Error FindOrCreateDir(const Path& path, ScopedNode* out_node); | 39 Error FindOrCreateDir(const Path& path, ScopedNode* out_node); |
39 Error LoadManifest(const std::string& path, char** out_manifest); | 40 Error LoadManifest(const std::string& path, char** out_manifest); |
40 Error ParseManifest(const char* text); | 41 Error ParseManifest(const char* text); |
41 | 42 |
42 NodeMap_t* GetNodeCacheForTesting() { return &node_cache_; } | 43 NodeMap_t* GetNodeCacheForTesting() { return &node_cache_; } |
43 | 44 |
44 private: | 45 private: |
45 | 46 |
46 // Gets the URL to fetch for |path|. | 47 // Gets the URL to fetch for |path|. |
47 // |path| is relative to the mount point for the HTTP filesystem. | 48 // |path| is relative to the mount point for the HTTP filesystem. |
48 std::string MakeUrl(const Path& path); | 49 std::string MakeUrl(const Path& path); |
49 | 50 |
50 std::string url_root_; | 51 std::string url_root_; |
51 StringMap_t headers_; | 52 StringMap_t headers_; |
52 NodeMap_t node_cache_; | 53 NodeMap_t node_cache_; |
53 bool allow_cors_; | 54 bool allow_cors_; |
54 bool allow_credentials_; | 55 bool allow_credentials_; |
55 bool cache_stat_; | 56 bool cache_stat_; |
56 bool cache_content_; | 57 bool cache_content_; |
57 bool is_blob_url_; | 58 bool is_blob_url_; |
58 | 59 |
59 friend class TypedFsFactory<HttpFs>; | 60 friend class TypedFsFactory<HttpFs>; |
60 friend class HttpFsNode; | 61 friend class HttpFsNode; |
61 }; | 62 }; |
62 | 63 |
63 } // namespace nacl_io | 64 } // namespace nacl_io |
64 | 65 |
65 #endif // LIBRARIES_NACL_IO_HTTPFS_HTTP_FS_H_ | 66 #endif // LIBRARIES_NACL_IO_HTTPFS_HTTP_FS_H_ |
OLD | NEW |