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 = [ ...@@ -3,6 +3,7 @@ include_rules = [
"+components/ukm", "+components/ukm",
"+content/public/browser", "+content/public/browser",
"+content/public/test", "+content/public/test",
"+mojo/public",
"+net/base", "+net/base",
"+services/metrics/public/cpp", "+services/metrics/public/cpp",
"+ui/base/page_transition_types.h", "+ui/base/page_transition_types.h",
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include "content/public/test/navigation_simulator.h" #include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h" #include "content/public/test/test_renderer_host.h"
#include "content/public/test/test_utils.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 "net/base/net_errors.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
...@@ -64,13 +66,13 @@ enum PageActivationNotificationTiming { ...@@ -64,13 +66,13 @@ enum PageActivationNotificationTiming {
class FakeSubresourceFilterAgent : public mojom::SubresourceFilterAgent { class FakeSubresourceFilterAgent : public mojom::SubresourceFilterAgent {
public: public:
FakeSubresourceFilterAgent() : binding_(this) {} FakeSubresourceFilterAgent() = default;
~FakeSubresourceFilterAgent() override = default; ~FakeSubresourceFilterAgent() override = default;
void OnSubresourceFilterAgentRequest( void OnSubresourceFilterAgentReceiver(
mojo::ScopedInterfaceEndpointHandle handle) { mojo::ScopedInterfaceEndpointHandle handle) {
binding_.Bind( receiver_.Bind(
mojo::AssociatedInterfaceRequest<mojom::SubresourceFilterAgent>( mojo::PendingAssociatedReceiver<mojom::SubresourceFilterAgent>(
std::move(handle))); std::move(handle)));
} }
...@@ -99,7 +101,7 @@ class FakeSubresourceFilterAgent : public mojom::SubresourceFilterAgent { ...@@ -99,7 +101,7 @@ class FakeSubresourceFilterAgent : public mojom::SubresourceFilterAgent {
private: private:
mojom::ActivationStatePtr last_activation_; mojom::ActivationStatePtr last_activation_;
bool is_ad_subframe_ = false; 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 // Simple throttle that sends page-level activation to the manager for a
...@@ -294,7 +296,7 @@ class ContentSubresourceFilterThrottleManagerTest ...@@ -294,7 +296,7 @@ class ContentSubresourceFilterThrottleManagerTest
host->GetRemoteAssociatedInterfaces()->OverrideBinderForTesting( host->GetRemoteAssociatedInterfaces()->OverrideBinderForTesting(
mojom::SubresourceFilterAgent::Name_, mojom::SubresourceFilterAgent::Name_,
base::BindRepeating( base::BindRepeating(
&FakeSubresourceFilterAgent::OnSubresourceFilterAgentRequest, &FakeSubresourceFilterAgent::OnSubresourceFilterAgentReceiver,
base::Unretained(new_agent.get()))); base::Unretained(new_agent.get())));
agent_map_[host] = std::move(new_agent); 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