Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Side by Side Diff: Source/platform/network/WebSocketHandshakeRequest.h

Issue 130863002: [WebSocket] Merge duplicated HTTP headers for devtools (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
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 WebSocketHandshakeRequest_h 31 #ifndef WebSocketHandshakeRequest_h
32 #define WebSocketHandshakeRequest_h 32 #define WebSocketHandshakeRequest_h
33 33
34 #include "platform/network/HTTPHeaderMap.h"
tkent 2014/01/14 00:25:14 Do we need to include this?
yhirano 2014/01/14 01:17:04 Done.
34 #include "platform/network/HTTPRequest.h" 35 #include "platform/network/HTTPRequest.h"
35 36
36 namespace WebCore { 37 namespace WebCore {
37 38
38 class PLATFORM_EXPORT WebSocketHandshakeRequest : public HTTPRequest { 39 class PLATFORM_EXPORT WebSocketHandshakeRequest : public HTTPRequest {
39 public: 40 public:
40 static PassRefPtr<WebSocketHandshakeRequest> create(const String& requestMet hod, const KURL& url) { return adoptRef(new WebSocketHandshakeRequest(requestMet hod, url)); } 41 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); } 42 static PassRefPtr<WebSocketHandshakeRequest> create() { return adoptRef(new WebSocketHandshakeRequest); }
42 ~WebSocketHandshakeRequest(); 43 ~WebSocketHandshakeRequest();
43 44
45 void addAndMergeHeader(const AtomicString& name, const AtomicString& value) { addAndMergeHeader(&m_headerFields, name, value); }
46
47 // Merges the existing value with |value| in |map| if |map| already has |nam e|.
48 // Associates |value| with |name| in |map| otherwise.
49 // This function builds data for inspector.
50 static void addAndMergeHeader(HTTPHeaderMap* /* map */, const AtomicString& name, const AtomicString& value);
51
44 private: 52 private:
45 WebSocketHandshakeRequest(const String& requestMethod, const KURL&); 53 WebSocketHandshakeRequest(const String& requestMethod, const KURL&);
46 WebSocketHandshakeRequest(); 54 WebSocketHandshakeRequest();
47 }; 55 };
48 56
49 } // namespace WebCore 57 } // namespace WebCore
50 58
51 #endif // WebSocketHandshakeRequest_h 59 #endif // WebSocketHandshakeRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698