DescriptionAdd support for not owning distilled WebContents
Currently the SourcePageHandleWebContents holds a scoped_ptr<WebContents>,
which means that when distillation of the source page is finished, the
WebContents will be destroyed. This makes it hard to distill the contents
from one WebContents, and view the result in another.
This CL makes the SourcePageHandleWebContents only optionally own the
WebContents by taking in a raw pointer an a bool flag of whether it should
own it or not.
In the current chrome-level API DistillCurrentPageAndView the old behavior
is kept, and the source WebContents is destroyed when distillation finishes.
In addition, this CL adds a new chrome-level API DistillAndView(...), where
the caller passes in two WebContents, one for the source page, and one for
where the caller wants to view the distilled content. The distiller code does
in this case not take ownership of any of these.
BUG=None
TEST=browser_tests,components_browsertests
Committed: https://crrev.com/405029be4a4dfe081a2c4293b403c3c47b741d80
Cr-Commit-Position: refs/heads/master@{#329544}
Patch Set 1 #Patch Set 2 : Rebased #Patch Set 3 : Simplified API to take in two WebContents #Patch Set 4 : Rebase #Patch Set 5 : Added browser test for tab utils #Patch Set 6 : Fix tests #Patch Set 7 : Self-review #Patch Set 8 : Remove DistillerPageWebContents::WebContentsDestroyed #
Total comments: 2
Patch Set 9 : Pass inn SPHWC as scoped_ptr #Patch Set 10 : Fix issues. #Messages
Total messages: 24 (10 generated)
|