Commit 6cac7ffb authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

Clean up old Mojo type for mojom::SubresourceFilterAgent

This CL cleans up old mojo types for
mojom::SubresourceFilterAgent using AssociatedReceiver and
PendingAssociatedReceiver.

Bug: 955171
Change-Id: Iedd96df27c643c1bd307980d77c35231650631c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1897396Reviewed-by: default avatarCharlie Harrison <csharrison@chromium.org>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#712433}
parent d29cf9f0
......@@ -3,6 +3,7 @@ include_rules = [
"+components/ukm",
"+content/public/browser",
"+content/public/test",
"+mojo/public",
"+net/base",
"+services/metrics/public/cpp",
"+ui/base/page_transition_types.h",
......
......@@ -39,6 +39,8 @@
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/test_utils.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "net/base/net_errors.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
......@@ -64,13 +66,13 @@ enum PageActivationNotificationTiming {
class FakeSubresourceFilterAgent : public mojom::SubresourceFilterAgent {
public:
FakeSubresourceFilterAgent() : binding_(this) {}
FakeSubresourceFilterAgent() = default;
~FakeSubresourceFilterAgent() override = default;
void OnSubresourceFilterAgentRequest(
void OnSubresourceFilterAgentReceiver(
mojo::ScopedInterfaceEndpointHandle handle) {
binding_.Bind(
mojo::AssociatedInterfaceRequest<mojom::SubresourceFilterAgent>(
receiver_.Bind(
mojo::PendingAssociatedReceiver<mojom::SubresourceFilterAgent>(
std::move(handle)));
}
......@@ -99,7 +101,7 @@ class FakeSubresourceFilterAgent : public mojom::SubresourceFilterAgent {
private:
mojom::ActivationStatePtr last_activation_;
bool is_ad_subframe_ = false;
mojo::AssociatedBinding<mojom::SubresourceFilterAgent> binding_;
mojo::AssociatedReceiver<mojom::SubresourceFilterAgent> receiver_{this};
};
// Simple throttle that sends page-level activation to the manager for a
......@@ -294,7 +296,7 @@ class ContentSubresourceFilterThrottleManagerTest
host->GetRemoteAssociatedInterfaces()->OverrideBinderForTesting(
mojom::SubresourceFilterAgent::Name_,
base::BindRepeating(
&FakeSubresourceFilterAgent::OnSubresourceFilterAgentRequest,
&FakeSubresourceFilterAgent::OnSubresourceFilterAgentReceiver,
base::Unretained(new_agent.get())));
agent_map_[host] = std::move(new_agent);
}
......
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