| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 TestGetUpdatesErrorHandlingNetwork); | 89 TestGetUpdatesErrorHandlingNetwork); |
| 90 FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, | 90 FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, |
| 91 TestGetUpdatesErrorHandlingResponseCode); | 91 TestGetUpdatesErrorHandlingResponseCode); |
| 92 FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, TestGetUpdatesNoError); | 92 FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, TestGetUpdatesNoError); |
| 93 FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, | 93 FRIEND_TEST_ALL_PREFIXES(V4UpdateProtocolManagerTest, |
| 94 TestGetUpdatesWithOneBackoff); | 94 TestGetUpdatesWithOneBackoff); |
| 95 friend class V4UpdateProtocolManagerFactoryImpl; | 95 friend class V4UpdateProtocolManagerFactoryImpl; |
| 96 | 96 |
| 97 // The method to generate the URL for the request to be sent to the server. | 97 // The method to generate the URL for the request to be sent to the server. |
| 98 // |request_base64| is the base64 encoded form of an instance of the protobuf | 98 // |request_base64| is the base64 encoded form of an instance of the protobuf |
| 99 // FetchThreatListUpdatesRequest. | 99 // FetchThreatListUpdatesRequest. Also sets the appropriate header values for |
| 100 GURL GetUpdateUrl(const std::string& request_base64) const; | 100 // sending PVer4 requests in |headers|. |
| 101 GURL GetUpdateUrlAndUpdateHeaders(const std::string& request_base64, |
| 102 net::HttpRequestHeaders* headers) const; |
| 101 | 103 |
| 102 // Fills a FetchThreatListUpdatesRequest protocol buffer for a request. | 104 // Fills a FetchThreatListUpdatesRequest protocol buffer for a request. |
| 103 // Returns the serialized and base 64 encoded request as a string. | 105 // Returns the serialized and base 64 encoded request as a string. |
| 104 std::string GetBase64SerializedUpdateRequestProto( | 106 std::string GetBase64SerializedUpdateRequestProto( |
| 105 const base::hash_map<UpdateListIdentifier, std::string>& | 107 const base::hash_map<UpdateListIdentifier, std::string>& |
| 106 current_list_states); | 108 current_list_states); |
| 107 | 109 |
| 108 // Parses the base64 encoded response received from the server as a | 110 // Parses the base64 encoded response received from the server as a |
| 109 // FetchThreatListUpdatesResponse protobuf and returns each of the | 111 // FetchThreatListUpdatesResponse protobuf and returns each of the |
| 110 // ListUpdateResponse protobufs contained in it as a vector. | 112 // ListUpdateResponse protobufs contained in it as a vector. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 current_list_states, | 196 current_list_states, |
| 195 V4UpdateCallback callback) = 0; | 197 V4UpdateCallback callback) = 0; |
| 196 | 198 |
| 197 private: | 199 private: |
| 198 DISALLOW_COPY_AND_ASSIGN(V4UpdateProtocolManagerFactory); | 200 DISALLOW_COPY_AND_ASSIGN(V4UpdateProtocolManagerFactory); |
| 199 }; | 201 }; |
| 200 | 202 |
| 201 } // namespace safe_browsing | 203 } // namespace safe_browsing |
| 202 | 204 |
| 203 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_UPDATE_PROTOCOL_MANAGER_H_ | 205 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_UPDATE_PROTOCOL_MANAGER_H_ |
| OLD | NEW |