OLD | NEW |
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 org.chromium.distiller; | 5 package org.chromium.distiller; |
6 | 6 |
7 import org.chromium.distiller.proto.DomDistillerProtos; | 7 import org.chromium.distiller.proto.DomDistillerProtos; |
8 import org.chromium.distiller.proto.DomDistillerProtos.DebugInfo; | 8 import org.chromium.distiller.proto.DomDistillerProtos.DebugInfo; |
9 import org.chromium.distiller.proto.DomDistillerProtos.TimingInfo; | 9 import org.chromium.distiller.proto.DomDistillerProtos.TimingInfo; |
10 import org.chromium.distiller.DomUtil; | 10 import org.chromium.distiller.DomUtil; |
11 import org.chromium.distiller.StringUtil; | 11 import org.chromium.distiller.StringUtil; |
12 | 12 |
13 import com.google.gwt.core.client.js.JsExport; | 13 import com.google.gwt.core.client.js.JsExport; |
14 import com.google.gwt.dom.client.Document; | 14 import com.google.gwt.dom.client.Document; |
15 import com.google.gwt.user.client.Window; | |
16 | 15 |
17 @JsExport("DomDistiller") | 16 @JsExport("DomDistiller") |
18 public class DomDistiller { | 17 public class DomDistiller { |
19 @JsExport | 18 @JsExport |
20 public static DomDistillerProtos.DomDistillerResult apply() { | 19 public static DomDistillerProtos.DomDistillerResult apply() { |
21 return applyWithOptions(DomDistillerProtos.DomDistillerOptions.create())
; | 20 return applyWithOptions(DomDistillerProtos.DomDistillerOptions.create())
; |
22 } | 21 } |
23 | 22 |
24 @JsExport | 23 @JsExport |
25 public static DomDistillerProtos.DomDistillerResult applyWithOptions( | 24 public static DomDistillerProtos.DomDistillerResult applyWithOptions( |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 result.setMarkupInfo(contentExtractor.getMarkupParser().getMarkupInfo())
; | 74 result.setMarkupInfo(contentExtractor.getMarkupParser().getMarkupInfo())
; |
76 timingInfo.setTotalTime(DomUtil.getTime() - startTime); | 75 timingInfo.setTotalTime(DomUtil.getTime() - startTime); |
77 result.setTimingInfo(timingInfo); | 76 result.setTimingInfo(timingInfo); |
78 result.setStatisticsInfo(contentExtractor.getStatisticsInfo()); | 77 result.setStatisticsInfo(contentExtractor.getStatisticsInfo()); |
79 DebugInfo debugInfo = DebugInfo.create(); | 78 DebugInfo debugInfo = DebugInfo.create(); |
80 debugInfo.setLog(LogUtil.getAndClearLog()); | 79 debugInfo.setLog(LogUtil.getAndClearLog()); |
81 result.setDebugInfo(debugInfo); | 80 result.setDebugInfo(debugInfo); |
82 return result; | 81 return result; |
83 } | 82 } |
84 } | 83 } |
OLD | NEW |