| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #ifndef WebHTTPBody_h | 31 #ifndef WebHTTPBody_h |
| 32 #define WebHTTPBody_h | 32 #define WebHTTPBody_h |
| 33 | 33 |
| 34 #include "WebBlobData.h" | 34 #include "WebBlobData.h" |
| 35 #include "WebData.h" | 35 #include "WebData.h" |
| 36 #include "WebNonCopyable.h" | 36 #include "WebNonCopyable.h" |
| 37 #include "WebString.h" | 37 #include "WebString.h" |
| 38 #include "WebURL.h" | 38 #include "WebURL.h" |
| 39 | 39 |
| 40 #if BLINK_IMPLEMENTATION | 40 #if INSIDE_BLINK |
| 41 namespace WebCore { class FormData; } | 41 namespace WebCore { class FormData; } |
| 42 namespace WTF { template <typename T> class PassRefPtr; } | 42 namespace WTF { template <typename T> class PassRefPtr; } |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 namespace WebKit { | 45 namespace WebKit { |
| 46 | 46 |
| 47 class WebHTTPBodyPrivate; | 47 class WebHTTPBodyPrivate; |
| 48 | 48 |
| 49 class WebHTTPBody { | 49 class WebHTTPBody { |
| 50 public: | 50 public: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 62 ~WebHTTPBody() { reset(); } | 62 ~WebHTTPBody() { reset(); } |
| 63 | 63 |
| 64 WebHTTPBody() : m_private(0) { } | 64 WebHTTPBody() : m_private(0) { } |
| 65 WebHTTPBody(const WebHTTPBody& b) : m_private(0) { assign(b); } | 65 WebHTTPBody(const WebHTTPBody& b) : m_private(0) { assign(b); } |
| 66 WebHTTPBody& operator=(const WebHTTPBody& b) | 66 WebHTTPBody& operator=(const WebHTTPBody& b) |
| 67 { | 67 { |
| 68 assign(b); | 68 assign(b); |
| 69 return *this; | 69 return *this; |
| 70 } | 70 } |
| 71 | 71 |
| 72 BLINK_EXPORT void initialize(); | 72 BLINK_PLATFORM_EXPORT void initialize(); |
| 73 BLINK_EXPORT void reset(); | 73 BLINK_PLATFORM_EXPORT void reset(); |
| 74 BLINK_EXPORT void assign(const WebHTTPBody&); | 74 BLINK_PLATFORM_EXPORT void assign(const WebHTTPBody&); |
| 75 | 75 |
| 76 bool isNull() const { return !m_private; } | 76 bool isNull() const { return !m_private; } |
| 77 | 77 |
| 78 // Returns the number of elements comprising the http body. | 78 // Returns the number of elements comprising the http body. |
| 79 BLINK_EXPORT size_t elementCount() const; | 79 BLINK_PLATFORM_EXPORT size_t elementCount() const; |
| 80 | 80 |
| 81 // Sets the values of the element at the given index. Returns false if | 81 // Sets the values of the element at the given index. Returns false if |
| 82 // index is out of bounds. | 82 // index is out of bounds. |
| 83 BLINK_EXPORT bool elementAt(size_t index, Element&) const; | 83 BLINK_PLATFORM_EXPORT bool elementAt(size_t index, Element&) const; |
| 84 | 84 |
| 85 // Append to the list of elements. | 85 // Append to the list of elements. |
| 86 BLINK_EXPORT void appendData(const WebData&); | 86 BLINK_PLATFORM_EXPORT void appendData(const WebData&); |
| 87 BLINK_EXPORT void appendFile(const WebString&); | 87 BLINK_PLATFORM_EXPORT void appendFile(const WebString&); |
| 88 // Passing -1 to fileLength means to the end of the file. | 88 // Passing -1 to fileLength means to the end of the file. |
| 89 BLINK_EXPORT void appendFileRange(const WebString&, long long fileStart, lon
g long fileLength, double modificationTime); | 89 BLINK_PLATFORM_EXPORT void appendFileRange(const WebString&, long long fileS
tart, long long fileLength, double modificationTime); |
| 90 BLINK_EXPORT void appendBlob(const WebString& uuid); | 90 BLINK_PLATFORM_EXPORT void appendBlob(const WebString& uuid); |
| 91 | 91 |
| 92 // Append a resource which is identified by the FileSystem URL. | 92 // Append a resource which is identified by the FileSystem URL. |
| 93 BLINK_EXPORT void appendFileSystemURLRange(const WebURL&, long long start, l
ong long length, double modificationTime); | 93 BLINK_PLATFORM_EXPORT void appendFileSystemURLRange(const WebURL&, long long
start, long long length, double modificationTime); |
| 94 | 94 |
| 95 // Identifies a particular form submission instance. A value of 0 is | 95 // Identifies a particular form submission instance. A value of 0 is |
| 96 // used to indicate an unspecified identifier. | 96 // used to indicate an unspecified identifier. |
| 97 BLINK_EXPORT long long identifier() const; | 97 BLINK_PLATFORM_EXPORT long long identifier() const; |
| 98 BLINK_EXPORT void setIdentifier(long long); | 98 BLINK_PLATFORM_EXPORT void setIdentifier(long long); |
| 99 | 99 |
| 100 BLINK_EXPORT bool containsPasswordData() const; | 100 BLINK_PLATFORM_EXPORT bool containsPasswordData() const; |
| 101 BLINK_EXPORT void setContainsPasswordData(bool); | 101 BLINK_PLATFORM_EXPORT void setContainsPasswordData(bool); |
| 102 | 102 |
| 103 #if BLINK_IMPLEMENTATION | 103 #if INSIDE_BLINK |
| 104 WebHTTPBody(const WTF::PassRefPtr<WebCore::FormData>&); | 104 BLINK_PLATFORM_EXPORT WebHTTPBody(const WTF::PassRefPtr<WebCore::FormData>&)
; |
| 105 WebHTTPBody& operator=(const WTF::PassRefPtr<WebCore::FormData>&); | 105 BLINK_PLATFORM_EXPORT WebHTTPBody& operator=(const WTF::PassRefPtr<WebCore::
FormData>&); |
| 106 operator WTF::PassRefPtr<WebCore::FormData>() const; | 106 BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<WebCore::FormData>() const; |
| 107 #endif | 107 #endif |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 void assign(WebHTTPBodyPrivate*); | 110 BLINK_PLATFORM_EXPORT void assign(WebHTTPBodyPrivate*); |
| 111 void ensureMutable(); | 111 BLINK_PLATFORM_EXPORT void ensureMutable(); |
| 112 |
| 112 WebHTTPBodyPrivate* m_private; | 113 WebHTTPBodyPrivate* m_private; |
| 113 }; | 114 }; |
| 114 | 115 |
| 115 } // namespace WebKit | 116 } // namespace WebKit |
| 116 | 117 |
| 117 #endif | 118 #endif |
| OLD | NEW |