OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 17 matching lines...) Expand all Loading... |
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 WebSocketHandshakeRequest_h | 31 #ifndef WebSocketHandshakeRequest_h |
32 #define WebSocketHandshakeRequest_h | 32 #define WebSocketHandshakeRequest_h |
33 | 33 |
34 #include "platform/network/HTTPRequest.h" | 34 #include "platform/network/HTTPRequest.h" |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
| 38 class HTTPHeaderMap; |
| 39 |
38 class PLATFORM_EXPORT WebSocketHandshakeRequest : public HTTPRequest { | 40 class PLATFORM_EXPORT WebSocketHandshakeRequest : public HTTPRequest { |
39 public: | 41 public: |
40 static PassRefPtr<WebSocketHandshakeRequest> create(const String& requestMet
hod, const KURL& url) { return adoptRef(new WebSocketHandshakeRequest(requestMet
hod, url)); } | 42 static PassRefPtr<WebSocketHandshakeRequest> create(const String& requestMet
hod, const KURL& url) { return adoptRef(new WebSocketHandshakeRequest(requestMet
hod, url)); } |
41 static PassRefPtr<WebSocketHandshakeRequest> create() { return adoptRef(new
WebSocketHandshakeRequest); } | 43 static PassRefPtr<WebSocketHandshakeRequest> create() { return adoptRef(new
WebSocketHandshakeRequest); } |
42 ~WebSocketHandshakeRequest(); | 44 ~WebSocketHandshakeRequest(); |
43 | 45 |
| 46 void addAndMergeHeader(const AtomicString& name, const AtomicString& value)
{ addAndMergeHeader(&m_headerFields, name, value); } |
| 47 |
| 48 // Merges the existing value with |value| in |map| if |map| already has |nam
e|. |
| 49 // Associates |value| with |name| in |map| otherwise. |
| 50 // This function builds data for inspector. |
| 51 static void addAndMergeHeader(HTTPHeaderMap* /* map */, const AtomicString&
name, const AtomicString& value); |
| 52 |
44 private: | 53 private: |
45 WebSocketHandshakeRequest(const String& requestMethod, const KURL&); | 54 WebSocketHandshakeRequest(const String& requestMethod, const KURL&); |
46 WebSocketHandshakeRequest(); | 55 WebSocketHandshakeRequest(); |
47 }; | 56 }; |
48 | 57 |
49 } // namespace WebCore | 58 } // namespace WebCore |
50 | 59 |
51 #endif // WebSocketHandshakeRequest_h | 60 #endif // WebSocketHandshakeRequest_h |
OLD | NEW |