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

Unified Diff: components/update_client/utils.h

Issue 2102083002: Allow component installers to specify a map of installer attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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/update_client/update_client.h ('k') | components/update_client/utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/utils.h
diff --git a/components/update_client/utils.h b/components/update_client/utils.h
index 2306cf2a8373dcd29c8275df896700e5bf315fc7..f800b4fb895c443c0f5ac3b1b83d4a8f92e1d370 100644
--- a/components/update_client/utils.h
+++ b/components/update_client/utils.h
@@ -7,6 +7,7 @@
#include <memory>
#include <string>
+#include <utility>
#include <vector>
@@ -28,6 +29,11 @@ class Configurator;
struct CrxComponent;
struct CrxUpdateItem;
+// Defines a name-value pair that represents an installer attribute.
+// Installer attributes are component-specific metadata, which may be serialized
+// in an update check request.
+using InstallerAttribute = std::pair<std::string, std::string>;
+
// An update protocol request starts with a common preamble which includes
// version and platform information for Chrome and the operating system,
// followed by a request body, which is the actual payload of the request.
@@ -99,8 +105,10 @@ bool VerifyFileHash256(const base::FilePath& filepath,
// Returns true if the |brand| parameter matches ^[a-zA-Z]{4}?$ .
bool IsValidBrand(const std::string& brand);
-// Returns true if the |ap| parameter matches ^[-+_=a-zA-Z0-9]{0,256}$ .
-bool IsValidAp(const std::string& ap);
+// Returns true if the name part of the |attr| parameter matches
+// ^[-_a-zA-Z0-9]{1,256}$ and the value part of the |attr| parameter
+// matches ^[-.,;+_=a-zA-Z0-9]{0,256}$ .
+bool IsValidInstallerAttribute(const InstallerAttribute& attr);
// Removes the unsecure urls in the |urls| parameter.
void RemoveUnsecureUrls(std::vector<GURL>* urls);
« no previous file with comments | « components/update_client/update_client.h ('k') | components/update_client/utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698