| 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 #include "content/renderer/pepper/pepper_file_system_host.h" | 5 #include "content/renderer/pepper/pepper_file_system_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "content/child/child_thread.h" | 9 #include "content/child/child_thread.h" |
| 10 #include "content/child/fileapi/file_system_dispatcher.h" | 10 #include "content/child/fileapi/file_system_dispatcher.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 void PepperFileSystemHost::DidOpenFileSystem( | 74 void PepperFileSystemHost::DidOpenFileSystem( |
| 75 const std::string& /* name_unused */, | 75 const std::string& /* name_unused */, |
| 76 const GURL& root) { | 76 const GURL& root) { |
| 77 opened_ = true; | 77 opened_ = true; |
| 78 root_url_ = root; | 78 root_url_ = root; |
| 79 reply_context_.params.set_result(PP_OK); | 79 reply_context_.params.set_result(PP_OK); |
| 80 host()->SendReply(reply_context_, PpapiPluginMsg_FileSystem_OpenReply()); | 80 host()->SendReply(reply_context_, PpapiPluginMsg_FileSystem_OpenReply()); |
| 81 reply_context_ = ppapi::host::ReplyMessageContext(); | 81 reply_context_ = ppapi::host::ReplyMessageContext(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void PepperFileSystemHost::DidFailOpenFileSystem( | 84 void PepperFileSystemHost::DidFailOpenFileSystem(base::File::Error error) { |
| 85 base::PlatformFileError error) { | 85 int32 pp_error = ppapi::FileErrorToPepperError(error); |
| 86 int32 pp_error = ppapi::PlatformFileErrorToPepperError(error); | |
| 87 opened_ = (pp_error == PP_OK); | 86 opened_ = (pp_error == PP_OK); |
| 88 reply_context_.params.set_result(pp_error); | 87 reply_context_.params.set_result(pp_error); |
| 89 host()->SendReply(reply_context_, PpapiPluginMsg_FileSystem_OpenReply()); | 88 host()->SendReply(reply_context_, PpapiPluginMsg_FileSystem_OpenReply()); |
| 90 reply_context_ = ppapi::host::ReplyMessageContext(); | 89 reply_context_ = ppapi::host::ReplyMessageContext(); |
| 91 } | 90 } |
| 92 | 91 |
| 93 int32_t PepperFileSystemHost::OnHostMsgOpen( | 92 int32_t PepperFileSystemHost::OnHostMsgOpen( |
| 94 ppapi::host::HostMessageContext* context, | 93 ppapi::host::HostMessageContext* context, |
| 95 int64_t expected_size) { | 94 int64_t expected_size) { |
| 96 // Not allow multiple opens. | 95 // Not allow multiple opens. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 const std::string root_name = ppapi::IsolatedFileSystemTypeToRootName(type); | 141 const std::string root_name = ppapi::IsolatedFileSystemTypeToRootName(type); |
| 143 if (root_name.empty()) | 142 if (root_name.empty()) |
| 144 return PP_ERROR_BADARGUMENT; | 143 return PP_ERROR_BADARGUMENT; |
| 145 root_url_ = GURL(fileapi::GetIsolatedFileSystemRootURIString( | 144 root_url_ = GURL(fileapi::GetIsolatedFileSystemRootURIString( |
| 146 url.GetOrigin(), fsid, root_name)); | 145 url.GetOrigin(), fsid, root_name)); |
| 147 opened_ = true; | 146 opened_ = true; |
| 148 return PP_OK; | 147 return PP_OK; |
| 149 } | 148 } |
| 150 | 149 |
| 151 } // namespace content | 150 } // namespace content |
| OLD | NEW |