| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // There should always be a leading slash at least! | 73 // There should always be a leading slash at least! |
| 74 size_t pos = path.rfind('/'); | 74 size_t pos = path.rfind('/'); |
| 75 CHECK(pos != std::string::npos); | 75 CHECK(pos != std::string::npos); |
| 76 return path.substr(pos + 1); | 76 return path.substr(pos + 1); |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace | 79 } // namespace |
| 80 | 80 |
| 81 PPB_FileRef_Impl::PPB_FileRef_Impl(const PPB_FileRef_CreateInfo& info, | 81 PPB_FileRef_Impl::PPB_FileRef_Impl(const PPB_FileRef_CreateInfo& info, |
| 82 PPB_FileSystem_Impl* file_system) | 82 PPB_FileSystem_Impl* file_system) |
| 83 : FileRefImpl(FileRefImpl::InitAsImpl(), info), | 83 : PPB_FileRef_Shared(PPB_FileRef_Shared::InitAsImpl(), info), |
| 84 file_system_(file_system), | 84 file_system_(file_system), |
| 85 external_file_system_path_() { | 85 external_file_system_path_() { |
| 86 } | 86 } |
| 87 | 87 |
| 88 PPB_FileRef_Impl::PPB_FileRef_Impl(const PPB_FileRef_CreateInfo& info, | 88 PPB_FileRef_Impl::PPB_FileRef_Impl(const PPB_FileRef_CreateInfo& info, |
| 89 const FilePath& external_file_path) | 89 const FilePath& external_file_path) |
| 90 : FileRefImpl(FileRefImpl::InitAsImpl(), info), | 90 : PPB_FileRef_Shared(PPB_FileRef_Shared::InitAsImpl(), info), |
| 91 file_system_(), | 91 file_system_(), |
| 92 external_file_system_path_(external_file_path) { | 92 external_file_system_path_(external_file_path) { |
| 93 } | 93 } |
| 94 | 94 |
| 95 PPB_FileRef_Impl::~PPB_FileRef_Impl() { | 95 PPB_FileRef_Impl::~PPB_FileRef_Impl() { |
| 96 } | 96 } |
| 97 | 97 |
| 98 // static | 98 // static |
| 99 PPB_FileRef_Impl* PPB_FileRef_Impl::CreateInternal(PP_Resource pp_file_system, | 99 PPB_FileRef_Impl* PPB_FileRef_Impl::CreateInternal(PP_Resource pp_file_system, |
| 100 const std::string& path) { | 100 const std::string& path) { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 return file_system_ && file_system_->opened(); | 289 return file_system_ && file_system_->opened(); |
| 290 } | 290 } |
| 291 | 291 |
| 292 bool PPB_FileRef_Impl::IsValidNonExternalFileSystem() const { | 292 bool PPB_FileRef_Impl::IsValidNonExternalFileSystem() const { |
| 293 return file_system_ && file_system_->opened() && | 293 return file_system_ && file_system_->opened() && |
| 294 file_system_->type() != PP_FILESYSTEMTYPE_EXTERNAL; | 294 file_system_->type() != PP_FILESYSTEMTYPE_EXTERNAL; |
| 295 } | 295 } |
| 296 | 296 |
| 297 } // namespace ppapi | 297 } // namespace ppapi |
| 298 } // namespace webkit | 298 } // namespace webkit |
| OLD | NEW |