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

Side by Side Diff: extensions/browser/updater/manifest_fetch_data.h

Issue 2299203004: Attempt to repair corrupt enterprise policy force-installed extensions (Closed)
Patch Set: fix chromeos compile problem Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EXTENSIONS_BROWSER_UPDATER_MANIFEST_FETCH_DATA_H_ 5 #ifndef EXTENSIONS_BROWSER_UPDATER_MANIFEST_FETCH_DATA_H_
6 #define EXTENSIONS_BROWSER_UPDATER_MANIFEST_FETCH_DATA_H_ 6 #define EXTENSIONS_BROWSER_UPDATER_MANIFEST_FETCH_DATA_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 active_days(0), 63 active_days(0),
64 is_enabled(true), 64 is_enabled(true),
65 disable_reasons(0) {} 65 disable_reasons(0) {}
66 PingData(int rollcall, int active, bool enabled, int reasons) 66 PingData(int rollcall, int active, bool enabled, int reasons)
67 : rollcall_days(rollcall), 67 : rollcall_days(rollcall),
68 active_days(active), 68 active_days(active),
69 is_enabled(enabled), 69 is_enabled(enabled),
70 disable_reasons(reasons) {} 70 disable_reasons(reasons) {}
71 }; 71 };
72 72
73 // A variety of parameters for special cases that aren't used for most
74 // requests.
75 struct ExtraParams {
76 // Additional data to be passed up in the update request.
77 std::string update_url_data;
78
79 // Indicates whether this is a policy force-installed extension that we're
80 // reinstalling due to corruption being detected in it.
lazyboy 2016/09/02 19:21:53 s/detected in it/detected in the extension as this
asargent_no_longer_on_chrome 2016/09/09 03:30:44 Comment simplified (Note that this struct moved to
81 bool is_corrupt_policy_reinstall;
lazyboy 2016/09/02 19:21:53 (again feel free to suggest something better) in o
asargent_no_longer_on_chrome 2016/09/09 03:30:44 This moved to extension_downloader.h, and I change
82
83 ExtraParams();
84 };
85
73 ManifestFetchData(const GURL& update_url, 86 ManifestFetchData(const GURL& update_url,
74 int request_id, 87 int request_id,
75 const std::string& brand_code, 88 const std::string& brand_code,
76 const std::string& base_query_params, 89 const std::string& base_query_params,
77 PingMode ping_mode); 90 PingMode ping_mode);
78 ~ManifestFetchData(); 91 ~ManifestFetchData();
79 92
80 // Returns true if this extension information was successfully added. If the 93 // Returns true if this extension information was successfully added. If the
81 // return value is false it means the full_url would have become too long, and 94 // return value is false it means the full_url would have become too long, and
82 // this ManifestFetchData object remains unchanged. 95 // this ManifestFetchData object remains unchanged.
83 bool AddExtension(const std::string& id, 96 bool AddExtension(const std::string& id,
84 const std::string& version, 97 const std::string& version,
85 const PingData* ping_data, 98 const PingData* ping_data,
86 const std::string& update_url_data, 99 const std::string& install_source,
87 const std::string& install_source); 100 const ExtraParams* extra_params);
88 101
89 const GURL& base_url() const { return base_url_; } 102 const GURL& base_url() const { return base_url_; }
90 const GURL& full_url() const { return full_url_; } 103 const GURL& full_url() const { return full_url_; }
91 const std::set<std::string>& extension_ids() const { return extension_ids_; } 104 const std::set<std::string>& extension_ids() const { return extension_ids_; }
92 const std::set<int>& request_ids() const { return request_ids_; } 105 const std::set<int>& request_ids() const { return request_ids_; }
93 106
94 // Returns true if the given id is included in this manifest fetch. 107 // Returns true if the given id is included in this manifest fetch.
95 bool Includes(const std::string& extension_id) const; 108 bool Includes(const std::string& extension_id) const;
96 109
97 // Returns true if a ping parameter for |type| was added to full_url for this 110 // Returns true if a ping parameter for |type| was added to full_url for this
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // The ping mode for this fetch. This determines whether or not ping data 144 // The ping mode for this fetch. This determines whether or not ping data
132 // (and possibly extra metrics) will be included in the fetch query. 145 // (and possibly extra metrics) will be included in the fetch query.
133 const PingMode ping_mode_; 146 const PingMode ping_mode_;
134 147
135 DISALLOW_COPY_AND_ASSIGN(ManifestFetchData); 148 DISALLOW_COPY_AND_ASSIGN(ManifestFetchData);
136 }; 149 };
137 150
138 } // namespace extensions 151 } // namespace extensions
139 152
140 #endif // EXTENSIONS_BROWSER_UPDATER_MANIFEST_FETCH_DATA_H_ 153 #endif // EXTENSIONS_BROWSER_UPDATER_MANIFEST_FETCH_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698