| OLD | NEW |
| 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 LIBRARIES_NACL_MOUNTS_MOUNT_HTML5FS_H_ | |
| 6 #define LIBRARIES_NACL_MOUNTS_MOUNT_HTML5FS_H_ | |
| 7 | 5 |
| 8 #include <pthread.h> | 6 #ifndef LIBRARIES_NACL_MOUNTS_MOUNT_HTTP_H_ |
| 7 #define LIBRARIES_NACL_MOUNTS_MOUNT_HTTP_H_ |
| 8 |
| 9 #include <string> |
| 9 #include "nacl_mounts/mount.h" | 10 #include "nacl_mounts/mount.h" |
| 10 #include "nacl_mounts/pepper_interface.h" | 11 #include "nacl_mounts/pepper_interface.h" |
| 11 | 12 |
| 12 class MountNode; | 13 class MountNode; |
| 13 | 14 |
| 14 class MountHtml5Fs: public Mount { | 15 class MountHttp : public Mount { |
| 15 public: | 16 public: |
| 16 virtual MountNode *Open(const Path& path, int mode); | 17 virtual MountNode *Open(const Path& path, int mode); |
| 17 virtual int Close(MountNode* node); | 18 virtual int Close(MountNode* node); |
| 18 virtual int Unlink(const Path& path); | 19 virtual int Unlink(const Path& path); |
| 19 virtual int Mkdir(const Path& path, int permissions); | 20 virtual int Mkdir(const Path& path, int permissions); |
| 20 virtual int Rmdir(const Path& path); | 21 virtual int Rmdir(const Path& path); |
| 21 virtual int Remove(const Path& path); | 22 virtual int Remove(const Path& path); |
| 22 | 23 |
| 23 PP_Resource filesystem_resource() { return filesystem_resource_; } | 24 PP_Resource MakeUrlRequestInfo(const std::string& url, |
| 25 const char* method, |
| 26 StringMap_t* additional_headers); |
| 24 | 27 |
| 25 protected: | 28 protected: |
| 26 MountHtml5Fs(); | 29 MountHttp(); |
| 27 | 30 |
| 28 virtual bool Init(int dev, StringMap_t& args, PepperInterface* ppapi); | 31 virtual bool Init(int dev, StringMap_t& args, PepperInterface* ppapi); |
| 29 virtual void Destroy(); | 32 virtual void Destroy(); |
| 30 | 33 |
| 31 bool IsFilesystemOpen(); | |
| 32 | |
| 33 private: | 34 private: |
| 34 static void FilesystemOpenCallbackThunk(void* user_data, int32_t result); | 35 std::string url_root_; |
| 35 void FilesystemOpenCallback(int32_t result); | 36 StringMap_t headers_; |
| 36 | 37 bool allow_cors_; |
| 37 PP_Resource filesystem_resource_; | 38 bool allow_credentials_; |
| 38 bool filesystem_open_; // protected by lock_. | |
| 39 | 39 |
| 40 friend class Mount; | 40 friend class Mount; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 #endif // LIBRARIES_NACL_MOUNTS_MOUNT_HTML5FS_H_ | 43 #endif // LIBRARIES_NACL_MOUNTS_MOUNT_HTTP_H_ |
| OLD | NEW |