| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/child/socket_stream_dispatcher.h" | 5 #include "content/child/socket_stream_dispatcher.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "content/child/child_thread.h" | 16 #include "content/child/child_thread.h" |
| 17 #include "content/common/socket_stream.h" | 17 #include "content/common/socket_stream.h" |
| 18 #include "content/common/socket_stream_handle_data.h" | 18 #include "content/common/socket_stream_handle_data.h" |
| 19 #include "content/common/socket_stream_messages.h" | 19 #include "content/common/socket_stream_messages.h" |
| 20 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
| 21 #include "url/gurl.h" | 21 #include "url/gurl.h" |
| 22 #include "webkit/child/websocketstreamhandle_delegate.h" |
| 22 #include "webkit/glue/websocketstreamhandle_bridge.h" | 23 #include "webkit/glue/websocketstreamhandle_bridge.h" |
| 23 #include "webkit/glue/websocketstreamhandle_delegate.h" | |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 | 26 |
| 27 // IPCWebSocketStreamHandleBridge is owned by each SocketStreamHandle. | 27 // IPCWebSocketStreamHandleBridge is owned by each SocketStreamHandle. |
| 28 // It communicates with the main browser process via SocketStreamDispatcher. | 28 // It communicates with the main browser process via SocketStreamDispatcher. |
| 29 class IPCWebSocketStreamHandleBridge | 29 class IPCWebSocketStreamHandleBridge |
| 30 : public webkit_glue::WebSocketStreamHandleBridge { | 30 : public webkit_glue::WebSocketStreamHandleBridge { |
| 31 public: | 31 public: |
| 32 IPCWebSocketStreamHandleBridge( | 32 IPCWebSocketStreamHandleBridge( |
| 33 WebKit::WebSocketStreamHandle* handle, | 33 WebKit::WebSocketStreamHandle* handle, |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 void SocketStreamDispatcher::OnFailed(int socket_id, int error_code) { | 247 void SocketStreamDispatcher::OnFailed(int socket_id, int error_code) { |
| 248 IPCWebSocketStreamHandleBridge* bridge = | 248 IPCWebSocketStreamHandleBridge* bridge = |
| 249 IPCWebSocketStreamHandleBridge::FromSocketId(socket_id); | 249 IPCWebSocketStreamHandleBridge::FromSocketId(socket_id); |
| 250 if (bridge) | 250 if (bridge) |
| 251 bridge->OnFailed(error_code, net::ErrorToString(error_code)); | 251 bridge->OnFailed(error_code, net::ErrorToString(error_code)); |
| 252 else | 252 else |
| 253 DLOG(ERROR) << "No bridge for socket_id=" << socket_id; | 253 DLOG(ERROR) << "No bridge for socket_id=" << socket_id; |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace content | 256 } // namespace content |
| OLD | NEW |