| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 void didFail(int code) override { | 103 void didFail(int code) override { |
| 104 m_result->m_failed = true; | 104 m_result->m_failed = true; |
| 105 m_result->m_code = code; | 105 m_result->m_code = code; |
| 106 } | 106 } |
| 107 | 107 |
| 108 ~CreateFileHelper() override {} | 108 ~CreateFileHelper() override {} |
| 109 | 109 |
| 110 void didCreateSnapshotFile(const FileMetadata& metadata, | 110 void didCreateSnapshotFile(const FileMetadata& metadata, |
| 111 PassRefPtr<BlobDataHandle> snapshot) override { | 111 PassRefPtr<BlobDataHandle> snapshot) override { |
| 112 // We can't directly use the snapshot blob data handle because the content t
ype on it hasn't been set. | 112 // We can't directly use the snapshot blob data handle because the content |
| 113 // The |snapshot| param is here to provide a a chain of custody thru thread
bridging that is held onto until | 113 // type on it hasn't been set. The |snapshot| param is here to provide a a |
| 114 // *after* we've coined a File with a new handle that has the correct type s
et on it. This allows the | 114 // chain of custody thru thread bridging that is held onto until *after* |
| 115 // blob storage system to track when a temp file can and can't be safely del
eted. | 115 // we've coined a File with a new handle that has the correct type set on |
| 116 // it. This allows the blob storage system to track when a temp file can and |
| 117 // can't be safely deleted. |
| 116 | 118 |
| 117 m_result->m_file = | 119 m_result->m_file = |
| 118 DOMFileSystemBase::createFile(metadata, m_url, m_type, m_name); | 120 DOMFileSystemBase::createFile(metadata, m_url, m_type, m_name); |
| 119 } | 121 } |
| 120 | 122 |
| 121 bool shouldBlockUntilCompletion() const override { return true; } | 123 bool shouldBlockUntilCompletion() const override { return true; } |
| 122 | 124 |
| 123 private: | 125 private: |
| 124 CreateFileHelper(CreateFileResult* result, | 126 CreateFileHelper(CreateFileResult* result, |
| 125 const String& name, | 127 const String& name, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 211 } |
| 210 return fileWriter; | 212 return fileWriter; |
| 211 } | 213 } |
| 212 | 214 |
| 213 DEFINE_TRACE(DOMFileSystemSync) { | 215 DEFINE_TRACE(DOMFileSystemSync) { |
| 214 DOMFileSystemBase::trace(visitor); | 216 DOMFileSystemBase::trace(visitor); |
| 215 visitor->trace(m_rootEntry); | 217 visitor->trace(m_rootEntry); |
| 216 } | 218 } |
| 217 | 219 |
| 218 } // namespace blink | 220 } // namespace blink |
| OLD | NEW |