| 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 18 matching lines...) Expand all Loading... |
| 29 #include "base/memory/ref_counted.h" | 29 #include "base/memory/ref_counted.h" |
| 30 #include "base/memory/scoped_ptr.h" | 30 #include "base/memory/scoped_ptr.h" |
| 31 #include "base/sha1.h" | 31 #include "base/sha1.h" |
| 32 #include "base/stl_util.h" | 32 #include "base/stl_util.h" |
| 33 #include "base/string_number_conversions.h" | 33 #include "base/string_number_conversions.h" |
| 34 #include "base/string_util.h" | 34 #include "base/string_util.h" |
| 35 #include "chrome/browser/internal_auth.h" | 35 #include "chrome/browser/internal_auth.h" |
| 36 #include "chrome/common/chrome_notification_types.h" | 36 #include "chrome/common/chrome_notification_types.h" |
| 37 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
| 38 #include "content/browser/browser_thread.h" | 38 #include "content/browser/browser_thread.h" |
| 39 #include "content/common/notification_service.h" | |
| 40 #include "content/public/browser/notification_details.h" | 39 #include "content/public/browser/notification_details.h" |
| 40 #include "content/public/browser/notification_service.h" |
| 41 #include "content/public/browser/notification_types.h" | 41 #include "content/public/browser/notification_types.h" |
| 42 #include "content/public/common/url_constants.h" | 42 #include "content/public/common/url_constants.h" |
| 43 #include "googleurl/src/gurl.h" | 43 #include "googleurl/src/gurl.h" |
| 44 #include "googleurl/src/url_parse.h" | 44 #include "googleurl/src/url_parse.h" |
| 45 #include "net/base/address_list.h" | 45 #include "net/base/address_list.h" |
| 46 #include "net/base/cert_verifier.h" | 46 #include "net/base/cert_verifier.h" |
| 47 #include "net/base/host_port_pair.h" | 47 #include "net/base/host_port_pair.h" |
| 48 #include "net/base/io_buffer.h" | 48 #include "net/base/io_buffer.h" |
| 49 #include "net/base/net_errors.h" | 49 #include "net/base/net_errors.h" |
| 50 #include "net/base/ssl_config_service.h" | 50 #include "net/base/ssl_config_service.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 else | 185 else |
| 186 return std::string(); | 186 return std::string(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 inline size_t strlen(const void* s) { | 189 inline size_t strlen(const void* s) { |
| 190 return ::strlen(static_cast<const char*>(s)); | 190 return ::strlen(static_cast<const char*>(s)); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void SendNotification(int port) { | 193 void SendNotification(int port) { |
| 194 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 194 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 195 NotificationService::current()->Notify( | 195 content::NotificationService::current()->Notify( |
| 196 chrome::NOTIFICATION_WEB_SOCKET_PROXY_STARTED, | 196 chrome::NOTIFICATION_WEB_SOCKET_PROXY_STARTED, |
| 197 NotificationService::AllSources(), content::Details<int>(&port)); | 197 content::NotificationService::AllSources(), content::Details<int>(&port)); |
| 198 } | 198 } |
| 199 | 199 |
| 200 class Conn; | 200 class Conn; |
| 201 | 201 |
| 202 // Websocket to TCP proxy server. | 202 // Websocket to TCP proxy server. |
| 203 class Serv { | 203 class Serv { |
| 204 public: | 204 public: |
| 205 explicit Serv(const std::vector<std::string>& allowed_origins); | 205 explicit Serv(const std::vector<std::string>& allowed_origins); |
| 206 ~Serv(); | 206 ~Serv(); |
| 207 | 207 |
| (...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1924 | 1924 |
| 1925 void WebSocketProxy::Shutdown() { | 1925 void WebSocketProxy::Shutdown() { |
| 1926 static_cast<Serv*>(impl_)->Shutdown(); | 1926 static_cast<Serv*>(impl_)->Shutdown(); |
| 1927 } | 1927 } |
| 1928 | 1928 |
| 1929 void WebSocketProxy::OnNetworkChange() { | 1929 void WebSocketProxy::OnNetworkChange() { |
| 1930 static_cast<Serv*>(impl_)->OnNetworkChange(); | 1930 static_cast<Serv*>(impl_)->OnNetworkChange(); |
| 1931 } | 1931 } |
| 1932 | 1932 |
| 1933 } // namespace chromeos | 1933 } // namespace chromeos |
| OLD | NEW |