| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 { | 77 { |
| 78 ASSERT(!m_private.isNull()); | 78 ASSERT(!m_private.isNull()); |
| 79 m_private->callbacks()->didSucceed(); | 79 m_private->callbacks()->didSucceed(); |
| 80 m_private.reset(); | 80 m_private.reset(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void WebFileSystemCallbacks::didReadMetadata(const WebFileInfo& webFileInfo) | 83 void WebFileSystemCallbacks::didReadMetadata(const WebFileInfo& webFileInfo) |
| 84 { | 84 { |
| 85 ASSERT(!m_private.isNull()); | 85 ASSERT(!m_private.isNull()); |
| 86 FileMetadata fileMetadata; | 86 FileMetadata fileMetadata; |
| 87 fileMetadata.modificationTimeMS = webFileInfo.modificationTimeMS; | 87 fileMetadata.modificationTime = webFileInfo.modificationTime; |
| 88 fileMetadata.length = webFileInfo.length; | 88 fileMetadata.length = webFileInfo.length; |
| 89 fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type); | 89 fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type); |
| 90 fileMetadata.platformPath = webFileInfo.platformPath; | 90 fileMetadata.platformPath = webFileInfo.platformPath; |
| 91 m_private->callbacks()->didReadMetadata(fileMetadata); | 91 m_private->callbacks()->didReadMetadata(fileMetadata); |
| 92 m_private.reset(); | 92 m_private.reset(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void WebFileSystemCallbacks::didCreateSnapshotFile(const WebFileInfo& webFileInf
o) | 95 void WebFileSystemCallbacks::didCreateSnapshotFile(const WebFileInfo& webFileInf
o) |
| 96 { | 96 { |
| 97 ASSERT(!m_private.isNull()); | 97 ASSERT(!m_private.isNull()); |
| 98 // It's important to create a BlobDataHandle that refers to the platform fil
e path prior | 98 // It's important to create a BlobDataHandle that refers to the platform fil
e path prior |
| 99 // to return from this method so the underlying file will not be deleted. | 99 // to return from this method so the underlying file will not be deleted. |
| 100 OwnPtr<BlobData> blobData = BlobData::create(); | 100 OwnPtr<BlobData> blobData = BlobData::create(); |
| 101 blobData->appendFile(webFileInfo.platformPath); | 101 blobData->appendFile(webFileInfo.platformPath); |
| 102 RefPtr<BlobDataHandle> snapshotBlob = BlobDataHandle::create(blobData.releas
e(), webFileInfo.length); | 102 RefPtr<BlobDataHandle> snapshotBlob = BlobDataHandle::create(blobData.releas
e(), webFileInfo.length); |
| 103 | 103 |
| 104 FileMetadata fileMetadata; | 104 FileMetadata fileMetadata; |
| 105 fileMetadata.modificationTimeMS = webFileInfo.modificationTimeMS; | 105 fileMetadata.modificationTime = webFileInfo.modificationTime; |
| 106 fileMetadata.length = webFileInfo.length; | 106 fileMetadata.length = webFileInfo.length; |
| 107 fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type); | 107 fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type); |
| 108 fileMetadata.platformPath = webFileInfo.platformPath; | 108 fileMetadata.platformPath = webFileInfo.platformPath; |
| 109 m_private->callbacks()->didCreateSnapshotFile(fileMetadata, snapshotBlob); | 109 m_private->callbacks()->didCreateSnapshotFile(fileMetadata, snapshotBlob); |
| 110 m_private.reset(); | 110 m_private.reset(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void WebFileSystemCallbacks::didReadDirectory(const WebVector<WebFileSystemEntry
>& entries, bool hasMore) | 113 void WebFileSystemCallbacks::didReadDirectory(const WebVector<WebFileSystemEntry
>& entries, bool hasMore) |
| 114 { | 114 { |
| 115 ASSERT(!m_private.isNull()); | 115 ASSERT(!m_private.isNull()); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 m_private.reset(); | 147 m_private.reset(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 bool WebFileSystemCallbacks::shouldBlockUntilCompletion() const | 150 bool WebFileSystemCallbacks::shouldBlockUntilCompletion() const |
| 151 { | 151 { |
| 152 ASSERT(!m_private.isNull()); | 152 ASSERT(!m_private.isNull()); |
| 153 return m_private->callbacks()->shouldBlockUntilCompletion(); | 153 return m_private->callbacks()->shouldBlockUntilCompletion(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace blink | 156 } // namespace blink |
| OLD | NEW |