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

Side by Side Diff: Source/modules/websockets/WebSocketHandshake.cpp

Issue 15451002: Start collecting two new WebSocket histograms. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add comment about reset() Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 21 matching lines...) Expand all
32 #include "config.h" 32 #include "config.h"
33 33
34 #include "modules/websockets/WebSocket.h" 34 #include "modules/websockets/WebSocket.h"
35 #include "modules/websockets/WebSocketHandshake.h" 35 #include "modules/websockets/WebSocketHandshake.h"
36 36
37 #include "core/dom/Document.h" 37 #include "core/dom/Document.h"
38 #include "core/dom/ScriptExecutionContext.h" 38 #include "core/dom/ScriptExecutionContext.h"
39 #include "core/inspector/ScriptCallStack.h" 39 #include "core/inspector/ScriptCallStack.h"
40 #include "core/loader/CookieJar.h" 40 #include "core/loader/CookieJar.h"
41 #include "core/platform/Cookie.h" 41 #include "core/platform/Cookie.h"
42 #include "core/platform/HistogramSupport.h"
42 #include "core/platform/KURL.h" 43 #include "core/platform/KURL.h"
43 #include "core/platform/Logging.h" 44 #include "core/platform/Logging.h"
44 #include "core/platform/network/HTTPHeaderMap.h" 45 #include "core/platform/network/HTTPHeaderMap.h"
45 #include "core/platform/network/HTTPParsers.h" 46 #include "core/platform/network/HTTPParsers.h"
46 #include "weborigin/SecurityOrigin.h" 47 #include "weborigin/SecurityOrigin.h"
47 #include "wtf/CryptographicallyRandomNumber.h" 48 #include "wtf/CryptographicallyRandomNumber.h"
48 #include "wtf/MD5.h" 49 #include "wtf/MD5.h"
49 #include "wtf/SHA1.h" 50 #include "wtf/SHA1.h"
50 #include "wtf/StdLibExtras.h" 51 #include "wtf/StdLibExtras.h"
51 #include "wtf/StringExtras.h" 52 #include "wtf/StringExtras.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 , m_secure(m_url.protocolIs("wss")) 125 , m_secure(m_url.protocolIs("wss"))
125 , m_context(context) 126 , m_context(context)
126 , m_mode(Incomplete) 127 , m_mode(Incomplete)
127 { 128 {
128 m_secWebSocketKey = generateSecWebSocketKey(); 129 m_secWebSocketKey = generateSecWebSocketKey();
129 m_expectedAccept = getExpectedWebSocketAccept(m_secWebSocketKey); 130 m_expectedAccept = getExpectedWebSocketAccept(m_secWebSocketKey);
130 } 131 }
131 132
132 WebSocketHandshake::~WebSocketHandshake() 133 WebSocketHandshake::~WebSocketHandshake()
133 { 134 {
135 HistogramSupport::histogramEnumeration("WebCore.WebSocket.HandshakeResult", m_mode, WebSocketHandshake::ModeMax);
134 } 136 }
135 137
136 const KURL& WebSocketHandshake::url() const 138 const KURL& WebSocketHandshake::url() const
137 { 139 {
138 return m_url; 140 return m_url;
139 } 141 }
140 142
141 void WebSocketHandshake::setURL(const KURL& url) 143 void WebSocketHandshake::setURL(const KURL& url)
142 { 144 {
143 m_url = url.copy(); 145 m_url = url.copy();
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 m_clientProtocol.split(String(WebSocket::subProtocolSeperator()), result ); 547 m_clientProtocol.split(String(WebSocket::subProtocolSeperator()), result );
546 if (!result.contains(serverWebSocketProtocol)) { 548 if (!result.contains(serverWebSocketProtocol)) {
547 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-P rotocol mismatch"; 549 m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-P rotocol mismatch";
548 return false; 550 return false;
549 } 551 }
550 } 552 }
551 return true; 553 return true;
552 } 554 }
553 555
554 } // namespace WebCore 556 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/websockets/WebSocketHandshake.h ('k') | Source/modules/websockets/WebSocketPerMessageDeflate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698