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

Side by Side Diff: components/safe_browsing_db/v4_update_protocol_manager.h

Issue 2090593003: Small: Use WebBase64/UrlBase64 encoding for requests sent to the server. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@01_UpdateDbAndStores
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 unified diff | Download patch
OLDNEW
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
89 89
90 // The method to populate |gurl| with the URL to be sent to the server. 90 // The method to populate |gurl| with the URL to be sent to the server.
91 // |request_base64| is the base64 encoded form of an instance of the protobuf 91 // |request_base64| is the base64 encoded form of an instance of the protobuf
92 // FetchThreatListUpdatesRequest. Also sets the appropriate header values for 92 // FetchThreatListUpdatesRequest. Also sets the appropriate header values for
93 // sending PVer4 requests in |headers|. 93 // sending PVer4 requests in |headers|.
94 void GetUpdateUrlAndHeaders(const std::string& request_base64, 94 void GetUpdateUrlAndHeaders(const std::string& request_base64,
95 GURL* gurl, 95 GURL* gurl,
96 net::HttpRequestHeaders* headers) const; 96 net::HttpRequestHeaders* headers) const;
97 97
98 // Fills a FetchThreatListUpdatesRequest protocol buffer for a request. 98 // Fills a FetchThreatListUpdatesRequest protocol buffer for a request.
99 // Returns the serialized and base 64 encoded request as a string. 99 // Returns the serialized and base64 URL encoded request as a string.
100 static std::string GetBase64SerializedUpdateRequestProto( 100 static std::string GetWebBase64SerializedUpdateRequestProto(
101 const StoreStateMap* store_state_map); 101 const StoreStateMap* store_state_map);
102 102
103 // Parses the base64 encoded response received from the server as a 103 // Parses the base64 encoded response received from the server as a
104 // FetchThreatListUpdatesResponse protobuf and returns each of the 104 // FetchThreatListUpdatesResponse protobuf and returns each of the
105 // ListUpdateResponse protobufs contained in it as a vector. 105 // ListUpdateResponse protobufs contained in it as a vector.
106 // Returns true if parsing is successful, false otherwise. 106 // Returns true if parsing is successful, false otherwise.
107 bool ParseUpdateResponse( 107 bool ParseUpdateResponse(
108 const std::string& data_base64, 108 const std::string& data_base64,
109 std::vector<ListUpdateResponse>* list_update_responses); 109 std::vector<ListUpdateResponse>* list_update_responses);
110 110
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 const V4ProtocolConfig& config, 185 const V4ProtocolConfig& config,
186 V4UpdateCallback callback) = 0; 186 V4UpdateCallback callback) = 0;
187 187
188 private: 188 private:
189 DISALLOW_COPY_AND_ASSIGN(V4UpdateProtocolManagerFactory); 189 DISALLOW_COPY_AND_ASSIGN(V4UpdateProtocolManagerFactory);
190 }; 190 };
191 191
192 } // namespace safe_browsing 192 } // namespace safe_browsing
193 193
194 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_UPDATE_PROTOCOL_MANAGER_H_ 194 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_UPDATE_PROTOCOL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698