Commit 68ddbe93 authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

Convert PhishingModelSetter to new Mojo types

This CL converts PhishingModelSetterRequest to new
Mojo types using PendingReceiver.

Bug: 955171
Change-Id: If10ec71ba4773c208fd02f4ba2ff58347551ff3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816478
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699271}
parent 28b3eafd
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "content/public/renderer/document_state.h" #include "content/public/renderer/document_state.h"
#include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_thread.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "services/service_manager/public/cpp/interface_provider.h" #include "services/service_manager/public/cpp/interface_provider.h"
#include "third_party/blink/public/platform/web_url.h" #include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/web/web_document.h" #include "third_party/blink/public/web/web_document.h"
...@@ -52,9 +53,9 @@ base::LazyInstance<std::unique_ptr<const safe_browsing::Scorer>>:: ...@@ -52,9 +53,9 @@ base::LazyInstance<std::unique_ptr<const safe_browsing::Scorer>>::
// static // static
void PhishingClassifierFilter::Create( void PhishingClassifierFilter::Create(
mojom::PhishingModelSetterRequest request) { mojo::PendingReceiver<mojom::PhishingModelSetter> receiver) {
mojo::MakeStrongBinding(std::make_unique<PhishingClassifierFilter>(), mojo::MakeSelfOwnedReceiver(std::make_unique<PhishingClassifierFilter>(),
std::move(request)); std::move(receiver));
} }
PhishingClassifierFilter::PhishingClassifierFilter() {} PhishingClassifierFilter::PhishingClassifierFilter() {}
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "content/public/renderer/render_thread_observer.h" #include "content/public/renderer/render_thread_observer.h"
#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/service_manager/public/cpp/binder_registry.h" #include "services/service_manager/public/cpp/binder_registry.h"
#include "ui/base/page_transition_types.h" #include "ui/base/page_transition_types.h"
#include "url/gurl.h" #include "url/gurl.h"
...@@ -31,14 +30,13 @@ class PhishingClassifierFilter : public mojom::PhishingModelSetter { ...@@ -31,14 +30,13 @@ class PhishingClassifierFilter : public mojom::PhishingModelSetter {
PhishingClassifierFilter(); PhishingClassifierFilter();
~PhishingClassifierFilter() override; ~PhishingClassifierFilter() override;
static void Create(mojom::PhishingModelSetterRequest request); static void Create(
mojo::PendingReceiver<mojom::PhishingModelSetter> receiver);
private: private:
// mojom::PhishingModelSetter // mojom::PhishingModelSetter
void SetPhishingModel(const std::string& model) override; void SetPhishingModel(const std::string& model) override;
mojo::StrongBindingPtr<mojom::PhishingModelSetter> binding_;
DISALLOW_COPY_AND_ASSIGN(PhishingClassifierFilter); DISALLOW_COPY_AND_ASSIGN(PhishingClassifierFilter);
}; };
......
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