Chromium Code Reviews| Index: content/browser/devtools/protocol/tethering_handler.cc |
| diff --git a/content/browser/devtools/protocol/tethering_handler.cc b/content/browser/devtools/protocol/tethering_handler.cc |
| index 3f9b8ad60c28796381049c1002d9f21b209e4af1..4d641db070fe030a2047818e4299cc40bc3d8835 100644 |
| --- a/content/browser/devtools/protocol/tethering_handler.cc |
| +++ b/content/browser/devtools/protocol/tethering_handler.cc |
| @@ -40,8 +40,11 @@ class SocketPump { |
| std::string Init(const CreateServerSocketCallback& socket_callback) { |
| std::string channel_name; |
| server_socket_ = socket_callback.Run(&channel_name); |
| - if (!server_socket_.get() || channel_name.empty()) |
| + if (!server_socket_.get() || channel_name.empty()) { |
| SelfDestruct(); |
| + channel_name.clear(); |
| + return channel_name; |
|
pfeldman
2016/10/04 01:23:42
nit: return std::string();
pwnall
2016/10/04 01:30:50
Done.
FWIW, I was (over-)thinking about RVO.
|
| + } |
| int result = server_socket_->Accept( |
| &accepted_socket_, |