| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CONTENT_RENDERER_PEPPER_PEPPER_FILE_SYSTEM_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_FILE_SYSTEM_HOST_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_FILE_SYSTEM_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_FILE_SYSTEM_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/files/file.h" |
| 11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 12 #include "ppapi/c/pp_file_info.h" | 13 #include "ppapi/c/pp_file_info.h" |
| 13 #include "ppapi/c/private/ppb_isolated_file_system_private.h" | 14 #include "ppapi/c/private/ppb_isolated_file_system_private.h" |
| 14 #include "ppapi/host/host_message_context.h" | 15 #include "ppapi/host/host_message_context.h" |
| 15 #include "ppapi/host/resource_host.h" | 16 #include "ppapi/host/resource_host.h" |
| 16 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 | 20 |
| 20 class RendererPpapiHost; | 21 class RendererPpapiHost; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 47 virtual bool IsFileSystemHost() OVERRIDE; | 48 virtual bool IsFileSystemHost() OVERRIDE; |
| 48 | 49 |
| 49 // Supports FileRefs direct access on the host side. | 50 // Supports FileRefs direct access on the host side. |
| 50 PP_FileSystemType GetType() const { return type_; } | 51 PP_FileSystemType GetType() const { return type_; } |
| 51 bool IsOpened() const { return opened_; } | 52 bool IsOpened() const { return opened_; } |
| 52 GURL GetRootUrl() const { return root_url_; } | 53 GURL GetRootUrl() const { return root_url_; } |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 // Callback for OpenFileSystem. | 56 // Callback for OpenFileSystem. |
| 56 void DidOpenFileSystem(const std::string& name_unused, const GURL& root); | 57 void DidOpenFileSystem(const std::string& name_unused, const GURL& root); |
| 57 void DidFailOpenFileSystem(base::PlatformFileError error); | 58 void DidFailOpenFileSystem(base::File::Error error); |
| 58 | 59 |
| 59 int32_t OnHostMsgOpen(ppapi::host::HostMessageContext* context, | 60 int32_t OnHostMsgOpen(ppapi::host::HostMessageContext* context, |
| 60 int64_t expected_size); | 61 int64_t expected_size); |
| 61 int32_t OnHostMsgInitIsolatedFileSystem( | 62 int32_t OnHostMsgInitIsolatedFileSystem( |
| 62 ppapi::host::HostMessageContext* context, | 63 ppapi::host::HostMessageContext* context, |
| 63 const std::string& fsid, | 64 const std::string& fsid, |
| 64 PP_IsolatedFileSystemType_Private type); | 65 PP_IsolatedFileSystemType_Private type); |
| 65 | 66 |
| 66 RendererPpapiHost* renderer_ppapi_host_; | 67 RendererPpapiHost* renderer_ppapi_host_; |
| 67 ppapi::host::ReplyMessageContext reply_context_; | 68 ppapi::host::ReplyMessageContext reply_context_; |
| 68 | 69 |
| 69 PP_FileSystemType type_; | 70 PP_FileSystemType type_; |
| 70 bool opened_; // whether open is successful. | 71 bool opened_; // whether open is successful. |
| 71 GURL root_url_; | 72 GURL root_url_; |
| 72 bool called_open_; // whether open has been called. | 73 bool called_open_; // whether open has been called. |
| 73 | 74 |
| 74 base::WeakPtrFactory<PepperFileSystemHost> weak_factory_; | 75 base::WeakPtrFactory<PepperFileSystemHost> weak_factory_; |
| 75 | 76 |
| 76 DISALLOW_COPY_AND_ASSIGN(PepperFileSystemHost); | 77 DISALLOW_COPY_AND_ASSIGN(PepperFileSystemHost); |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 } // namespace content | 80 } // namespace content |
| 80 | 81 |
| 81 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_SYSTEM_HOST_H_ | 82 #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_SYSTEM_HOST_H_ |
| OLD | NEW |