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

Unified Diff: components/dom_distiller/content/distiller_page_web_contents.h

Issue 1058193002: Add support for not owning distilled WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issues. Created 5 years, 7 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/distiller_page_web_contents.h
diff --git a/components/dom_distiller/content/distiller_page_web_contents.h b/components/dom_distiller/content/distiller_page_web_contents.h
index 80b7a9eb800f52954d81556f19249c955b0fd748..82abe8d530c69155b91bee19b31b41d537a743c8 100644
--- a/components/dom_distiller/content/distiller_page_web_contents.h
+++ b/components/dom_distiller/content/distiller_page_web_contents.h
@@ -18,15 +18,17 @@ namespace dom_distiller {
class SourcePageHandleWebContents : public SourcePageHandle {
public:
- explicit SourcePageHandleWebContents(
- scoped_ptr<content::WebContents> web_contents);
+ SourcePageHandleWebContents(content::WebContents* web_contents, bool owned);
~SourcePageHandleWebContents() override;
- scoped_ptr<content::WebContents> GetWebContents();
+ // Retreives the WebContents. The SourcePageHandleWebContents keeps ownership.
+ content::WebContents* web_contents() { return web_contents_; }
private:
- // The WebContents this class owns.
- scoped_ptr<content::WebContents> web_contents_;
+ // The WebContents this class holds.
+ content::WebContents* web_contents_;
+ // Whether this owns |web_contents_|.
+ bool owned_;
};
class DistillerPageWebContentsFactory : public DistillerPageFactory {
@@ -106,7 +108,8 @@ class DistillerPageWebContents : public DistillerPage,
// The JavaScript to inject to extract content.
std::string script_;
- scoped_ptr<content::WebContents> web_contents_;
+ scoped_ptr<SourcePageHandleWebContents> source_page_handle_;
+
content::BrowserContext* browser_context_;
gfx::Size render_view_size_;
DISALLOW_COPY_AND_ASSIGN(DistillerPageWebContents);
« no previous file with comments | « chrome/browser/dom_distiller/tab_utils_browsertest.cc ('k') | components/dom_distiller/content/distiller_page_web_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698