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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 static PassRefPtr<WebSocketHandshakeRequest> create( | 54 static PassRefPtr<WebSocketHandshakeRequest> create( |
55 const WebSocketHandshakeRequest& request) { | 55 const WebSocketHandshakeRequest& request) { |
56 return adoptRef(new WebSocketHandshakeRequest(request)); | 56 return adoptRef(new WebSocketHandshakeRequest(request)); |
57 } | 57 } |
58 virtual ~WebSocketHandshakeRequest(); | 58 virtual ~WebSocketHandshakeRequest(); |
59 | 59 |
60 void addAndMergeHeader(const AtomicString& name, const AtomicString& value) { | 60 void addAndMergeHeader(const AtomicString& name, const AtomicString& value) { |
61 addAndMergeHeader(&m_headerFields, name, value); | 61 addAndMergeHeader(&m_headerFields, name, value); |
62 } | 62 } |
63 | 63 |
64 // Merges the existing value with |value| in |map| if |map| already has |name|
. | 64 // Merges the existing value with |value| in |map| if |map| already has |
65 // Associates |value| with |name| in |map| otherwise. | 65 // |name|. Associates |value| with |name| in |map| otherwise. |
66 // This function builds data for inspector. | 66 // This function builds data for inspector. |
67 static void addAndMergeHeader(HTTPHeaderMap* /* map */, | 67 static void addAndMergeHeader(HTTPHeaderMap* /* map */, |
68 const AtomicString& name, | 68 const AtomicString& name, |
69 const AtomicString& value); | 69 const AtomicString& value); |
70 | 70 |
71 void addHeaderField(const AtomicString& name, const AtomicString& value) { | 71 void addHeaderField(const AtomicString& name, const AtomicString& value) { |
72 m_headerFields.add(name, value); | 72 m_headerFields.add(name, value); |
73 } | 73 } |
74 | 74 |
75 KURL url() const { return m_url; } | 75 KURL url() const { return m_url; } |
76 void setURL(const KURL& url) { m_url = url; } | 76 void setURL(const KURL& url) { m_url = url; } |
77 const HTTPHeaderMap& headerFields() const { return m_headerFields; } | 77 const HTTPHeaderMap& headerFields() const { return m_headerFields; } |
78 const String& headersText() const { return m_headersText; } | 78 const String& headersText() const { return m_headersText; } |
79 void setHeadersText(const String& text) { m_headersText = text; } | 79 void setHeadersText(const String& text) { m_headersText = text; } |
80 | 80 |
81 private: | 81 private: |
82 WebSocketHandshakeRequest(const KURL&); | 82 WebSocketHandshakeRequest(const KURL&); |
83 WebSocketHandshakeRequest(); | 83 WebSocketHandshakeRequest(); |
84 WebSocketHandshakeRequest(const WebSocketHandshakeRequest&); | 84 WebSocketHandshakeRequest(const WebSocketHandshakeRequest&); |
85 | 85 |
86 KURL m_url; | 86 KURL m_url; |
87 HTTPHeaderMap m_headerFields; | 87 HTTPHeaderMap m_headerFields; |
88 String m_headersText; | 88 String m_headersText; |
89 }; | 89 }; |
90 | 90 |
91 } // namespace blink | 91 } // namespace blink |
92 | 92 |
93 #endif // WebSocketHandshakeRequest_h | 93 #endif // WebSocketHandshakeRequest_h |
OLD | NEW |