OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // The |snapshot| param is here to provide a a chain of custody thru thr
ead bridging that is held onto until | 132 // The |snapshot| param is here to provide a a chain of custody thru thr
ead bridging that is held onto until |
133 // *after* we've coined a File with a new handle that has the correct ty
pe set on it. This allows the | 133 // *after* we've coined a File with a new handle that has the correct ty
pe set on it. This allows the |
134 // blob storage system to track when a temp file can and can't be safely
deleted. | 134 // blob storage system to track when a temp file can and can't be safely
deleted. |
135 | 135 |
136 // For regular filesystem types (temporary or persistent), we should not
cache file metadata as it could change File semantics. | 136 // For regular filesystem types (temporary or persistent), we should not
cache file metadata as it could change File semantics. |
137 // For other filesystem types (which could be platform-specific ones), t
here's a chance that the files are on remote filesystem. | 137 // For other filesystem types (which could be platform-specific ones), t
here's a chance that the files are on remote filesystem. |
138 // If the port has returned metadata just pass it to File constructor (s
o we may cache the metadata). | 138 // If the port has returned metadata just pass it to File constructor (s
o we may cache the metadata). |
139 // FIXME: We should use the snapshot metadata for all files. | 139 // FIXME: We should use the snapshot metadata for all files. |
140 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=17746 | 140 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=17746 |
141 if (m_type == FileSystemTypeTemporary || m_type == FileSystemTypePersist
ent) { | 141 if (m_type == FileSystemTypeTemporary || m_type == FileSystemTypePersist
ent) { |
142 m_result->m_file = File::createWithName(metadata.platformPath, m_nam
e); | 142 m_result->m_file = File::createForFileSystemFile(metadata.platformPa
th, m_name); |
143 } else if (!metadata.platformPath.isEmpty()) { | 143 } else if (!metadata.platformPath.isEmpty()) { |
144 // If the platformPath in the returned metadata is given, we create
a File object for the path. | 144 // If the platformPath in the returned metadata is given, we create
a File object for the path. |
145 m_result->m_file = File::createForFileSystemFile(m_name, metadata).g
et(); | 145 m_result->m_file = File::createForFileSystemFile(m_name, metadata).g
et(); |
146 } else { | 146 } else { |
147 // Otherwise create a File from the FileSystem URL. | 147 // Otherwise create a File from the FileSystem URL. |
148 m_result->m_file = File::createForFileSystemFile(m_url, metadata).ge
t(); | 148 m_result->m_file = File::createForFileSystemFile(m_url, metadata).ge
t(); |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 virtual bool shouldBlockUntilCompletion() const OVERRIDE | 152 virtual bool shouldBlockUntilCompletion() const OVERRIDE |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, c
allbacks.release()); | 241 fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, c
allbacks.release()); |
242 if (errorCode != FileError::OK) { | 242 if (errorCode != FileError::OK) { |
243 FileError::throwDOMException(exceptionState, errorCode); | 243 FileError::throwDOMException(exceptionState, errorCode); |
244 return 0; | 244 return 0; |
245 } | 245 } |
246 return fileWriter; | 246 return fileWriter; |
247 } | 247 } |
248 | 248 |
249 } | 249 } |
OLD | NEW |