Index: Source/platform/blob/BlobInfo.h |
diff --git a/Source/core/html/parser/HTMLSrcsetParser.h b/Source/platform/blob/BlobInfo.h |
similarity index 52% |
copy from Source/core/html/parser/HTMLSrcsetParser.h |
copy to Source/platform/blob/BlobInfo.h |
index 8964ffbcd5f61ee309ab67d2e4fe83855e89c736..43f2582a09b66f6ef59ba9789c882e43e39cb39f 100644 |
--- a/Source/core/html/parser/HTMLSrcsetParser.h |
+++ b/Source/platform/blob/BlobInfo.h |
@@ -28,52 +28,67 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef HTMLSrcsetParser_h |
-#define HTMLSrcsetParser_h |
+#ifndef BlobInfo_h |
+#define BlobInfo_h |
#include "wtf/text/WTFString.h" |
namespace WebCore { |
-class ImageCandidate { |
+class BlobInfo { |
public: |
- ImageCandidate() |
- : m_scaleFactor(1.0) |
+ BlobInfo() |
+ : m_isFile(false) |
+ , m_size(-1) |
{ |
} |
- |
- ImageCandidate(const String& source, unsigned start, unsigned length, float scaleFactor) |
- : m_string(source.createView(start, length)) |
- , m_scaleFactor(scaleFactor) |
+ BlobInfo(const String& uuid, const String& type, long long size) |
+ : m_isFile(false) |
+ , m_uuid(uuid) |
+ , m_type(type) |
+ , m_size(size) |
+ , m_lastModified(0) |
{ |
} |
- |
- String toString() const |
+ BlobInfo(const String& uuid, const String& filePath, const String& fileName, const String& type, double lastModified, long long size) |
+ : m_isFile(true) |
+ , m_uuid(uuid) |
+ , m_type(type) |
+ , m_size(size) |
+ , m_filePath(filePath) |
+ , m_fileName(fileName) |
+ , m_lastModified(lastModified) |
{ |
- return m_string.toString(); |
} |
- |
- inline float scaleFactor() const |
+ BlobInfo(const String& uuid, const String& filePath, const String& fileName, const String& type) |
+ : m_isFile(true) |
+ , m_uuid(uuid) |
+ , m_type(type) |
+ , m_size(-1) |
+ , m_filePath(filePath) |
+ , m_fileName(fileName) |
+ , m_lastModified(0) |
{ |
- return m_scaleFactor; |
} |
- inline bool isEmpty() const |
- { |
- return m_string.isEmpty(); |
- } |
+ bool isFile() const { return m_isFile; } |
+ const String& uuid() const { return m_uuid; } |
+ const String& type() const { return m_type; } |
+ long long size() const { return m_size; } |
+ const String& filePath() const { return m_filePath; } |
+ const String& fileName() const { return m_fileName; } |
+ double lastModified() const { return m_lastModified; } |
private: |
- StringView m_string; |
- float m_scaleFactor; |
+ bool m_isFile; |
+ String m_uuid; |
+ String m_type; // mime type |
+ long long m_size; |
+ String m_filePath; // only for File |
+ String m_fileName; // only for File |
+ double m_lastModified; // only for File |
}; |
-ImageCandidate bestFitSourceForSrcsetAttribute(float deviceScaleFactor, const String& srcsetAttribute); |
- |
-ImageCandidate bestFitSourceForImageAttributes(float deviceScaleFactor, const String& srcAttribute, const String& srcsetAttribute); |
- |
-String bestFitSourceForImageAttributes(float deviceScaleFactor, const String& srcAttribute, ImageCandidate& srcsetImageCandidate); |
- |
-} |
+} // namespace WebCore |
-#endif |
+#endif // BlobInfo_h |