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

Unified Diff: components/dom_distiller/core/javascript/domdistiller.js

Issue 1384433002: distiller: Retires support of CreateNewContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Synced. Created 5 years, 3 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/core/javascript/domdistiller.js
diff --git a/components/dom_distiller/core/javascript/domdistiller.js b/components/dom_distiller/core/javascript/domdistiller.js
index 1d91f23cec1c71eafd8e9ff7d4c95fc64b8a242d..bbd2d00d569febb7fd115c89cb33cacd4f467078 100644
--- a/components/dom_distiller/core/javascript/domdistiller.js
+++ b/components/dom_distiller/core/javascript/domdistiller.js
@@ -4,24 +4,19 @@
// Applies DomDistillerJs to the content of the page and returns a
// DomDistillerResults (as a javascript object/dict).
-(function(options, stringify_output, use_new_context) {
+(function(options, stringify_output) {
try {
- // The generated domdistiller.js accesses the window object only explicitly
- // via the window name. So, we create a new object with the normal window
- // object as its prototype and initialize the domdistiller.js with that new
- // context so that it doesn't change the real window object.
- function initialize(window) {
+ function initialize() {
// This include will be processed at build time by grit.
<include src="../../../../third_party/dom_distiller_js/dist/js/domdistiller.js"/>
}
- var context = use_new_context ? Object.create(window) : window
- context.setTimeout = function() {};
- context.clearTimeout = function() {};
- initialize(context);
+ window.setTimeout = function() {};
+ window.clearTimeout = function() {};
+ initialize();
// The OPTIONS placeholder will be replaced with the DomDistillerOptions at
// runtime.
- var distiller = context.org.chromium.distiller.DomDistiller;
+ var distiller = window.org.chromium.distiller.DomDistiller;
var res = distiller.applyWithOptions(options);
if (stringify_output) {
@@ -34,5 +29,4 @@
}
return undefined;
})(options = $$OPTIONS,
- stringify_output = $$STRINGIFY,
- use_new_context = $$NEW_CONTEXT)
+ stringify_output = $$STRINGIFY)
« no previous file with comments | « components/dom_distiller/core/fake_distiller_page.h ('k') | components/dom_distiller/ios/distiller_page_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698