| 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 "webkit/glue/plugins/pepper_file_ref.h" | 5 #include "webkit/glue/plugins/pepper_file_ref.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "webkit/glue/plugins/pepper_plugin_instance.h" | 8 #include "webkit/glue/plugins/pepper_plugin_instance.h" |
| 9 #include "webkit/glue/plugins/pepper_var.h" | 9 #include "webkit/glue/plugins/pepper_var.h" |
| 10 #include "webkit/glue/plugins/pepper_resource_tracker.h" | 10 #include "webkit/glue/plugins/pepper_resource_tracker.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 PP_FileSystemType file_system_type, | 123 PP_FileSystemType file_system_type, |
| 124 const std::string& validated_path, | 124 const std::string& validated_path, |
| 125 const std::string& origin) | 125 const std::string& origin) |
| 126 : Resource(module), | 126 : Resource(module), |
| 127 fs_type_(file_system_type), | 127 fs_type_(file_system_type), |
| 128 path_(validated_path), | 128 path_(validated_path), |
| 129 origin_(origin) { | 129 origin_(origin) { |
| 130 // TODO(darin): Need to initialize system_path_. | 130 // TODO(darin): Need to initialize system_path_. |
| 131 } | 131 } |
| 132 | 132 |
| 133 FileRef::FileRef(PluginModule* module, |
| 134 const FilePath& external_file_path) |
| 135 : Resource(module), |
| 136 system_path_(external_file_path), |
| 137 fs_type_(PP_FILESYSTEMTYPE_EXTERNAL) { |
| 138 } |
| 139 |
| 133 FileRef::~FileRef() { | 140 FileRef::~FileRef() { |
| 134 } | 141 } |
| 135 | 142 |
| 136 // static | 143 // static |
| 137 const PPB_FileRef* FileRef::GetInterface() { | 144 const PPB_FileRef* FileRef::GetInterface() { |
| 138 return &ppb_fileref; | 145 return &ppb_fileref; |
| 139 } | 146 } |
| 140 | 147 |
| 141 std::string FileRef::GetName() const { | 148 std::string FileRef::GetName() const { |
| 142 if (path_.size() == 1 && path_[0] == '/') | 149 if (path_.size() == 1 && path_[0] == '/') |
| (...skipping 17 matching lines...) Expand all Loading... |
| 160 // If the path is "/foo", then we want to include the slash. | 167 // If the path is "/foo", then we want to include the slash. |
| 161 if (pos == 0) | 168 if (pos == 0) |
| 162 pos++; | 169 pos++; |
| 163 std::string parent_path = path_.substr(0, pos); | 170 std::string parent_path = path_.substr(0, pos); |
| 164 | 171 |
| 165 FileRef* parent_ref = new FileRef(module(), fs_type_, parent_path, origin_); | 172 FileRef* parent_ref = new FileRef(module(), fs_type_, parent_path, origin_); |
| 166 return parent_ref; | 173 return parent_ref; |
| 167 } | 174 } |
| 168 | 175 |
| 169 } // namespace pepper | 176 } // namespace pepper |
| OLD | NEW |