| Index: third_party/dom_distiller_js/package/proto_gen/third_party/dom_distiller_js/dom_distiller_json_converter.h
|
| diff --git a/third_party/dom_distiller_js/package/proto_gen/third_party/dom_distiller_js/dom_distiller_json_converter.h b/third_party/dom_distiller_js/package/proto_gen/third_party/dom_distiller_js/dom_distiller_json_converter.h
|
| index 701cae118c91379d018f25eda365d26a7c4b3679..91a0ecf0a0bf7b889de63e4fc225c4dd8ab7a67a 100644
|
| --- a/third_party/dom_distiller_js/package/proto_gen/third_party/dom_distiller_js/dom_distiller_json_converter.h
|
| +++ b/third_party/dom_distiller_js/package/proto_gen/third_party/dom_distiller_js/dom_distiller_json_converter.h
|
| @@ -456,6 +456,33 @@ namespace dom_distiller {
|
| }
|
| };
|
|
|
| + class StatisticsInfo {
|
| + public:
|
| + static bool ReadFromValue(const base::Value* json, dom_distiller::proto::StatisticsInfo* message) {
|
| + const base::DictionaryValue* dict;
|
| + if (!json->GetAsDictionary(&dict)) goto error;
|
| + if (dict->HasKey("1")) {
|
| + int field_value;
|
| + if (!dict->GetInteger("1", &field_value)) {
|
| + goto error;
|
| + }
|
| + message->set_word_count(field_value);
|
| + }
|
| + return true;
|
| +
|
| + error:
|
| + return false;
|
| + }
|
| +
|
| + static scoped_ptr<base::Value> WriteToValue(const dom_distiller::proto::StatisticsInfo& message) {
|
| + scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
|
| + if (message.has_word_count()) {
|
| + dict->SetInteger("1", message.word_count());
|
| + }
|
| + return dict.PassAs<base::Value>();
|
| + }
|
| + };
|
| +
|
| class DomDistillerResult {
|
| public:
|
| static bool ReadFromValue(const base::Value* json, dom_distiller::proto::DomDistillerResult* message) {
|
| @@ -526,6 +553,15 @@ namespace dom_distiller {
|
| goto error;
|
| }
|
| }
|
| + if (dict->HasKey("8")) {
|
| + const base::Value* inner_message_value;
|
| + if (!dict->Get("8", &inner_message_value)) {
|
| + goto error;
|
| + }
|
| + if (!dom_distiller::proto::json::StatisticsInfo::ReadFromValue(inner_message_value, message->mutable_statistics_info())) {
|
| + goto error;
|
| + }
|
| + }
|
| return true;
|
|
|
| error:
|
| @@ -567,6 +603,11 @@ namespace dom_distiller {
|
| dom_distiller::proto::json::DebugInfo::WriteToValue(message.debug_info());
|
| dict->Set("7", inner_message_value.release());
|
| }
|
| + if (message.has_statistics_info()) {
|
| + scoped_ptr<base::Value> inner_message_value =
|
| + dom_distiller::proto::json::StatisticsInfo::WriteToValue(message.statistics_info());
|
| + dict->Set("8", inner_message_value.release());
|
| + }
|
| return dict.PassAs<base::Value>();
|
| }
|
| };
|
|
|