OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/browsing_data/browsing_data_remover.h" | 5 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 } | 486 } |
487 | 487 |
488 int ChannelIDCount() { return channel_id_service_->channel_id_count(); } | 488 int ChannelIDCount() { return channel_id_service_->channel_id_count(); } |
489 | 489 |
490 // Add a server bound cert for |server| with specific creation and expiry | 490 // Add a server bound cert for |server| with specific creation and expiry |
491 // times. The cert and key data will be filled with dummy values. | 491 // times. The cert and key data will be filled with dummy values. |
492 void AddChannelIDWithTimes(const std::string& server_identifier, | 492 void AddChannelIDWithTimes(const std::string& server_identifier, |
493 base::Time creation_time) { | 493 base::Time creation_time) { |
494 GetChannelIDStore()->SetChannelID( | 494 GetChannelIDStore()->SetChannelID( |
495 base::WrapUnique(new net::ChannelIDStore::ChannelID( | 495 base::WrapUnique(new net::ChannelIDStore::ChannelID( |
496 server_identifier, creation_time, | 496 server_identifier, creation_time, crypto::ECPrivateKey::Create()))); |
497 base::WrapUnique(crypto::ECPrivateKey::Create())))); | |
498 } | 497 } |
499 | 498 |
500 // Add a server bound cert for |server|, with the current time as the | 499 // Add a server bound cert for |server|, with the current time as the |
501 // creation time. The cert and key data will be filled with dummy values. | 500 // creation time. The cert and key data will be filled with dummy values. |
502 void AddChannelID(const std::string& server_identifier) { | 501 void AddChannelID(const std::string& server_identifier) { |
503 base::Time now = base::Time::Now(); | 502 base::Time now = base::Time::Now(); |
504 AddChannelIDWithTimes(server_identifier, now); | 503 AddChannelIDWithTimes(server_identifier, now); |
505 } | 504 } |
506 | 505 |
507 void GetChannelIDList(net::ChannelIDStore::ChannelIDList* channel_ids) { | 506 void GetChannelIDList(net::ChannelIDStore::ChannelIDList* channel_ids) { |
(...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2537 BrowsingDataRemover::ClearSettingsForOneTypeWithPredicate( | 2536 BrowsingDataRemover::ClearSettingsForOneTypeWithPredicate( |
2538 host_content_settings_map, CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, | 2537 host_content_settings_map, CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, |
2539 base::Bind(&MatchPrimaryPattern, http_pattern)); | 2538 base::Bind(&MatchPrimaryPattern, http_pattern)); |
2540 // Verify we only have one, and it's url1. | 2539 // Verify we only have one, and it's url1. |
2541 host_content_settings_map->GetSettingsForOneType( | 2540 host_content_settings_map->GetSettingsForOneType( |
2542 CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, std::string(), &host_settings); | 2541 CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, std::string(), &host_settings); |
2543 EXPECT_EQ(1u, host_settings.size()); | 2542 EXPECT_EQ(1u, host_settings.size()); |
2544 EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(url1), | 2543 EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(url1), |
2545 host_settings[0].primary_pattern); | 2544 host_settings[0].primary_pattern); |
2546 } | 2545 } |
OLD | NEW |