OLD | NEW |
---|---|
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 CHROME_BROWSER_EXTENSIONS_UPDATER_MANIFEST_FETCH_DATA_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_UPDATER_MANIFEST_FETCH_DATA_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_UPDATER_MANIFEST_FETCH_DATA_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 ManifestFetchData(const GURL& update_url, int request_id); | 49 ManifestFetchData(const GURL& update_url, int request_id); |
50 ~ManifestFetchData(); | 50 ~ManifestFetchData(); |
51 | 51 |
52 // Returns true if this extension information was successfully added. If the | 52 // Returns true if this extension information was successfully added. If the |
53 // return value is false it means the full_url would have become too long, and | 53 // return value is false it means the full_url would have become too long, and |
54 // this ManifestFetchData object remains unchanged. | 54 // this ManifestFetchData object remains unchanged. |
55 bool AddExtension(const std::string& id, | 55 bool AddExtension(const std::string& id, |
56 const std::string& version, | 56 const std::string& version, |
57 const PingData* ping_data, | 57 const PingData* ping_data, |
58 const std::string& update_url_data, | 58 const std::string& update_url_data, |
59 const std::string& install_source); | 59 const std::string& install_source, |
60 bool force_update); | |
60 | 61 |
61 const GURL& base_url() const { return base_url_; } | 62 const GURL& base_url() const { return base_url_; } |
62 const GURL& full_url() const { return full_url_; } | 63 const GURL& full_url() const { return full_url_; } |
63 const std::set<std::string>& extension_ids() const { return extension_ids_; } | 64 const std::set<std::string>& extension_ids() const { return extension_ids_; } |
64 const std::set<int>& request_ids() const { return request_ids_; } | 65 const std::set<int>& request_ids() const { return request_ids_; } |
65 | 66 |
66 // Returns true if the given id is included in this manifest fetch. | 67 // Returns true if the given id is included in this manifest fetch. |
67 bool Includes(const std::string& extension_id) const; | 68 bool Includes(const std::string& extension_id) const; |
68 | 69 |
69 // Returns true if a ping parameter for |type| was added to full_url for this | 70 // Returns true if a ping parameter for |type| was added to full_url for this |
70 // extension id. | 71 // extension id. |
71 bool DidPing(const std::string& extension_id, PingType type) const; | 72 bool DidPing(const std::string& extension_id, PingType type) const; |
72 | 73 |
73 // Assuming that both this ManifestFetchData and |other| have the same | 74 // Assuming that both this ManifestFetchData and |other| have the same |
74 // full_url, this method merges the other information associated with the | 75 // full_url, this method merges the other information associated with the |
75 // fetch (in particular this adds all request ids associated with |other| | 76 // fetch (in particular this adds all request ids associated with |other| |
76 // to this ManifestFetchData). | 77 // to this ManifestFetchData). |
77 void Merge(const ManifestFetchData& other); | 78 void Merge(const ManifestFetchData& other); |
78 | 79 |
80 // Indiciates whether or not a given extension ID was forced to update. | |
Sorin Jianu
2014/09/02 20:06:39
Indicates.
Or rephrase to "Returns true if a give
Ken Rockot(use gerrit already)
2014/09/02 20:19:20
Done.
| |
81 bool DidForceUpdate(const std::string& extension_id) const; | |
82 | |
79 private: | 83 private: |
80 // The set of extension id's for this ManifestFetchData. | 84 // The set of extension id's for this ManifestFetchData. |
81 std::set<std::string> extension_ids_; | 85 std::set<std::string> extension_ids_; |
82 | 86 |
83 // The set of ping data we actually sent. | 87 // The set of ping data we actually sent. |
84 std::map<std::string, PingData> pings_; | 88 std::map<std::string, PingData> pings_; |
85 | 89 |
86 // The base update url without any arguments added. | 90 // The base update url without any arguments added. |
87 GURL base_url_; | 91 GURL base_url_; |
88 | 92 |
89 // The base update url plus arguments indicating the id, version, etc. | 93 // The base update url plus arguments indicating the id, version, etc. |
90 // information about each extension. | 94 // information about each extension. |
91 GURL full_url_; | 95 GURL full_url_; |
92 | 96 |
93 // The set of request ids associated with this manifest fetch. If multiple | 97 // The set of request ids associated with this manifest fetch. If multiple |
94 // requests are trying to fetch the same manifest, they can be merged into | 98 // requests are trying to fetch the same manifest, they can be merged into |
95 // one fetch, so potentially multiple request ids can get associated with | 99 // one fetch, so potentially multiple request ids can get associated with |
96 // one ManifestFetchData. | 100 // one ManifestFetchData. |
97 std::set<int> request_ids_; | 101 std::set<int> request_ids_; |
98 | 102 |
Sorin Jianu
2014/09/02 20:06:39
Comment? The other private members have comments.
Ken Rockot(use gerrit already)
2014/09/02 20:19:20
Done.
| |
103 std::set<std::string> forced_updates_; | |
104 | |
99 DISALLOW_COPY_AND_ASSIGN(ManifestFetchData); | 105 DISALLOW_COPY_AND_ASSIGN(ManifestFetchData); |
100 }; | 106 }; |
101 | 107 |
102 } // namespace extensions | 108 } // namespace extensions |
103 | 109 |
104 #endif // CHROME_BROWSER_EXTENSIONS_UPDATER_MANIFEST_FETCH_DATA_H_ | 110 #endif // CHROME_BROWSER_EXTENSIONS_UPDATER_MANIFEST_FETCH_DATA_H_ |
OLD | NEW |