Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: components/dom_distiller/content/browser/distillability_driver.h

Issue 1891643002: Reader Mode distillability uses Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add web contents check Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/content/browser/distillability_driver.h
diff --git a/components/dom_distiller/content/browser/distillability_driver.h b/components/dom_distiller/content/browser/distillability_driver.h
index 795b9bf438fde48c98ee04d1d1af3f98e28612c3..87a532daa244f76129be5f62dbc76bdcdccded1e 100644
--- a/components/dom_distiller/content/browser/distillability_driver.h
+++ b/components/dom_distiller/content/browser/distillability_driver.h
@@ -6,8 +6,11 @@
#define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "components/dom_distiller/content/common/distillability_service.mojom.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
namespace dom_distiller {
@@ -17,25 +20,29 @@ class DistillabilityDriver
public content::WebContentsUserData<DistillabilityDriver> {
public:
~DistillabilityDriver() override;
+ void CreateDistillabilityService(
+ mojo::InterfaceRequest<DistillabilityService> request);
void SetDelegate(const base::Callback<void(bool, bool)>& delegate);
// content::WebContentsObserver implementation.
- bool OnMessageReceived(const IPC::Message& message,
- content::RenderFrameHost* rfh) override;
void RenderProcessGone(base::TerminationStatus status) override;
private:
explicit DistillabilityDriver(content::WebContents* web_contents);
friend class content::WebContentsUserData<DistillabilityDriver>;
+ friend class DistillabilityServiceImpl;
void OnDistillability(bool distillable, bool is_last);
- // Removes the observer and clears the WebContents member.
+ // Removes the observer, clears the WebContents member, and removed mojo
+ // service from registry.
void CleanUp();
base::Callback<void(bool, bool)> m_delegate_;
+ base::WeakPtrFactory<DistillabilityDriver> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(DistillabilityDriver);
};
« no previous file with comments | « components/dom_distiller/content/browser/BUILD.gn ('k') | components/dom_distiller/content/browser/distillability_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698