OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_WEBSOCKETS_WEBSOCKET_JOB_H_ | 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_JOB_H_ |
6 #define NET_WEBSOCKETS_WEBSOCKET_JOB_H_ | 6 #define NET_WEBSOCKETS_WEBSOCKET_JOB_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
asanka
2011/10/28 14:39:40
Not needed.
| |
14 #include "net/base/address_list.h" | 14 #include "net/base/address_list.h" |
15 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
16 #include "net/socket_stream/socket_stream_job.h" | 16 #include "net/socket_stream/socket_stream_job.h" |
17 #include "net/spdy/spdy_websocket_stream.h" | 17 #include "net/spdy/spdy_websocket_stream.h" |
18 | 18 |
19 class GURL; | 19 class GURL; |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 | 22 |
23 class DrainableIOBuffer; | 23 class DrainableIOBuffer; |
(...skipping 26 matching lines...) Expand all Loading... | |
50 static void EnsureInit(); | 50 static void EnsureInit(); |
51 | 51 |
52 // Enable or Disable WebSocket over SPDY feature. | 52 // Enable or Disable WebSocket over SPDY feature. |
53 // This function is intended to be called before I/O thread starts. | 53 // This function is intended to be called before I/O thread starts. |
54 static void set_websocket_over_spdy_enabled(bool enabled); | 54 static void set_websocket_over_spdy_enabled(bool enabled); |
55 | 55 |
56 State state() const { return state_; } | 56 State state() const { return state_; } |
57 virtual void Connect(); | 57 virtual void Connect(); |
58 virtual bool SendData(const char* data, int len); | 58 virtual bool SendData(const char* data, int len); |
59 virtual void Close(); | 59 virtual void Close(); |
60 virtual void RestartWithAuth( | 60 virtual void RestartWithAuth(const AuthCredentials& credentials); |
61 const string16& username, | |
62 const string16& password); | |
63 virtual void DetachDelegate(); | 61 virtual void DetachDelegate(); |
64 | 62 |
65 // SocketStream::Delegate methods. | 63 // SocketStream::Delegate methods. |
66 virtual int OnStartOpenConnection( | 64 virtual int OnStartOpenConnection( |
67 SocketStream* socket, OldCompletionCallback* callback); | 65 SocketStream* socket, OldCompletionCallback* callback); |
68 virtual void OnConnected(SocketStream* socket, int max_pending_send_allowed); | 66 virtual void OnConnected(SocketStream* socket, int max_pending_send_allowed); |
69 virtual void OnSentData(SocketStream* socket, int amount_sent); | 67 virtual void OnSentData(SocketStream* socket, int amount_sent); |
70 virtual void OnReceivedData(SocketStream* socket, const char* data, int len); | 68 virtual void OnReceivedData(SocketStream* socket, const char* data, int len); |
71 virtual void OnClose(SocketStream* socket); | 69 virtual void OnClose(SocketStream* socket); |
72 virtual void OnAuthRequired( | 70 virtual void OnAuthRequired( |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 | 137 |
140 ScopedRunnableMethodFactory<WebSocketJob> method_factory_; | 138 ScopedRunnableMethodFactory<WebSocketJob> method_factory_; |
141 base::WeakPtrFactory<WebSocketJob> weak_ptr_factory_; | 139 base::WeakPtrFactory<WebSocketJob> weak_ptr_factory_; |
142 | 140 |
143 DISALLOW_COPY_AND_ASSIGN(WebSocketJob); | 141 DISALLOW_COPY_AND_ASSIGN(WebSocketJob); |
144 }; | 142 }; |
145 | 143 |
146 } // namespace | 144 } // namespace |
147 | 145 |
148 #endif // NET_WEBSOCKETS_WEBSOCKET_JOB_H_ | 146 #endif // NET_WEBSOCKETS_WEBSOCKET_JOB_H_ |
OLD | NEW |