| 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);
|
| };
|
|
|
|
|