Skip to content

Commit

Permalink
src: fix compile warnings introduced in 73ad3f9
Browse files Browse the repository at this point in the history
Fix warnings introduced in commit 73ad3f9 ("inspector: Fix crash for
WS connection"):

* add missing `override` keywords
* remove unused fields and functions

PR-URL: #17649
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
bnoordhuis authored and MylesBorins committed Jan 8, 2018
1 parent b1fd50a commit 0c6d9ae
Showing 2 changed files with 3 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/inspector_socket.cc
Original file line number Diff line number Diff line change
@@ -328,7 +328,7 @@ class WsHandler : public ProtocolHandler {
} while (processed > 0 && !data->empty());
}

void Write(const std::vector<char> data) {
void Write(const std::vector<char> data) override {
std::vector<char> output = encode_frame_hybi17(data);
WriteRaw(output, WriteRequest::Cleanup);
}
@@ -446,7 +446,7 @@ class HttpHandler : public ProtocolHandler {
}
}

void CancelHandshake() {
void CancelHandshake() override {
const char HANDSHAKE_FAILED_RESPONSE[] =
"HTTP/1.0 400 Bad Request\r\n"
"Content-Type: text/html; charset=UTF-8\r\n\r\n"
11 changes: 1 addition & 10 deletions src/inspector_socket_server.cc
Original file line number Diff line number Diff line change
@@ -84,11 +84,6 @@ const char* MatchPathSegment(const char* path, const char* expected) {
return nullptr;
}

void OnBufferAlloc(uv_handle_t* handle, size_t len, uv_buf_t* buf) {
buf->base = new char[len];
buf->len = len;
}

void PrintDebuggerReadyMessage(const std::string& host,
int port,
const std::vector<std::string>& ids,
@@ -235,7 +230,6 @@ class SocketSession {
private:
const int id_;
InspectorSocket::Pointer ws_socket_;
InspectorSocketServer* server_;
const int server_port_;
std::string ws_key_;
};
@@ -531,10 +525,7 @@ void InspectorSocketServer::Send(int session_id, const std::string& message) {
// InspectorSession tracking
SocketSession::SocketSession(InspectorSocketServer* server, int id,
int server_port)
: id_(id),
server_(server),
server_port_(server_port) { }

: id_(id), server_port_(server_port) {}

void SocketSession::Send(const std::string& message) {
ws_socket_->Write(message.data(), message.length());

0 comments on commit 0c6d9ae

Please sign in to comment.