Commit e8810fed authored by hkamila's avatar hkamila Committed by Commit Bot

SafeBrowsing: Added the webui protobuf

Implemented the webui protobuf that will collect information about the database status
as size, update, stores, and more.


Bug: 734667
Change-Id: If920b7c3d90b7e6dfd24c0256b3042900737d7a5
Reviewed-on: https://chromium-review.googlesource.com/578384
Commit-Queue: Kamila Hasanbega <hkamila@google.com>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Reviewed-by: default avatarLuke Z <lpz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488694}
parent a37772c1
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//third_party/protobuf/proto_library.gni")
static_library("web_ui") { static_library("web_ui") {
sources = [ sources = [
"safe_browsing_ui.cc", "safe_browsing_ui.cc",
...@@ -10,6 +12,7 @@ static_library("web_ui") { ...@@ -10,6 +12,7 @@ static_library("web_ui") {
deps = [ deps = [
":constants", ":constants",
":webui_proto",
"//base", "//base",
"//components/resources:components_resources_grit", "//components/resources:components_resources_grit",
"//components/resources:components_scaled_resources_grit", "//components/resources:components_scaled_resources_grit",
...@@ -29,3 +32,9 @@ static_library("constants") { ...@@ -29,3 +32,9 @@ static_library("constants") {
"constants.h", "constants.h",
] ]
} }
proto_library("webui_proto") {
sources = [
"webui.proto",
]
}
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file includes Safe Browsing WebUI protocol buffer.
syntax = "proto2";
package safe_browsing;
option optimize_for = LITE_RUNTIME;
// Describes the state of the database manager.
message DatabaseManagerInfo {
// Describes the status of the last update request sent to SafeBrowsing.
message UpdateInfo {
// Network status code for the last update request sent to SafeBrowsing.
optional int32 network_status_code = 1;
// Time when the last update request was sent to SafeBrowsing.
optional int64 last_update_time_micros = 2;
}
optional UpdateInfo update_info = 1;
// Describes the state of the database.
message DatabaseInfo {
// Was the last update applied successfully?
optional bool update_successful = 1;
// Sum of the store sizes in the database.
optional int64 database_size_bytes = 2;
// Describes the state of a store in the database.
message StoreInfo {
// The store file name.
optional string file_name = 1;
// The store file size.
optional int64 file_size_bytes = 2;
// The status of applying the updates fetched from the server to the
// store. The values of update_status corresponds to the enum
// ApplyUpdateResult in V4Store.
optional int32 update_status = 3;
}
// Information about each of the stores managed by the database.
repeated StoreInfo store_info = 3;
}
optional DatabaseInfo database_info = 2;
}
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