| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "ppapi/cpp/dev/file_ref_dev.h" | 5 #include "ppapi/cpp/dev/file_ref_dev.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/cpp/completion_callback.h" | 8 #include "ppapi/cpp/completion_callback.h" |
| 9 #include "ppapi/cpp/dev/file_system_dev.h" | 9 #include "ppapi/cpp/dev/file_system_dev.h" |
| 10 #include "ppapi/cpp/module_impl.h" | 10 #include "ppapi/cpp/module_impl.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 if (!file_ref_f) | 29 if (!file_ref_f) |
| 30 return; | 30 return; |
| 31 PassRefFromConstructor(file_ref_f->Create(file_system.pp_resource(), path)); | 31 PassRefFromConstructor(file_ref_f->Create(file_system.pp_resource(), path)); |
| 32 } | 32 } |
| 33 | 33 |
| 34 FileRef_Dev::FileRef_Dev(const FileRef_Dev& other) | 34 FileRef_Dev::FileRef_Dev(const FileRef_Dev& other) |
| 35 : Resource(other) { | 35 : Resource(other) { |
| 36 } | 36 } |
| 37 | 37 |
| 38 FileRef_Dev& FileRef_Dev::operator=(const FileRef_Dev& other) { | 38 FileRef_Dev& FileRef_Dev::operator=(const FileRef_Dev& other) { |
| 39 FileRef_Dev copy(other); | 39 Resource::operator=(other); |
| 40 swap(copy); | |
| 41 return *this; | 40 return *this; |
| 42 } | 41 } |
| 43 | 42 |
| 44 void FileRef_Dev::swap(FileRef_Dev& other) { | |
| 45 Resource::swap(other); | |
| 46 } | |
| 47 | |
| 48 PP_FileSystemType_Dev FileRef_Dev::GetFileSystemType() const { | 43 PP_FileSystemType_Dev FileRef_Dev::GetFileSystemType() const { |
| 49 if (!file_ref_f) | 44 if (!file_ref_f) |
| 50 return PP_FILESYSTEMTYPE_EXTERNAL; | 45 return PP_FILESYSTEMTYPE_EXTERNAL; |
| 51 return file_ref_f->GetFileSystemType(pp_resource()); | 46 return file_ref_f->GetFileSystemType(pp_resource()); |
| 52 } | 47 } |
| 53 | 48 |
| 54 Var FileRef_Dev::GetName() const { | 49 Var FileRef_Dev::GetName() const { |
| 55 if (!file_ref_f) | 50 if (!file_ref_f) |
| 56 return Var(); | 51 return Var(); |
| 57 return Var(Var::PassRef(), file_ref_f->GetName(pp_resource())); | 52 return Var(Var::PassRef(), file_ref_f->GetName(pp_resource())); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 int32_t FileRef_Dev::Rename(const FileRef_Dev& new_file_ref, | 110 int32_t FileRef_Dev::Rename(const FileRef_Dev& new_file_ref, |
| 116 const CompletionCallback& cc) { | 111 const CompletionCallback& cc) { |
| 117 if (!file_ref_f) | 112 if (!file_ref_f) |
| 118 return PP_ERROR_NOINTERFACE; | 113 return PP_ERROR_NOINTERFACE; |
| 119 return file_ref_f->Rename(pp_resource(), | 114 return file_ref_f->Rename(pp_resource(), |
| 120 new_file_ref.pp_resource(), | 115 new_file_ref.pp_resource(), |
| 121 cc.pp_completion_callback()); | 116 cc.pp_completion_callback()); |
| 122 } | 117 } |
| 123 | 118 |
| 124 } // namespace pp | 119 } // namespace pp |
| OLD | NEW |