OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppb_file_ref_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 new FileCallbacks(plugin_instance->module()->AsWeakPtr(), | 241 new FileCallbacks(plugin_instance->module()->AsWeakPtr(), |
242 pp_resource(), callback, NULL, NULL, NULL))) | 242 pp_resource(), callback, NULL, NULL, NULL))) |
243 return PP_ERROR_FAILED; | 243 return PP_ERROR_FAILED; |
244 return PP_OK_COMPLETIONPENDING; | 244 return PP_OK_COMPLETIONPENDING; |
245 } | 245 } |
246 | 246 |
247 PP_Var PPB_FileRef_Impl::GetAbsolutePath() { | 247 PP_Var PPB_FileRef_Impl::GetAbsolutePath() { |
248 if (GetFileSystemType() != PP_FILESYSTEMTYPE_EXTERNAL) | 248 if (GetFileSystemType() != PP_FILESYSTEMTYPE_EXTERNAL) |
249 return GetPath(); | 249 return GetPath(); |
250 if (!external_path_var_.get()) { | 250 if (!external_path_var_.get()) { |
251 PluginModule* plugin_module = ResourceHelper::GetPluginModule(this); | |
252 if (!plugin_module) | |
253 return PP_MakeNull(); | |
254 external_path_var_ = new StringVar( | 251 external_path_var_ = new StringVar( |
255 plugin_module->pp_module(), | |
256 external_file_system_path_.AsUTF8Unsafe()); | 252 external_file_system_path_.AsUTF8Unsafe()); |
257 } | 253 } |
258 return external_path_var_->GetPPVar(); | 254 return external_path_var_->GetPPVar(); |
259 } | 255 } |
260 | 256 |
261 FilePath PPB_FileRef_Impl::GetSystemPath() const { | 257 FilePath PPB_FileRef_Impl::GetSystemPath() const { |
262 if (GetFileSystemType() != PP_FILESYSTEMTYPE_EXTERNAL) { | 258 if (GetFileSystemType() != PP_FILESYSTEMTYPE_EXTERNAL) { |
263 NOTREACHED(); | 259 NOTREACHED(); |
264 return FilePath(); | 260 return FilePath(); |
265 } | 261 } |
(...skipping 23 matching lines...) Expand all Loading... |
289 return file_system_ && file_system_->opened(); | 285 return file_system_ && file_system_->opened(); |
290 } | 286 } |
291 | 287 |
292 bool PPB_FileRef_Impl::IsValidNonExternalFileSystem() const { | 288 bool PPB_FileRef_Impl::IsValidNonExternalFileSystem() const { |
293 return file_system_ && file_system_->opened() && | 289 return file_system_ && file_system_->opened() && |
294 file_system_->type() != PP_FILESYSTEMTYPE_EXTERNAL; | 290 file_system_->type() != PP_FILESYSTEMTYPE_EXTERNAL; |
295 } | 291 } |
296 | 292 |
297 } // namespace ppapi | 293 } // namespace ppapi |
298 } // namespace webkit | 294 } // namespace webkit |
OLD | NEW |