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

Side by Side Diff: src/com/dom_distiller/client/DomDistiller.java

Issue 762563003: Roll gwt to 2.7.0 (from 2.5.1) (Closed) Base URL: https://code.google.com/p/dom-distiller/@master
Patch Set: rebase Created 6 years 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 unified diff | Download patch
« no previous file with comments | « src/DomDistiller.gwt.xml ('k') | src/com/dom_distiller/client/DomDistillerEntry.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package com.dom_distiller.client; 5 package com.dom_distiller.client;
6 6
7 import com.dom_distiller.proto.DomDistillerProtos; 7 import com.dom_distiller.proto.DomDistillerProtos;
8 import com.dom_distiller.proto.DomDistillerProtos.DebugInfo; 8 import com.dom_distiller.proto.DomDistillerProtos.DebugInfo;
9 import com.dom_distiller.proto.DomDistillerProtos.TimingInfo; 9 import com.dom_distiller.proto.DomDistillerProtos.TimingInfo;
10 import com.google.gwt.dom.client.Document; 10 import com.google.gwt.dom.client.Document;
11 import com.google.gwt.core.client.js.JsExport;
12 import com.google.gwt.core.client.js.JsNamespace;
11 13
12 import org.timepedia.exporter.client.Export; 14 @JsExport("DomDistiller")
13 import org.timepedia.exporter.client.Exportable; 15 public class DomDistiller {
14 16 @JsExport
15 @Export()
16 public class DomDistiller implements Exportable {
17 public static DomDistillerProtos.DomDistillerResult apply() { 17 public static DomDistillerProtos.DomDistillerResult apply() {
18 return applyWithOptions(DomDistillerProtos.DomDistillerOptions.create()) ; 18 return applyWithOptions(DomDistillerProtos.DomDistillerOptions.create()) ;
19 } 19 }
20 20
21 @JsExport
21 public static DomDistillerProtos.DomDistillerResult applyWithOptions( 22 public static DomDistillerProtos.DomDistillerResult applyWithOptions(
22 DomDistillerProtos.DomDistillerOptions options) { 23 DomDistillerProtos.DomDistillerOptions options) {
23 double startTime = DomUtil.getTime(); 24 double startTime = DomUtil.getTime();
24 DomDistillerProtos.DomDistillerResult result = 25 DomDistillerProtos.DomDistillerResult result =
25 DomDistillerProtos.DomDistillerResult.create(); 26 DomDistillerProtos.DomDistillerResult.create();
26 ContentExtractor contentExtractor = 27 ContentExtractor contentExtractor =
27 new ContentExtractor(Document.get().getDocumentElement()); 28 new ContentExtractor(Document.get().getDocumentElement());
28 result.setTitle(contentExtractor.extractTitle()); 29 result.setTitle(contentExtractor.extractTitle());
29 30
30 LogUtil.setDebugLevel( 31 LogUtil.setDebugLevel(
(...skipping 16 matching lines...) Expand all
47 TimingInfo timingInfo = contentExtractor.getTimingInfo(); 48 TimingInfo timingInfo = contentExtractor.getTimingInfo();
48 timingInfo.setTotalTime(DomUtil.getTime() - startTime); 49 timingInfo.setTotalTime(DomUtil.getTime() - startTime);
49 result.setTimingInfo(timingInfo); 50 result.setTimingInfo(timingInfo);
50 result.setStatisticsInfo(contentExtractor.getStatisticsInfo()); 51 result.setStatisticsInfo(contentExtractor.getStatisticsInfo());
51 DebugInfo debugInfo = DebugInfo.create(); 52 DebugInfo debugInfo = DebugInfo.create();
52 debugInfo.setLog(LogUtil.getAndClearLog()); 53 debugInfo.setLog(LogUtil.getAndClearLog());
53 result.setDebugInfo(debugInfo); 54 result.setDebugInfo(debugInfo);
54 return result; 55 return result;
55 } 56 }
56 } 57 }
OLDNEW
« no previous file with comments | « src/DomDistiller.gwt.xml ('k') | src/com/dom_distiller/client/DomDistillerEntry.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698