Roll dom_distiller_js

Picked up changes:
2c57b49 Make debug output a run-time configuration instead of compile-time.
88806c2 Fix final content and title extraction.
aab9dc9 Revert https://codereview.chromium.org/290993004/
8c95c16 Restore Title identification.
b98b574 Add debug output for each stage of Boilerpipe.

BUG=367243,375443,375449

Review URL: https://codereview.chromium.org/302553009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273094 0039d316-1c4b-4281-b951-d872f2087c98
parent 60074dc3
Name: dom-distiller-js Name: dom-distiller-js
URL: https://code.google.com/p/dom-distiller URL: https://code.google.com/p/dom-distiller
Version: 6ef4764253 Version: 2c57b492b1
License: BSD License: BSD
Security Critical: yes Security Critical: yes
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -29,4 +29,11 @@ message DomDistillerResult { ...@@ -29,4 +29,11 @@ message DomDistillerResult {
message DomDistillerOptions { message DomDistillerOptions {
// Whether to extract only the text (or to include the containing html). // Whether to extract only the text (or to include the containing html).
optional bool extract_text_only = 1; optional bool extract_text_only = 1;
// How much debug output to dump to window.console.
// (0): Logs nothing
// (1): Text Node data for each stage of processing
// (2): (1) and some node visibility information
// (3): (2) and extracted paging information
optional int32 debug_level = 2;
} }
...@@ -174,6 +174,13 @@ namespace dom_distiller { ...@@ -174,6 +174,13 @@ namespace dom_distiller {
} }
message.set_extract_text_only(field_value); message.set_extract_text_only(field_value);
} }
if (dict->HasKey("2")) {
int field_value;
if (!dict->GetInteger("2", &field_value)) {
goto error;
}
message.set_debug_level(field_value);
}
return message; return message;
error: error:
...@@ -185,6 +192,9 @@ namespace dom_distiller { ...@@ -185,6 +192,9 @@ namespace dom_distiller {
if (message.has_extract_text_only()) { if (message.has_extract_text_only()) {
dict->SetBoolean("1", message.extract_text_only()); dict->SetBoolean("1", message.extract_text_only());
} }
if (message.has_debug_level()) {
dict->SetInteger("2", message.debug_level());
}
return dict.PassAs<base::Value>(); return dict.PassAs<base::Value>();
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment