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

Unified Diff: components/offline_pages/core/prefetch/proto/offline_pages.proto

Issue 2873383004: [Offline Prefetch] Send GeneratePageBundleRequest to the server (Closed)
Patch Set: Address more feedback Created 3 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/core/prefetch/proto/offline_pages.proto
diff --git a/components/offline_pages/core/prefetch/proto/offline_pages.proto b/components/offline_pages/core/prefetch/proto/offline_pages.proto
new file mode 100644
index 0000000000000000000000000000000000000000..bffc766694a1d46ef29e1f91e966b717027dbd4f
--- /dev/null
+++ b/components/offline_pages/core/prefetch/proto/offline_pages.proto
@@ -0,0 +1,98 @@
+// 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.
+
+syntax = "proto3";
+option optimize_for = LITE_RUNTIME;
+
+package offline_pages.proto;
+
+import "status.proto";
+import "timestamp.proto";
+
+// Type of transformation applied to a web page.
+enum Transformation {
+ // Transformation not specified.
+ TRANSFORMATION_UNSPECIFIED = 0;
+ // Minimal transformation required to provide an offline-accessible web page.
+ NO_TRANSFORMATION = 1;
+}
+
+// Page package format.
+enum OutputFormat {
+ // Format not specified.
+ FORMAT_UNSPECIFIED = 0;
+ // An MHTML archive containing a single web page.
+ FORMAT_MHTML = 1;
+}
+
+// Response to the GeneratePageBundle request.
+message PageBundle {
+ // The list of archives in the bundle. The distribution of pages into archives
+ // is arbitrary.
+ repeated Archive archives = 1;
+}
+
+// A resource containing one or more serialized offline pages.
+message Archive {
+ // Information about the individual page(s) used to create the Archive.
+ // There will be one PageInfo message for every page in the archive, including
+ // those that encountered an error or were elided due to size considerations.
+ repeated PageInfo page_infos = 1;
+ // Format of the body.
+ OutputFormat output_format = 2;
+ // Resource name for the body which can be read via the ByteStream API.
+ // This resource will remain available for a minimum of 24 hours after the
+ // GeneratePageBundle request.
+ string body_name = 3;
+ // Length of the body in bytes.
+ int64 body_length = 4;
+}
+
+// Information about a single returned offline page.
+message PageInfo {
+ // The URL of the page that was rendered.
+ string url = 1;
+ // The final URL after redirects. Empty if the final URL is url.
+ string redirect_url = 2;
+ // Status of the render attempt. If status.code != OK, fields below this will
+ // be unset. If the operation is still running, status is NotFound to
+ // indicate the page is still being processed.
+ // If the page was not returned due to bundle size limits, status is
+ // FailedPrecondition. If the page failed to render for any other reason,
+ // status is Unknown.
+ Status status = 3;
+ // Transformation that was applied to the page.
+ Transformation transformation = 4;
+ // Time the page was rendered.
+ Timestamp render_time = 5;
+}
+
+// Request to return a list of pages in a format suitable for offline viewing.
+message GeneratePageBundleRequest {
+ // The client's browser's user agent string.
+ string user_agent = 1;
+ // Preferred browser language(s) as defined by
+ // [IETF BCP 47](https://tools.ietf.org/html/bcp47).
+ repeated string browser_languages = 2;
+ // Desired format of the web page archive(s).
+ OutputFormat output_format = 3;
+ // Maximum size of the generated body. If all pages' output would exceed this
+ // size, only the first N pages are returned.
+ int64 max_bundle_size_bytes = 4;
+ // The GCM registration ID that can be used to inform the client
+ // of LRO completion.
+ string gcm_registration_id = 5;
+ // List of individual page requests, in order of priority. At most 100 pages
+ // may be requested at a time.
+ repeated PageParameters pages = 6;
+}
+
+// Request a set of pages to be returned in a format suitable for offline
+// viewing.
+message PageParameters {
+ // URL of the web page to return.
+ string url = 1;
+ // Transformation to apply. Must not be TRANSFORMATION_UNSPECIFIED.
+ Transformation transformation = 2;
+}
« no previous file with comments | « components/offline_pages/core/prefetch/proto/any.proto ('k') | components/offline_pages/core/prefetch/proto/operation.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698