| 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 "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" | 5 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 void TearDown() override { | 35 void TearDown() override { |
| 36 testing_profile_->GetSSLConfigService()->RemoveObserver(this); | 36 testing_profile_->GetSSLConfigService()->RemoveObserver(this); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void CreateChannelIDsForTest() { | 39 void CreateChannelIDsForTest() { |
| 40 net::URLRequestContext* context = | 40 net::URLRequestContext* context = |
| 41 testing_profile_->GetRequestContext()->GetURLRequestContext(); | 41 testing_profile_->GetRequestContext()->GetURLRequestContext(); |
| 42 net::ChannelIDStore* channel_id_store = | 42 net::ChannelIDStore* channel_id_store = |
| 43 context->channel_id_service()->GetChannelIDStore(); | 43 context->channel_id_service()->GetChannelIDStore(); |
| 44 channel_id_store->SetChannelID( | 44 channel_id_store->SetChannelID( |
| 45 base::WrapUnique(new net::ChannelIDStore::ChannelID( | 45 base::MakeUnique<net::ChannelIDStore::ChannelID>( |
| 46 "https://www.google.com:443", base::Time(), | 46 "https://www.google.com:443", base::Time(), |
| 47 crypto::ECPrivateKey::Create()))); | 47 crypto::ECPrivateKey::Create())); |
| 48 channel_id_store->SetChannelID( | 48 channel_id_store->SetChannelID( |
| 49 base::WrapUnique(new net::ChannelIDStore::ChannelID( | 49 base::MakeUnique<net::ChannelIDStore::ChannelID>( |
| 50 "https://www.youtube.com:443", base::Time(), | 50 "https://www.youtube.com:443", base::Time(), |
| 51 crypto::ECPrivateKey::Create()))); | 51 crypto::ECPrivateKey::Create())); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void FetchCallback( | 54 void FetchCallback( |
| 55 const net::ChannelIDStore::ChannelIDList& channel_ids) { | 55 const net::ChannelIDStore::ChannelIDList& channel_ids) { |
| 56 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 56 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 57 channel_id_list_ = channel_ids; | 57 channel_id_list_ = channel_ids; |
| 58 } | 58 } |
| 59 | 59 |
| 60 // net::SSLConfigService::Observer implementation: | 60 // net::SSLConfigService::Observer implementation: |
| 61 void OnSSLConfigChanged() override { ssl_config_changed_count_++; } | 61 void OnSSLConfigChanged() override { ssl_config_changed_count_++; } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 scoped_refptr<CannedBrowsingDataChannelIDHelper> helper( | 140 scoped_refptr<CannedBrowsingDataChannelIDHelper> helper( |
| 141 new CannedBrowsingDataChannelIDHelper()); | 141 new CannedBrowsingDataChannelIDHelper()); |
| 142 | 142 |
| 143 ASSERT_TRUE(helper->empty()); | 143 ASSERT_TRUE(helper->empty()); |
| 144 helper->AddChannelID(net::ChannelIDStore::ChannelID( | 144 helper->AddChannelID(net::ChannelIDStore::ChannelID( |
| 145 origin, base::Time(), crypto::ECPrivateKey::Create())); | 145 origin, base::Time(), crypto::ECPrivateKey::Create())); |
| 146 ASSERT_FALSE(helper->empty()); | 146 ASSERT_FALSE(helper->empty()); |
| 147 helper->Reset(); | 147 helper->Reset(); |
| 148 ASSERT_TRUE(helper->empty()); | 148 ASSERT_TRUE(helper->empty()); |
| 149 } | 149 } |
| OLD | NEW |