Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_SAFE_BROWSING_DB_V4_UPDATE_PROTOCOL_MANAGER_H_ | 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_UPDATE_PROTOCOL_MANAGER_H_ |
| 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_UPDATE_PROTOCOL_MANAGER_H_ | 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_UPDATE_PROTOCOL_MANAGER_H_ |
| 7 | 7 |
| 8 // A class that implements Chrome's interface with the SafeBrowsing V4 update | 8 // A class that implements Chrome's interface with the SafeBrowsing V4 update |
| 9 // protocol. | 9 // protocol. |
| 10 // | 10 // |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 // |request_base64| is the base64 encoded form of an instance of the protobuf | 93 // |request_base64| is the base64 encoded form of an instance of the protobuf |
| 94 // FetchThreatListUpdatesRequest. Also sets the appropriate header values for | 94 // FetchThreatListUpdatesRequest. Also sets the appropriate header values for |
| 95 // sending PVer4 requests in |headers|. | 95 // sending PVer4 requests in |headers|. |
| 96 void GetUpdateUrlAndHeaders(const std::string& request_base64, | 96 void GetUpdateUrlAndHeaders(const std::string& request_base64, |
| 97 GURL* gurl, | 97 GURL* gurl, |
| 98 net::HttpRequestHeaders* headers) const; | 98 net::HttpRequestHeaders* headers) const; |
| 99 | 99 |
| 100 // Fills a FetchThreatListUpdatesRequest protocol buffer for a request. | 100 // Fills a FetchThreatListUpdatesRequest protocol buffer for a request. |
| 101 // Returns the serialized and base64 URL encoded request as a string. | 101 // Returns the serialized and base64 URL encoded request as a string. |
| 102 static std::string GetBase64SerializedUpdateRequestProto( | 102 static std::string GetBase64SerializedUpdateRequestProto( |
| 103 const StoreStateMap& store_state_map); | 103 const StoreStateMap& store_state_map, |
|
Nathan Parker
2016/09/20 00:54:36
Would it be cleaner to make this function non-stat
| |
| 104 const V4ProtocolConfig& config); | |
| 104 | 105 |
| 105 // Parses the base64 encoded response received from the server as a | 106 // Parses the base64 encoded response received from the server as a |
| 106 // FetchThreatListUpdatesResponse protobuf and returns each of the | 107 // FetchThreatListUpdatesResponse protobuf and returns each of the |
| 107 // ListUpdateResponse protobufs contained in it as a vector. | 108 // ListUpdateResponse protobufs contained in it as a vector. |
| 108 // Returns true if parsing is successful, false otherwise. | 109 // Returns true if parsing is successful, false otherwise. |
| 109 bool ParseUpdateResponse(const std::string& data_base64, | 110 bool ParseUpdateResponse(const std::string& data_base64, |
| 110 ParsedServerResponse* parsed_server_response); | 111 ParsedServerResponse* parsed_server_response); |
| 111 | 112 |
| 112 // Resets the update error counter and multiplier. | 113 // Resets the update error counter and multiplier. |
| 113 void ResetUpdateErrors(); | 114 void ResetUpdateErrors(); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 const V4ProtocolConfig& config, | 187 const V4ProtocolConfig& config, |
| 187 V4UpdateCallback callback) = 0; | 188 V4UpdateCallback callback) = 0; |
| 188 | 189 |
| 189 private: | 190 private: |
| 190 DISALLOW_COPY_AND_ASSIGN(V4UpdateProtocolManagerFactory); | 191 DISALLOW_COPY_AND_ASSIGN(V4UpdateProtocolManagerFactory); |
| 191 }; | 192 }; |
| 192 | 193 |
| 193 } // namespace safe_browsing | 194 } // namespace safe_browsing |
| 194 | 195 |
| 195 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_UPDATE_PROTOCOL_MANAGER_H_ | 196 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_UPDATE_PROTOCOL_MANAGER_H_ |
| OLD | NEW |