Implement File and Blob interfaces as defined in File API spec.
https://bugs.webkit.org/show_bug.cgi?id=32912
Reviewed by Dmitry Titov.
WebCore:
* Android.derived.jscbindings.mk:
* Android.derived.v8bindings.mk:
* Android.mk:
* DerivedSources.cpp:
* DerivedSources.make:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pri:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* WebCoreSources.bkl:
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::send):
* bindings/objc/DOMHTML.h:
* bindings/objc/PublicDOMInterfaces.h:
* bindings/scripts/CodeGeneratorJS.pm:
* bindings/scripts/CodeGeneratorObjC.pm:
* bindings/scripts/CodeGeneratorV8.pm:
* bindings/v8/DOMObjectsInclude.h:
* bindings/v8/DerivedSourcesAllInOne.cpp:
* bindings/v8/V8Binding.h:
(WebCore::toInt64):
* bindings/v8/V8Index.cpp:
* bindings/v8/V8Index.h:
* bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
(WebCore::V8XMLHttpRequest::sendCallback):
* html/File.cpp:
(WebCore::File::File):
* html/File.h:
(WebCore::File::create):
(WebCore::File::name):
(WebCore::File::fileName):
(WebCore::File::fileSize):
* html/File.idl:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
* xml/XMLHttpRequest.h:
WebKit/mac:
* MigrateHeaders.make:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53574 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/html/File.h b/WebCore/html/File.h
index 7d79aa5..be53e30 100644
--- a/WebCore/html/File.h
+++ b/WebCore/html/File.h
@@ -26,30 +26,30 @@
#ifndef File_h
#define File_h
-#include "PlatformString.h"
+#include "Blob.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
- class File : public RefCounted<File> {
- public:
- static PassRefPtr<File> create(const String& path)
- {
- return adoptRef(new File(path));
- }
+class File : public Blob {
+public:
+ static PassRefPtr<File> create(const String& path)
+ {
+ return adoptRef(new File(path));
+ }
- const String& fileName() const { return m_fileName; }
- unsigned long long fileSize();
+ const String& name() const { return m_name; }
- const String& path() const { return m_path; }
+ // FIXME: obsolete attributes. To be removed.
+ const String& fileName() const { return m_name; }
+ unsigned long long fileSize() const { return size(); }
- private:
- File(const String& path);
+private:
+ File(const String& path);
- String m_path;
- String m_fileName;
- };
+ String m_name;
+};
} // namespace WebCore