Index: Source/platform/blob/BlobInfo.h |
diff --git a/Source/platform/blob/BlobInfo.h b/Source/platform/blob/BlobInfo.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..18c39595d76909bf5a0be9bb85fb0f3dfcf1f3ec |
--- /dev/null |
+++ b/Source/platform/blob/BlobInfo.h |
@@ -0,0 +1,70 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef BlobInfo_h |
+#define BlobInfo_h |
+ |
+#include "wtf/text/WTFString.h" |
+ |
+namespace WebCore { |
+ |
+class BlobInfo { |
abarth-chromium
2014/04/01 21:48:04
You might not need this class. Code that would us
|
+public: |
+ BlobInfo() |
+ : m_isFile(false) |
+ , m_size(-1) |
+ , m_lastModified(0) |
+ { |
+ } |
+ 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) |
+ { |
+ ASSERT(size >= 0); |
+ } |
+ 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) |
+ { |
+ } |
+ 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) |
+ { |
+ } |
+ |
+ 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: |
+ 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 |
+}; |
+ |
+} // namespace WebCore |
+ |
+#endif // BlobInfo_h |