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

Unified Diff: components/precache/core/precache_manifest_util.h

Issue 2802053002: precache: Extract common methods for PrecacheManifest into util. (Closed)
Patch Set: Copyright. Created 3 years, 8 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
« no previous file with comments | « components/precache/core/precache_fetcher.cc ('k') | components/precache/core/precache_manifest_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/precache/core/precache_manifest_util.h
diff --git a/components/precache/core/precache_manifest_util.h b/components/precache/core/precache_manifest_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..b3e2ec2f55bc9bf15bbdc3fe2cf303a13307cfcd
--- /dev/null
+++ b/components/precache/core/precache_manifest_util.h
@@ -0,0 +1,30 @@
+// 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.
+
+#ifndef COMPONENTS_PRECACHE_CORE_PRECACHE_MANIFEST_UTIL_H_
+#define COMPONENTS_PRECACHE_CORE_PRECACHE_MANIFEST_UTIL_H_
+
+#include <stdint.h>
+
+#include <vector>
+
+#include "base/optional.h"
+
+namespace precache {
+
+class PrecacheManifest;
+
+// Removes unknown fields from the |manifest| including embedded messages.
+void RemoveUnknownFields(PrecacheManifest* manifest);
+
+// Returns the resource selection bitset from the |manifest| for the given
+// |experiment_id|. If the experiment group is not found, then this returns
+// nullopt, in which case all resources should be selected.
+base::Optional<std::vector<bool>> GetResourceBitset(
+ const PrecacheManifest& manifest,
+ uint32_t experiment_id);
+
+} // namespace precache
+
+#endif // COMPONENTS_PRECACHE_CORE_PRECACHE_MANIFEST_UTIL_H_
« no previous file with comments | « components/precache/core/precache_fetcher.cc ('k') | components/precache/core/precache_manifest_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698