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

Side by Side Diff: Source/modules/websockets/MainThreadWebSocketChannel.h

Issue 222153002: Disallow connecting an insecure WebSocket from a secure page. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 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, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // You can specify the source file and the line number information 63 // You can specify the source file and the line number information
64 // explicitly by passing the last parameter. 64 // explicitly by passing the last parameter.
65 // In the usual case, they are set automatically and you don't have to 65 // In the usual case, they are set automatically and you don't have to
66 // pass it. 66 // pass it.
67 static PassRefPtr<MainThreadWebSocketChannel> create(Document* document, Web SocketChannelClient* client, const String& sourceURL = String(), unsigned lineNu mber = 0) { return adoptRef(new MainThreadWebSocketChannel(document, client, sou rceURL, lineNumber)); } 67 static PassRefPtr<MainThreadWebSocketChannel> create(Document* document, Web SocketChannelClient* client, const String& sourceURL = String(), unsigned lineNu mber = 0) { return adoptRef(new MainThreadWebSocketChannel(document, client, sou rceURL, lineNumber)); }
68 virtual ~MainThreadWebSocketChannel(); 68 virtual ~MainThreadWebSocketChannel();
69 69
70 bool send(const char* data, int length); 70 bool send(const char* data, int length);
71 71
72 // WebSocketChannel functions. 72 // WebSocketChannel functions.
73 virtual void connect(const KURL&, const String& protocol) OVERRIDE; 73 virtual bool connect(const KURL&, const String& protocol) OVERRIDE;
74 virtual String subprotocol() OVERRIDE; 74 virtual String subprotocol() OVERRIDE;
75 virtual String extensions() OVERRIDE; 75 virtual String extensions() OVERRIDE;
76 virtual WebSocketChannel::SendResult send(const String& message) OVERRIDE; 76 virtual WebSocketChannel::SendResult send(const String& message) OVERRIDE;
77 virtual WebSocketChannel::SendResult send(const ArrayBuffer&, unsigned byteO ffset, unsigned byteLength) OVERRIDE; 77 virtual WebSocketChannel::SendResult send(const ArrayBuffer&, unsigned byteO ffset, unsigned byteLength) OVERRIDE;
78 virtual WebSocketChannel::SendResult send(PassRefPtr<BlobDataHandle>) OVERRI DE; 78 virtual WebSocketChannel::SendResult send(PassRefPtr<BlobDataHandle>) OVERRI DE;
79 virtual unsigned long bufferedAmount() const OVERRIDE; 79 virtual unsigned long bufferedAmount() const OVERRIDE;
80 // Start closing handshake. Use the CloseEventCodeNotSpecified for the code 80 // Start closing handshake. Use the CloseEventCodeNotSpecified for the code
81 // argument to omit payload. 81 // argument to omit payload.
82 virtual void close(int code, const String& reason) OVERRIDE; 82 virtual void close(int code, const String& reason) OVERRIDE;
83 virtual void fail(const String& reason, MessageLevel, const String&, unsigne d lineNumber) OVERRIDE; 83 virtual void fail(const String& reason, MessageLevel, const String&, unsigne d lineNumber) OVERRIDE;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 unsigned m_lineNumberAtConstruction; 230 unsigned m_lineNumberAtConstruction;
231 231
232 WebSocketPerMessageDeflate m_perMessageDeflate; 232 WebSocketPerMessageDeflate m_perMessageDeflate;
233 233
234 WebSocketDeflateFramer m_deflateFramer; 234 WebSocketDeflateFramer m_deflateFramer;
235 }; 235 };
236 236
237 } // namespace WebCore 237 } // namespace WebCore
238 238
239 #endif // MainThreadWebSocketChannel_h 239 #endif // MainThreadWebSocketChannel_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698