Commit c98280fd authored by Jiawei Li's avatar Jiawei Li Committed by Commit Bot

[bindings] Remove deprecated methods in BindingsManager

Removed usage of deprecated methods.

Merge-With: eureka-internal/358999

Bug: Internal b/148628557
Test: bindings_manager_cast_browsertest, unittests.
Change-Id: I435e9cf0e5a5a19e178c10d4cf99eef5ce4b36b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037028Reviewed-by: default avatarYuchen Liu <yucliu@chromium.org>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Commit-Queue: Jiawei Li <lijiawei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738397}
parent b59350b3
......@@ -15,17 +15,6 @@ BindingsManager::~BindingsManager() {
DCHECK(port_handlers_.empty());
}
// TODO(crbug.com/803242): Deprecated and will be shortly removed.
void BindingsManager::RegisterPortHandler(base::StringPiece port_name,
PortConnectedHandler handler) {
MessagePortConnectedHandler wrapped_handler = base::BindRepeating(
[](PortConnectedHandler handler, blink::WebMessagePort port) {
handler.Run(port.PassHandle());
},
handler);
RegisterPortHandler(port_name, wrapped_handler);
}
void BindingsManager::RegisterPortHandler(base::StringPiece port_name,
MessagePortConnectedHandler handler) {
auto result = port_handlers_.try_emplace(port_name, std::move(handler));
......@@ -37,12 +26,6 @@ void BindingsManager::UnregisterPortHandler(base::StringPiece port_name) {
DCHECK_EQ(deleted, 1u);
}
// TODO(crbug.com/803242): Deprecated and will be shortly removed.
void BindingsManager::OnPortConnected(base::StringPiece port_name,
mojo::ScopedMessagePipeHandle port) {
OnPortConnected(port_name, blink::WebMessagePort::Create(std::move(port)));
}
void BindingsManager::OnPortConnected(base::StringPiece port_name,
blink::WebMessagePort port) {
auto handler = port_handlers_.find(port_name);
......
......@@ -11,7 +11,6 @@
#include "base/callback.h"
#include "base/containers/flat_map.h"
#include "base/strings/string_piece.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "third_party/blink/public/common/messaging/web_message_port.h"
namespace chromecast {
......@@ -20,13 +19,8 @@ namespace bindings {
// Injects Cast Platform API scripts into pages' scripting context and
// establishes bidirectional communication with them across the JS/native
// boundary.
// TODO(crbug.com/803242): Deprecated and will be shortly removed.
class BindingsManager {
public:
// NOTE: This is the deprecated legacy notification type. Please use a
// MessagePortConnectedHandler instead!
using PortConnectedHandler =
base::RepeatingCallback<void(mojo::ScopedMessagePipeHandle)>;
using MessagePortConnectedHandler =
base::RepeatingCallback<void(blink::WebMessagePort)>;
......@@ -38,10 +32,6 @@ class BindingsManager {
// Registers a |handler| which will receive MessagePorts originating from
// the frame's web content. |port_name| is an alphanumeric string that is
// consistent across JS and native code.
// NOTE: The mojo::ScopedMessagePipeHandle of this function is deprecated and
// soon to be removed, please use the blink::WebMessagePort variant!
void RegisterPortHandler(base::StringPiece port_name,
PortConnectedHandler handler);
void RegisterPortHandler(base::StringPiece port_name,
MessagePortConnectedHandler handler);
......@@ -58,10 +48,6 @@ class BindingsManager {
protected:
// Called by platform-specific subclasses when the underlying transport has
// delivered a port.
// NOTE: The mojo::ScopedMessagePipeHandle of this function is deprecated and
// soon to be removed, please use the blink::WebMessagePort variant!
void OnPortConnected(base::StringPiece port_name,
mojo::ScopedMessagePipeHandle port);
void OnPortConnected(base::StringPiece port_name, blink::WebMessagePort port);
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment