OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 10 matching lines...) Expand all Loading... |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 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. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef LayerRect_h | 31 #ifndef BlobInfo_h |
32 #define LayerRect_h | 32 #define BlobInfo_h |
33 | 33 |
34 #include "core/dom/ClientRect.h" | 34 #include "core/platform/FileSystem.h" |
35 | |
36 #include "wtf/PassRefPtr.h" | |
37 #include "wtf/RefCounted.h" | |
38 #include "wtf/RefPtr.h" | |
39 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
40 | 36 |
41 namespace WebCore { | 37 namespace WebCore { |
42 | 38 |
43 class Node; | 39 class BlobInfo { |
44 | |
45 class LayerRect : public RefCounted<LayerRect> { | |
46 public: | 40 public: |
47 static PassRefPtr<LayerRect> create(PassRefPtr<Node> node, const String& lay
erType, PassRefPtr<ClientRect> rect) | 41 BlobInfo() |
| 42 : m_isFile(false) |
| 43 , m_size(-1) |
48 { | 44 { |
49 return adoptRef(new LayerRect(node, layerType, rect)); | |
50 } | 45 } |
51 | 46 BlobInfo(const String& url, const String& type, long long size) |
52 Node* layerRootNode() const { return m_layerRootNode.get(); } | 47 : m_isFile(false) |
53 String layerType() const { return m_layerType; } | 48 , m_url(url) |
54 ClientRect* layerRelativeRect() const { return m_rect.get(); } | 49 , m_type(type) |
55 | 50 , m_size(size) |
56 private: | 51 , m_lastModified(0) |
57 LayerRect(PassRefPtr<Node> node, const String& layerName, PassRefPtr<ClientR
ect> rect) | 52 { |
58 : m_layerRootNode(node) | 53 } |
59 , m_layerType(layerName) | 54 BlobInfo(const String& url, const String& filePath, const String& fileName,
const String& type, double lastModified, long long size) |
60 , m_rect(rect) | 55 : m_isFile(true) |
| 56 , m_url(url) |
| 57 , m_type(type) |
| 58 , m_size(size) |
| 59 , m_filePath(filePath) |
| 60 , m_fileName(fileName) |
| 61 , m_lastModified(lastModified) |
| 62 { |
| 63 } |
| 64 BlobInfo(const String& filePath, const String& fileName, const String& type) |
| 65 : m_isFile(true) |
| 66 , m_type(type) |
| 67 , m_size(-1) |
| 68 , m_filePath(filePath) |
| 69 , m_fileName(fileName) |
| 70 , m_lastModified(0) |
61 { | 71 { |
62 } | 72 } |
63 | 73 |
64 RefPtr<Node> m_layerRootNode; | 74 bool isFile() const { return m_isFile; } |
65 String m_layerType; | 75 const String& url() const { return m_url; } |
66 RefPtr<ClientRect> m_rect; | 76 const String& type() const { return m_type; } |
| 77 long long size() const { return m_size; } |
| 78 const String& filePath() const { return m_filePath; } |
| 79 const String& fileName() const { return m_fileName; } |
| 80 double lastModified() const { return m_lastModified; } |
| 81 |
| 82 private: |
| 83 bool m_isFile; |
| 84 String m_url; |
| 85 String m_type; // mime type |
| 86 long long m_size; |
| 87 String m_filePath; // only for File |
| 88 String m_fileName; // only for File |
| 89 double m_lastModified; // only for File |
67 }; | 90 }; |
68 | 91 |
69 } // namespace WebCore | 92 } // namespace WebCore |
70 | 93 |
71 #endif | 94 #endif // BlobInfo_h |
OLD | NEW |