Chromium Code Reviews| Index: Source/core/fileapi/File.cpp |
| diff --git a/Source/core/fileapi/File.cpp b/Source/core/fileapi/File.cpp |
| index 120954f463f504ab2e88b270d636368b22c9a0c4..0d845c3b42d98b4819d9861a1ca5da8c058d60f3 100644 |
| --- a/Source/core/fileapi/File.cpp |
| +++ b/Source/core/fileapi/File.cpp |
| @@ -296,4 +296,24 @@ void File::appendTo(BlobData& blobData) const |
| blobData.appendFile(m_path, 0, size, modificationTime); |
| } |
| +bool File::hasSameSource(const File& other) const |
| +{ |
| + if (m_hasBackingFile != other.m_hasBackingFile) |
| + return false; |
| + |
| + // Compare backing file. |
|
tkent
2014/10/20 00:48:48
The comment adds nothing other than what the code
hirono
2014/10/20 03:50:06
Done.
|
| + if (m_hasBackingFile) |
| + return m_path == other.m_path; |
| + |
| + if (m_fileSystemURL.isEmpty() != other.m_fileSystemURL.isEmpty()) |
| + return false; |
| + |
| + // Compare file system URL. |
|
tkent
2014/10/20 00:48:48
Ditto.
hirono
2014/10/20 03:50:06
Done.
|
| + if (!m_fileSystemURL.isEmpty()) |
| + return m_fileSystemURL == other.m_fileSystemURL; |
| + |
| + // Compare blob UUID. |
|
tkent
2014/10/20 00:48:48
Ditto.
hirono
2014/10/20 03:50:06
Done.
|
| + return uuid() == other.uuid(); |
| +} |
| + |
| } // namespace blink |