| 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 #include <limits.h> | 5 #include <limits.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 // SdchObserver | 1238 // SdchObserver |
| 1239 void OnDictionaryUsed(SdchManager* manager, | 1239 void OnDictionaryUsed(SdchManager* manager, |
| 1240 const std::string& server_hash) override { | 1240 const std::string& server_hash) override { |
| 1241 dictionary_used_++; | 1241 dictionary_used_++; |
| 1242 last_server_hash_ = server_hash; | 1242 last_server_hash_ = server_hash; |
| 1243 } | 1243 } |
| 1244 | 1244 |
| 1245 int dictionary_used_calls() const { return dictionary_used_; } | 1245 int dictionary_used_calls() const { return dictionary_used_; } |
| 1246 std::string last_server_hash() const { return last_server_hash_; } | 1246 std::string last_server_hash() const { return last_server_hash_; } |
| 1247 | 1247 |
| 1248 void OnDictionaryAdded(SdchManager* /* manager */, |
| 1249 const GURL& /* dictionary_url */, |
| 1250 const std::string& /* server_hash */) override {} |
| 1251 void OnDictionaryRemoved(SdchManager* /* manager */, |
| 1252 const std::string& /* server_hash */) override {} |
| 1248 void OnGetDictionary(SdchManager* /* manager */, | 1253 void OnGetDictionary(SdchManager* /* manager */, |
| 1249 const GURL& /* request_url */, | 1254 const GURL& /* request_url */, |
| 1250 const GURL& /* dictionary_url */) override {} | 1255 const GURL& /* dictionary_url */) override {} |
| 1251 void OnClearDictionaries(SdchManager* /* manager */) override {} | 1256 void OnClearDictionaries(SdchManager* /* manager */) override {} |
| 1252 | 1257 |
| 1253 private: | 1258 private: |
| 1254 int dictionary_used_; | 1259 int dictionary_used_; |
| 1255 std::string last_server_hash_; | 1260 std::string last_server_hash_; |
| 1256 SdchManager* manager_; | 1261 SdchManager* manager_; |
| 1257 | 1262 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 | 1296 |
| 1292 filter.reset(nullptr); | 1297 filter.reset(nullptr); |
| 1293 | 1298 |
| 1294 // Confirm that we got a "DictionaryUsed" signal from the SdchManager | 1299 // Confirm that we got a "DictionaryUsed" signal from the SdchManager |
| 1295 // for our dictionary. | 1300 // for our dictionary. |
| 1296 EXPECT_EQ(1, observer.dictionary_used_calls()); | 1301 EXPECT_EQ(1, observer.dictionary_used_calls()); |
| 1297 EXPECT_EQ(server_hash, observer.last_server_hash()); | 1302 EXPECT_EQ(server_hash, observer.last_server_hash()); |
| 1298 } | 1303 } |
| 1299 | 1304 |
| 1300 } // namespace net | 1305 } // namespace net |
| OLD | NEW |