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

Side by Side Diff: content/browser/renderer_host/socket_stream_host.cc

Issue 10668018: Websocket should fire 'error' event if no server available (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: For reland (tyoshino) Created 7 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 // 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/browser/renderer_host/socket_stream_host.h" 5 #include "content/browser/renderer_host/socket_stream_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/common/socket_stream.h" 8 #include "content/common/socket_stream.h"
9 #include "net/socket_stream/socket_stream_job.h" 9 #include "net/socket_stream/socket_stream_job.h"
10 #include "net/url_request/url_request_context.h" 10 #include "net/url_request/url_request_context.h"
(...skipping 21 matching lines...) Expand all
32 int socket_id) 32 int socket_id)
33 : delegate_(delegate), 33 : delegate_(delegate),
34 render_view_id_(render_view_id), 34 render_view_id_(render_view_id),
35 socket_id_(socket_id) { 35 socket_id_(socket_id) {
36 DCHECK_NE(socket_id_, kNoSocketId); 36 DCHECK_NE(socket_id_, kNoSocketId);
37 VLOG(1) << "SocketStreamHost: render_view_id=" << render_view_id 37 VLOG(1) << "SocketStreamHost: render_view_id=" << render_view_id
38 << " socket_id=" << socket_id_; 38 << " socket_id=" << socket_id_;
39 } 39 }
40 40
41 /* static */ 41 /* static */
42 int SocketStreamHost::SocketIdFromSocketStream(net::SocketStream* socket) { 42 int SocketStreamHost::SocketIdFromSocketStream(
43 const net::SocketStream* socket) {
43 net::SocketStream::UserData* d = socket->GetUserData(kSocketIdKey); 44 net::SocketStream::UserData* d = socket->GetUserData(kSocketIdKey);
44 if (d) { 45 if (d) {
45 SocketStreamId* socket_stream_id = static_cast<SocketStreamId*>(d); 46 SocketStreamId* socket_stream_id = static_cast<SocketStreamId*>(d);
46 return socket_stream_id->socket_id(); 47 return socket_stream_id->socket_id();
47 } 48 }
48 return kNoSocketId; 49 return kNoSocketId;
49 } 50 }
50 51
51 SocketStreamHost::~SocketStreamHost() { 52 SocketStreamHost::~SocketStreamHost() {
52 VLOG(1) << "SocketStreamHost destructed socket_id=" << socket_id_; 53 VLOG(1) << "SocketStreamHost destructed socket_id=" << socket_id_;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 92 }
92 93
93 void SocketStreamHost::ContinueDespiteError() { 94 void SocketStreamHost::ContinueDespiteError() {
94 VLOG(1) << "SocketStreamHost::ContinueDespiteError"; 95 VLOG(1) << "SocketStreamHost::ContinueDespiteError";
95 if (!socket_) 96 if (!socket_)
96 return; 97 return;
97 socket_->ContinueDespiteError(); 98 socket_->ContinueDespiteError();
98 } 99 }
99 100
100 } // namespace content 101 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/socket_stream_host.h ('k') | content/common/socket_stream_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698