summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/html/Blob.h
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@nokia.com>2010-04-06 10:36:47 (GMT)
committerJocelyn Turcotte <jocelyn.turcotte@nokia.com>2010-04-06 10:36:47 (GMT)
commitbb35b65bbfba82e0dd0ac306d3dab54436cdaff6 (patch)
tree8174cb262a960ff7b2e4aa8f1aaf154db71d2636 /src/3rdparty/webkit/WebCore/html/Blob.h
parent4b27d0d887269583a0f76e922948f8c25e96ab88 (diff)
downloadQt-bb35b65bbfba82e0dd0ac306d3dab54436cdaff6.zip
Qt-bb35b65bbfba82e0dd0ac306d3dab54436cdaff6.tar.gz
Qt-bb35b65bbfba82e0dd0ac306d3dab54436cdaff6.tar.bz2
Update src/3rdparty/webkit from trunk.
Imported from 839d8709327f925aacb3b6362c06152594def97e in branch qtwebkit-2.0 of repository git://gitorious.org/+qtwebkit-developers/webkit/qtwebkit.git Rubber-stamped-by: Simon Hausmann
Diffstat (limited to 'src/3rdparty/webkit/WebCore/html/Blob.h')
-rw-r--r--src/3rdparty/webkit/WebCore/html/Blob.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/WebCore/html/Blob.h b/src/3rdparty/webkit/WebCore/html/Blob.h
new file mode 100644
index 0000000..610842e
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/html/Blob.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef Blob_h
+#define Blob_h
+
+#include "ExceptionCode.h"
+#include "PlatformString.h"
+#include <time.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class Blob : public RefCounted<Blob> {
+public:
+#if ENABLE(BLOB_SLICE)
+ static const int toEndOfFile;
+ static const double doNotCheckFileChange;
+#endif
+
+ static PassRefPtr<Blob> create(const String& path)
+ {
+ return adoptRef(new Blob(path));
+ }
+
+ virtual ~Blob() { }
+
+#if ENABLE(BLOB_SLICE)
+ PassRefPtr<Blob> slice(long long start, long long length) const;
+#endif
+
+ const String& path() const { return m_path; }
+ unsigned long long size() const;
+#if ENABLE(BLOB_SLICE)
+ long long start() const { return m_start; }
+ long long length() const { return m_length; }
+ double modificationTime() const { return m_snapshotModificationTime; }
+#endif
+
+protected:
+ Blob(const String& path);
+
+private:
+#if ENABLE(BLOB_SLICE)
+ Blob(const String& path, long long start, long long length, long long snapshotSize, double snapshotModificationTime);
+#endif
+
+ // The underlying path of the file-based blob.
+ String m_path;
+
+#if ENABLE(BLOB_SLICE)
+ // The starting position of the file-based blob.
+ long long m_start;
+
+ // The length of the file-based blob. The value of -1 means to the end of the file.
+ long long m_length;
+
+ // A flag to tell if a snapshot has been captured.
+ bool m_snapshotCaptured;
+
+ // The size of the file when a snapshot is captured. It can be 0 if the file is empty.
+ long long m_snapshotSize;
+
+ // The last modification time of the file when a snapshot is captured. The value of 0 also means that the snapshot is not captured.
+ double m_snapshotModificationTime;
+#endif
+};
+
+} // namespace WebCore
+
+#endif // Blob_h