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 #include "chrome/browser/chromeos/web_socket_proxy.h" | 5 #include "chrome/browser/chromeos/web_socket_proxy.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 #include "base/base64.h" | 26 #include "base/base64.h" |
27 #include "base/basictypes.h" | 27 #include "base/basictypes.h" |
28 #include "base/logging.h" | 28 #include "base/logging.h" |
29 #include "base/md5.h" | 29 #include "base/md5.h" |
30 #include "base/memory/scoped_ptr.h" | 30 #include "base/memory/scoped_ptr.h" |
31 #include "base/string_number_conversions.h" | 31 #include "base/string_number_conversions.h" |
32 #include "base/string_util.h" | 32 #include "base/string_util.h" |
33 #include "chrome/browser/internal_auth.h" | 33 #include "chrome/browser/internal_auth.h" |
34 #include "content/browser/browser_thread.h" | 34 #include "content/browser/browser_thread.h" |
| 35 #include "content/common/content_notification_types.h" |
35 #include "content/common/notification_service.h" | 36 #include "content/common/notification_service.h" |
36 #include "content/common/notification_type.h" | |
37 #include "content/common/url_constants.h" | 37 #include "content/common/url_constants.h" |
38 #include "googleurl/src/gurl.h" | 38 #include "googleurl/src/gurl.h" |
39 #include "third_party/libevent/evdns.h" | 39 #include "third_party/libevent/evdns.h" |
40 #include "third_party/libevent/event.h" | 40 #include "third_party/libevent/event.h" |
41 | 41 |
42 namespace chromeos { | 42 namespace chromeos { |
43 | 43 |
44 namespace { | 44 namespace { |
45 | 45 |
46 const uint8 kCRLF[] = "\r\n"; | 46 const uint8 kCRLF[] = "\r\n"; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 return std::string(); | 146 return std::string(); |
147 } | 147 } |
148 | 148 |
149 inline size_t strlen(const uint8* s) { | 149 inline size_t strlen(const uint8* s) { |
150 return ::strlen(reinterpret_cast<const char*>(s)); | 150 return ::strlen(reinterpret_cast<const char*>(s)); |
151 } | 151 } |
152 | 152 |
153 void SendNotification() { | 153 void SendNotification() { |
154 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 154 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
155 NotificationService::current()->Notify( | 155 NotificationService::current()->Notify( |
156 NotificationType::WEB_SOCKET_PROXY_STARTED, | 156 chrome::WEB_SOCKET_PROXY_STARTED, |
157 NotificationService::AllSources(), NotificationService::NoDetails()); | 157 NotificationService::AllSources(), NotificationService::NoDetails()); |
158 } | 158 } |
159 | 159 |
160 class Conn; | 160 class Conn; |
161 | 161 |
162 // Websocket to TCP proxy server. | 162 // Websocket to TCP proxy server. |
163 class Serv { | 163 class Serv { |
164 public: | 164 public: |
165 Serv(const std::vector<std::string>& allowed_origins, | 165 Serv(const std::vector<std::string>& allowed_origins, |
166 struct sockaddr* addr, int addr_len); | 166 struct sockaddr* addr, int addr_len); |
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 void WebSocketProxy::Run() { | 1288 void WebSocketProxy::Run() { |
1289 static_cast<Serv*>(impl_)->Run(); | 1289 static_cast<Serv*>(impl_)->Run(); |
1290 } | 1290 } |
1291 | 1291 |
1292 void WebSocketProxy::Shutdown() { | 1292 void WebSocketProxy::Shutdown() { |
1293 static_cast<Serv*>(impl_)->Shutdown(); | 1293 static_cast<Serv*>(impl_)->Shutdown(); |
1294 } | 1294 } |
1295 | 1295 |
1296 } // namespace chromeos | 1296 } // namespace chromeos |
1297 | 1297 |
OLD | NEW |