From 8a9d10b764b857525a52724403b89fe85fcbbc79 Mon Sep 17 00:00:00 2001 From: mkarolin Date: Tue, 31 Aug 2021 16:07:40 -0400 Subject: [PATCH] Removed previosuly applied upstream patches. These were applied to fix https://github.com/brave/brave-browser/issues/17652 and have now been merged to cr93, so we no longer need to apply them. Chromium change: https://chromium.googlesource.com/chromium/src/+/a28e500824b8455d0575da8c2b686a6ea522c9eb commit a28e500824b8455d0575da8c2b686a6ea522c9eb Author: Reilly Grant Date: Fri Aug 27 00:18:21 2021 +0000 [Merge M93] Fix parameter validation for chrome.tcpServer.getInfo() In crrev.com/c/2961688 the implementation of this function was simplified however an error was introduced where the parsed function parameters were stored in a local variable but still accessed from an instance variable. This change removes the instance variable as it should have been in the original change. (cherry picked from commit 427152d3d98fce04457af56b0c362c45eb1ec042) (cherry picked from commit 155fb64bf9aeeec994c15a348c1aa302d33a83d7) Bug: 1239520 --- ...tcp_server-sockets_tcp_server_api.cc.patch | 23 ------------------- ..._tcp_server-sockets_tcp_server_api.h.patch | 14 ----------- ...sockets_tcp_server-api-background.js.patch | 16 ------------- 3 files changed, 53 deletions(-) delete mode 100644 patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.cc.patch delete mode 100644 patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.h.patch delete mode 100644 patches/extensions-test-data-sockets_tcp_server-api-background.js.patch diff --git a/patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.cc.patch b/patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.cc.patch deleted file mode 100644 index 285221794881..000000000000 --- a/patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.cc.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.cc b/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.cc -index fcba8ac797b18084efd5a79ae7cdf25487a61407..abf5c544601b32ca6898f64b9bd3927dceff4a41 100644 ---- a/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.cc -+++ b/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.cc -@@ -256,15 +256,15 @@ SocketsTcpServerGetInfoFunction::~SocketsTcpServerGetInfoFunction() = default; - ExtensionFunction::ResponseAction SocketsTcpServerGetInfoFunction::Work() { - std::unique_ptr params = - sockets_tcp_server::GetInfo::Params::Create(*args_); -- EXTENSION_FUNCTION_VALIDATE(params_.get()); -+ EXTENSION_FUNCTION_VALIDATE(params.get()); - -- ResumableTCPServerSocket* socket = GetTcpSocket(params_->socket_id); -+ ResumableTCPServerSocket* socket = GetTcpSocket(params->socket_id); - if (!socket) { - return RespondNow(Error(kSocketNotFoundError)); - } - - sockets_tcp_server::SocketInfo socket_info = -- CreateSocketInfo(params_->socket_id, socket); -+ CreateSocketInfo(params->socket_id, socket); - return RespondNow( - ArgumentList(sockets_tcp_server::GetInfo::Results::Create(socket_info))); - } diff --git a/patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.h.patch b/patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.h.patch deleted file mode 100644 index aea55cef8541..000000000000 --- a/patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.h.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.h b/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.h -index 39d68080d449de6a3de282afe4d6335652402e06..d60fa8bbe677c83037f26c5b3cfd286d6a79bd8a 100644 ---- a/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.h -+++ b/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.h -@@ -134,9 +134,6 @@ class SocketsTcpServerGetInfoFunction : public TCPServerSocketApiFunction { - - // SocketApiFunction: - ResponseAction Work() override; -- -- private: -- std::unique_ptr params_; - }; - - class SocketsTcpServerGetSocketsFunction : public TCPServerSocketApiFunction { diff --git a/patches/extensions-test-data-sockets_tcp_server-api-background.js.patch b/patches/extensions-test-data-sockets_tcp_server-api-background.js.patch deleted file mode 100644 index 6fbf01aae0b0..000000000000 --- a/patches/extensions-test-data-sockets_tcp_server-api-background.js.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/extensions/test/data/sockets_tcp_server/api/background.js b/extensions/test/data/sockets_tcp_server/api/background.js -index 8a2ff5ee95c74b1cc4e9a9e6bf62db889fe83309..f25b1e7dead44c84bc3019103a95a3c9101f9a91 100644 ---- a/extensions/test/data/sockets_tcp_server/api/background.js -+++ b/extensions/test/data/sockets_tcp_server/api/background.js -@@ -43,6 +43,11 @@ var testSocketListening = function() { - function onServerSocketCreate(socketInfo) { - console.log("Server socket created: sd=" + socketInfo.socketId); - socketId = socketInfo.socketId; -+ chrome.sockets.tcpServer.getInfo(socketId, onGetInfo); -+ } -+ -+ function onGetInfo(socketInfo) { -+ chrome.test.assertEq(socketInfo.socketId, socketId); - chrome.sockets.tcpServer.listen(socketId, address, port, onListen); - } -