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

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

Issue 15232002: Make remaining modules/ objects ScriptWrappable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Source/modules/websockets/WebSocket.h ('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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 WebSocket::WebSocket(ScriptExecutionContext* context) 133 WebSocket::WebSocket(ScriptExecutionContext* context)
134 : ActiveDOMObject(context) 134 : ActiveDOMObject(context)
135 , m_state(CONNECTING) 135 , m_state(CONNECTING)
136 , m_bufferedAmount(0) 136 , m_bufferedAmount(0)
137 , m_bufferedAmountAfterClose(0) 137 , m_bufferedAmountAfterClose(0)
138 , m_binaryType(BinaryTypeBlob) 138 , m_binaryType(BinaryTypeBlob)
139 , m_subprotocol("") 139 , m_subprotocol("")
140 , m_extensions("") 140 , m_extensions("")
141 { 141 {
142 ScriptWrappable::init(this);
142 } 143 }
143 144
144 WebSocket::~WebSocket() 145 WebSocket::~WebSocket()
145 { 146 {
146 if (m_channel) 147 if (m_channel)
147 m_channel->disconnect(); 148 m_channel->disconnect();
148 } 149 }
149 150
150 PassRefPtr<WebSocket> WebSocket::create(ScriptExecutionContext* context) 151 PassRefPtr<WebSocket> WebSocket::create(ScriptExecutionContext* context)
151 { 152 {
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 static const size_t minimumPayloadSizeWithEightByteExtendedPayloadLength = 0 x10000; 600 static const size_t minimumPayloadSizeWithEightByteExtendedPayloadLength = 0 x10000;
600 size_t overhead = hybiBaseFramingOverhead + hybiMaskingKeyLength; 601 size_t overhead = hybiBaseFramingOverhead + hybiMaskingKeyLength;
601 if (payloadSize >= minimumPayloadSizeWithEightByteExtendedPayloadLength) 602 if (payloadSize >= minimumPayloadSizeWithEightByteExtendedPayloadLength)
602 overhead += 8; 603 overhead += 8;
603 else if (payloadSize >= minimumPayloadSizeWithTwoByteExtendedPayloadLength) 604 else if (payloadSize >= minimumPayloadSizeWithTwoByteExtendedPayloadLength)
604 overhead += 2; 605 overhead += 2;
605 return overhead; 606 return overhead;
606 } 607 }
607 608
608 } // namespace WebCore 609 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/websockets/WebSocket.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698