OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * |
| 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are |
| 6 * met: |
| 7 * |
| 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above |
| 11 * copyright notice, this list of conditions and the following disclaimer |
| 12 * in the documentation and/or other materials provided with the |
| 13 * distribution. |
| 14 * * Neither the name of Google Inc. nor the names of its |
| 15 * contributors may be used to endorse or promote products derived from |
| 16 * this software without specific prior written permission. |
| 17 * |
| 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ |
| 30 |
| 31 #ifndef WebBlobInfo_h |
| 32 #define WebBlobInfo_h |
| 33 |
| 34 #include "WebCommon.h" |
| 35 #include "WebString.h" |
| 36 |
| 37 #if INSIDE_WEBKIT |
| 38 namespace WebCore { class BlobInfo; } |
| 39 #endif |
| 40 |
| 41 namespace WebKit { |
| 42 |
| 43 class WebBlobInfo { |
| 44 public: |
| 45 WebBlobInfo() |
| 46 : m_isFile(false) |
| 47 , m_size(-1) |
| 48 , m_lastModified(0) |
| 49 { |
| 50 } |
| 51 WebBlobInfo(const WebString& url, const WebString& type, long long size) |
| 52 : m_isFile(false) |
| 53 , m_url(url) |
| 54 , m_type(type) |
| 55 , m_size(size) |
| 56 , m_lastModified(0) |
| 57 { |
| 58 } |
| 59 WebBlobInfo(const WebString& url, const WebString& filePath, const WebString
& fileName, const WebString& type) |
| 60 : m_isFile(true) |
| 61 , m_url(url) |
| 62 , m_type(type) |
| 63 , m_size(-1) |
| 64 , m_filePath(filePath) |
| 65 , m_fileName(fileName) |
| 66 , m_lastModified(0) |
| 67 { |
| 68 } |
| 69 WebBlobInfo(const WebString& url, const WebString& filePath, const WebString
& fileName, const WebString& type, double lastModified, long long size) |
| 70 : m_isFile(true) |
| 71 , m_url(url) |
| 72 , m_type(type) |
| 73 , m_size(size) |
| 74 , m_filePath(filePath) |
| 75 , m_fileName(fileName) |
| 76 , m_lastModified(lastModified) |
| 77 { |
| 78 } |
| 79 bool isFile() const { return m_isFile; } |
| 80 const WebString& url() const { return m_url; } |
| 81 const WebString& type() const { return m_type; } |
| 82 long long size() const { return m_size; } |
| 83 const WebString& filePath() const { return m_filePath; } |
| 84 const WebString& fileName() const { return m_fileName; } |
| 85 double lastModified() const { return m_lastModified; } |
| 86 |
| 87 #if INSIDE_WEBKIT |
| 88 BLINK_COMMON_EXPORT operator WebCore::BlobInfo() const; |
| 89 #endif |
| 90 |
| 91 private: |
| 92 bool m_isFile; |
| 93 WebString m_url; |
| 94 WebString m_type; |
| 95 long long m_size; |
| 96 WebString m_filePath; |
| 97 WebString m_fileName; |
| 98 double m_lastModified; |
| 99 }; |
| 100 |
| 101 } // namespace WebKit |
| 102 |
| 103 #endif |
OLD | NEW |