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

Issue 1058193002: Add support for not owning distilled WebContents (Closed)

Created:
5 years, 8 months ago by nyquist
Modified:
5 years, 7 months ago
Reviewers:
cjhopman
CC:
chromium-reviews, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add 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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -58 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerTabUtils.java View 1 2 2 chunks +14 lines, -0 lines 0 comments Download
M chrome/browser/dom_distiller/tab_utils.h View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/dom_distiller/tab_utils.cc View 1 2 3 4 5 6 7 8 9 2 chunks +26 lines, -13 lines 0 comments Download
M chrome/browser/dom_distiller/tab_utils_android.cc View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/dom_distiller/tab_utils_browsertest.cc View 1 2 3 4 5 6 2 chunks +50 lines, -0 lines 0 comments Download
M components/dom_distiller/content/distiller_page_web_contents.h View 1 2 3 4 5 6 7 2 chunks +9 lines, -6 lines 0 comments Download
M components/dom_distiller/content/distiller_page_web_contents.cc View 1 2 3 4 5 6 7 7 chunks +35 lines, -24 lines 0 comments Download
M components/dom_distiller/content/distiller_page_web_contents_browsertest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -15 lines 0 comments Download

Messages

Total messages: 24 (10 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1058193002/100001
5 years, 7 months ago (2015-04-30 22:52:19 UTC) #2
nyquist
cjhopman: PTAL
5 years, 7 months ago (2015-04-30 23:06:24 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1058193002/120001
5 years, 7 months ago (2015-04-30 23:10:08 UTC) #6
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/54219)
5 years, 7 months ago (2015-05-01 01:34:25 UTC) #8
nyquist
cjhopman: PTAL
5 years, 7 months ago (2015-05-12 01:01:40 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1058193002/140001
5 years, 7 months ago (2015-05-12 01:04:45 UTC) #11
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 7 months ago (2015-05-12 02:27:52 UTC) #13
cjhopman
lgtm https://codereview.chromium.org/1058193002/diff/140001/chrome/browser/dom_distiller/tab_utils.cc File chrome/browser/dom_distiller/tab_utils.cc (right): https://codereview.chromium.org/1058193002/diff/140001/chrome/browser/dom_distiller/tab_utils.cc#newcode126 chrome/browser/dom_distiller/tab_utils.cc:126: new SourcePageHandleWebContents(web_contents, owned)); If you wrap this in ...
5 years, 7 months ago (2015-05-12 21:18:42 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1058193002/180001
5 years, 7 months ago (2015-05-12 23:41:59 UTC) #17
nyquist
https://codereview.chromium.org/1058193002/diff/140001/chrome/browser/dom_distiller/tab_utils.cc File chrome/browser/dom_distiller/tab_utils.cc (right): https://codereview.chromium.org/1058193002/diff/140001/chrome/browser/dom_distiller/tab_utils.cc#newcode126 chrome/browser/dom_distiller/tab_utils.cc:126: new SourcePageHandleWebContents(web_contents, owned)); On 2015/05/12 21:18:42, cjhopman wrote: > ...
5 years, 7 months ago (2015-05-13 00:06:52 UTC) #18
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 7 months ago (2015-05-13 00:36:23 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1058193002/180001
5 years, 7 months ago (2015-05-13 00:40:54 UTC) #22
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 7 months ago (2015-05-13 00:46:37 UTC) #23
commit-bot: I haz the power
5 years, 7 months ago (2015-05-13 00:47:36 UTC) #24
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/405029be4a4dfe081a2c4293b403c3c47b741d80
Cr-Commit-Position: refs/heads/master@{#329544}

Powered by Google App Engine
This is Rietveld 408576698