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

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

Issue 236013006: Remove completeURL() call from WebSocket construction code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated virtual/stable Created 6 years, 8 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
« no previous file with comments | « LayoutTests/virtual/stable/http/tests/websocket/url-parsing-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 PassRefPtr<WebSocket> WebSocket::create(ExecutionContext* context, const String& url, const Vector<String>& protocols, ExceptionState& exceptionState) 251 PassRefPtr<WebSocket> WebSocket::create(ExecutionContext* context, const String& url, const Vector<String>& protocols, ExceptionState& exceptionState)
252 { 252 {
253 if (url.isNull()) { 253 if (url.isNull()) {
254 exceptionState.throwDOMException(SyntaxError, "Failed to create a WebSoc ket: the provided URL is invalid."); 254 exceptionState.throwDOMException(SyntaxError, "Failed to create a WebSoc ket: the provided URL is invalid.");
255 return nullptr; 255 return nullptr;
256 } 256 }
257 257
258 RefPtr<WebSocket> webSocket(adoptRef(new WebSocket(context))); 258 RefPtr<WebSocket> webSocket(adoptRef(new WebSocket(context)));
259 webSocket->suspendIfNeeded(); 259 webSocket->suspendIfNeeded();
260 260
261 webSocket->connect(context->completeURL(url), protocols, exceptionState); 261 webSocket->connect(url, protocols, exceptionState);
262 if (exceptionState.hadException()) 262 if (exceptionState.hadException())
263 return nullptr; 263 return nullptr;
264 264
265 return webSocket.release(); 265 return webSocket.release();
266 } 266 }
267 267
268 PassRefPtr<WebSocket> WebSocket::create(ExecutionContext* context, const String& url, const String& protocol, ExceptionState& exceptionState) 268 PassRefPtr<WebSocket> WebSocket::create(ExecutionContext* context, const String& url, const String& protocol, ExceptionState& exceptionState)
269 { 269 {
270 Vector<String> protocols; 270 Vector<String> protocols;
271 protocols.append(protocol); 271 protocols.append(protocol);
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 static const size_t minimumPayloadSizeWithEightByteExtendedPayloadLength = 0 x10000; 681 static const size_t minimumPayloadSizeWithEightByteExtendedPayloadLength = 0 x10000;
682 size_t overhead = hybiBaseFramingOverhead + hybiMaskingKeyLength; 682 size_t overhead = hybiBaseFramingOverhead + hybiMaskingKeyLength;
683 if (payloadSize >= minimumPayloadSizeWithEightByteExtendedPayloadLength) 683 if (payloadSize >= minimumPayloadSizeWithEightByteExtendedPayloadLength)
684 overhead += 8; 684 overhead += 8;
685 else if (payloadSize >= minimumPayloadSizeWithTwoByteExtendedPayloadLength) 685 else if (payloadSize >= minimumPayloadSizeWithTwoByteExtendedPayloadLength)
686 overhead += 2; 686 overhead += 2;
687 return overhead; 687 return overhead;
688 } 688 }
689 689
690 } // namespace WebCore 690 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/virtual/stable/http/tests/websocket/url-parsing-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698