Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(925)

Unified Diff: Source/core/fileapi/File.cpp

Issue 640723006: Pass the selected non-native file information from the browser to FileInputType. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Exclude the separated patch's lines Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698