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

Issue 901793002: Add support for providing an external file for extracting content. (Closed)

Created:
5 years, 10 months ago by nyquist
Modified:
5 years, 5 months ago
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 providing an external file for extracting content. This CL adds the command line parameter --external-dom-distiller-js to the content extractor used in DOM Distiller extraction tests. By providing this parameter, the user can provide her own version of the JavaScript instead of using the built-in one. This removes the requirement of re-compiling the components_browsertests target when iterating on DOM Distiller JavaScript code. Requires these changes from DOM Distiller: https://codereview.chromium.org/863863007/ BUG=455503

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressed comments #

Total comments: 4

Patch Set 3 : Moved injection to constructor #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -73 lines) Patch
M chrome/browser/dom_distiller/dom_distiller_service_factory.cc View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M chrome/chrome_browser.gypi View 1 2 2 chunks +1 line, -1 line 0 comments Download
M components/dom_distiller/content/distiller_page_web_contents.h View 1 2 3 chunks +8 lines, -3 lines 0 comments Download
M components/dom_distiller/content/distiller_page_web_contents.cc View 1 2 2 chunks +15 lines, -3 lines 0 comments Download
M components/dom_distiller/content/distiller_page_web_contents_browsertest.cc View 1 2 11 chunks +16 lines, -9 lines 0 comments Download
M components/dom_distiller/core/distiller_page.h View 1 2 2 chunks +14 lines, -3 lines 1 comment Download
M components/dom_distiller/core/distiller_page.cc View 1 2 3 chunks +11 lines, -8 lines 0 comments Download
M components/dom_distiller/core/fake_distiller_page.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
D components/dom_distiller/core/javascript/domdistiller.js View 1 chunk +0 lines, -32 lines 0 comments Download
M components/dom_distiller/ios/distiller_page_factory_ios.h View 1 2 2 chunks +8 lines, -1 line 0 comments Download
M components/dom_distiller/ios/distiller_page_factory_ios.mm View 1 2 1 chunk +7 lines, -4 lines 0 comments Download
M components/dom_distiller/ios/distiller_page_ios.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M components/dom_distiller/ios/distiller_page_ios.mm View 1 2 1 chunk +5 lines, -2 lines 0 comments Download
M components/dom_distiller/standalone/content_extractor_browsertest.cc View 1 2 4 chunks +31 lines, -2 lines 0 comments Download
M components/resources/dom_distiller_resources.grdp View 1 2 1 chunk +1 line, -1 line 2 comments Download
M ios/chrome/DEPS View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M ios/chrome/ios_chrome.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
nyquist
cjhopman: PTAL
5 years, 10 months ago (2015-02-05 01:41:09 UTC) #2
cjhopman
https://codereview.chromium.org/901793002/diff/1/components/dom_distiller/core/distiller_page.cc File components/dom_distiller/core/distiller_page.cc (right): https://codereview.chromium.org/901793002/diff/1/components/dom_distiller/core/distiller_page.cc#newcode32 components/dom_distiller/core/distiller_page.cc:32: if (script_with_options.empty()) { this could just check script.empty() rather ...
5 years, 10 months ago (2015-02-05 02:09:40 UTC) #3
nyquist
cjhopman: PTAL https://codereview.chromium.org/901793002/diff/1/components/dom_distiller/core/distiller_page.cc File components/dom_distiller/core/distiller_page.cc (right): https://codereview.chromium.org/901793002/diff/1/components/dom_distiller/core/distiller_page.cc#newcode32 components/dom_distiller/core/distiller_page.cc:32: if (script_with_options.empty()) { On 2015/02/05 02:09:40, cjhopman ...
5 years, 10 months ago (2015-02-06 18:50:32 UTC) #4
cjhopman
https://codereview.chromium.org/901793002/diff/20001/components/dom_distiller/content/distiller_page_web_contents.h File components/dom_distiller/content/distiller_page_web_contents.h (right): https://codereview.chromium.org/901793002/diff/20001/components/dom_distiller/content/distiller_page_web_contents.h#newcode48 components/dom_distiller/content/distiller_page_web_contents.h:48: // An optional script for overriding the JS that ...
5 years, 10 months ago (2015-02-07 01:16:48 UTC) #5
nyquist
cjhopman: PTAL This depends on a roll of distiller, so all tryjobs will fail. https://codereview.chromium.org/901793002/diff/20001/components/dom_distiller/content/distiller_page_web_contents.h ...
5 years, 9 months ago (2015-03-09 20:40:03 UTC) #6
nyquist
noyau: PTAL ios/, components/dom_distiller/ios
5 years, 9 months ago (2015-03-11 14:12:58 UTC) #7
nyquist
noyau: PTAL ios/, components/dom_distiller/ios This time actually adding noyau@...
5 years, 9 months ago (2015-03-11 14:14:39 UTC) #9
noyau (Ping after 24h)
https://codereview.chromium.org/901793002/diff/40001/components/dom_distiller/core/distiller_page.h File components/dom_distiller/core/distiller_page.h (right): https://codereview.chromium.org/901793002/diff/40001/components/dom_distiller/core/distiller_page.h#newcode59 components/dom_distiller/core/distiller_page.h:59: virtual void DistillPageImpl(const GURL& url, const std::string& script) = ...
5 years, 9 months ago (2015-03-11 14:31:00 UTC) #10
cjhopman
https://codereview.chromium.org/901793002/diff/40001/components/resources/dom_distiller_resources.grdp File components/resources/dom_distiller_resources.grdp (right): https://codereview.chromium.org/901793002/diff/40001/components/resources/dom_distiller_resources.grdp#newcode9 components/resources/dom_distiller_resources.grdp:9: <include name="IDR_DISTILLER_JS" file="../../third_party/dom_distiller_js/package/js/domdistiller_wrapped.js" type="BINDATA" /> On 2015/03/11 14:30:59, noyau ...
5 years, 9 months ago (2015-03-12 02:03:14 UTC) #11
noyau (Ping after 24h)
5 years, 9 months ago (2015-03-12 09:17:30 UTC) #12
On 2015/03/12 02:03:14, cjhopman wrote:
>
https://codereview.chromium.org/901793002/diff/40001/components/resources/dom...
> File components/resources/dom_distiller_resources.grdp (right):
> 
>
https://codereview.chromium.org/901793002/diff/40001/components/resources/dom...
> components/resources/dom_distiller_resources.grdp:9: <include
> name="IDR_DISTILLER_JS"
> file="../../third_party/dom_distiller_js/package/js/domdistiller_wrapped.js"
> type="BINDATA" />
> On 2015/03/11 14:30:59, noyau wrote:
> > I'm not for that change. This file needs iOS specific changes that are going
> to
> > be hard to maintain: now the ios file and the non ios file are in two
> different
> > repositories.
> > 
> > Instead I made a CL (https://codereview.chromium.org/995343002/) that merge
> the
> > two files in one and uses grit <if> to do the right thing, diminishing the
> > maintenance burden.
> 
> Yeah, we should definitely merge these into one file. We would like to
maintain
> this in the dom distiller repo because the file basically needs to stay in
sync
> with the api exposed there (but doesn't need to change for chrome-side
changes).
> 
> noyau, are you particularly opposed to it being maintained in the other repo?
my
> impression is that you mostly just don't want us to be maintaining two
similar,
> but different, versions of it. If it's in the other repo, we would also need
to
> support different platforms via javascript stuff rather than grit stuff. wdyt?

No I'm not opposed to moving the wrapper into the other repository. I just don't
want two separate files to maintain. I'm just curious how the platform detection
will be done in javascript, do you have a plan?

I would argue however that this should be a separate CL:

* This CL should only deal with what its title describes to: allowing a
command-line option for the browser tests.
* Then landing my CL to move to only use one js file
* And only then make another CL moving the js file into domdistiller and reving
domdistiller at the same time

This will allow keeping everything working through the transition. Landing this
as is is very likely going to break iOS in the process.

Powered by Google App Engine
This is Rietveld 408576698