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

Unified Diff: WebCore/html/File.cpp

Issue 1769002: BlobBuilder/FormData refactor attempt (Closed)
Patch Set: back to simple FormData Created 10 years, 7 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
« no previous file with comments | « WebCore/html/File.h ('k') | WebCore/html/FileReader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/html/File.cpp
diff --git a/WebCore/html/File.cpp b/WebCore/html/File.cpp
index 97fdc4578d74b225e5946f4d6aef256525443ae4..2c9ce53b83cb0df79a859522dc916f255bd84cc3 100644
--- a/WebCore/html/File.cpp
+++ b/WebCore/html/File.cpp
@@ -33,12 +33,17 @@ namespace WebCore {
File::File(const String& path)
: Blob(path)
- , m_name(pathGetFileName(path))
{
// We don't use MIMETypeRegistry::getMIMETypeForPath() because it returns "application/octet-stream" upon failure.
- int index = m_name.reverseFind('.');
+ const String& fileName = name();
+ int index = fileName.reverseFind('.');
if (index != -1)
- m_type = MIMETypeRegistry::getMIMETypeForExtension(m_name.substring(index + 1));
+ m_type = MIMETypeRegistry::getMIMETypeForExtension(fileName.substring(index + 1));
+}
+
+const String& File::name() const
+{
+ return items().at(0)->toFileBlobItem()->name();
}
} // namespace WebCore
« no previous file with comments | « WebCore/html/File.h ('k') | WebCore/html/FileReader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698