Chromium Code Reviews| Index: extensions/browser/api/cast_channel/cast_channel_api.cc |
| diff --git a/extensions/browser/api/cast_channel/cast_channel_api.cc b/extensions/browser/api/cast_channel/cast_channel_api.cc |
| index 4355e0e418463847d6305a24e9cb592eff2b41a9..690c1972ae9072093e7b481e76db878e5eb25105 100644 |
| --- a/extensions/browser/api/cast_channel/cast_channel_api.cc |
| +++ b/extensions/browser/api/cast_channel/cast_channel_api.cc |
| @@ -346,12 +346,14 @@ void CastChannelOpenFunction::AsyncWorkStart() { |
| void CastChannelOpenFunction::OnOpen(cast_channel::ChannelError result) { |
| DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| VLOG(1) << "Connect finished, OnOpen invoked."; |
| - CastSocket* socket = GetSocket(new_channel_id_); |
| - if (!socket) { |
| - SetResultFromError(new_channel_id_, result); |
| - } else { |
| + if (result == cast_channel::CHANNEL_ERROR_NONE) { |
|
imcheng
2017/02/17 22:34:45
I changed the behavior slightly. It's not clear to
mark a. foltz
2017/02/21 18:30:01
IIRC, GetSocket should never be nullptr. AddSocke
imcheng
2017/02/21 22:55:47
Yeah. I reasoned that since CastSocket is always o
|
| + CastSocket* socket = GetSocket(new_channel_id_); |
| + CHECK(socket); |
|
mark a. foltz
2017/02/21 18:30:01
SECURITY_CHECK?
imcheng
2017/02/21 22:55:47
Done.
imcheng
2017/02/21 23:34:20
Turns out SECURITY_CHECK is defined in Blink codeb
|
| SetResultFromSocket(*socket); |
| + } else { |
| + SetResultFromError(new_channel_id_, result); |
|
mark a. foltz
2017/02/21 18:33:20
If you want to aggressively destroy sockets on fai
imcheng
2017/02/21 22:55:47
I will save it for a separate patch as it's a risk
|
| } |
| + |
| AsyncWorkCompleted(); |
| } |