| Index: chrome/browser/profiles/profile_io_data.cc
|
| diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
|
| index c4e0cd99ea99340dd0a1c09db223a65b0e501053..373b3e283e73d946074dd1c1910206ce02df5bc1 100644
|
| --- a/chrome/browser/profiles/profile_io_data.cc
|
| +++ b/chrome/browser/profiles/profile_io_data.cc
|
| @@ -4,7 +4,6 @@
|
|
|
| #include "chrome/browser/profiles/profile_io_data.h"
|
|
|
| -#include <stddef.h>
|
| #include <string>
|
| #include <utility>
|
|
|
| @@ -56,6 +55,7 @@
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "components/about_handler/about_protocol_handler.h"
|
| +#include "components/certificate_transparency/tree_state_tracker.h"
|
| #include "components/content_settings/core/browser/content_settings_provider.h"
|
| #include "components/content_settings/core/browser/cookie_settings.h"
|
| #include "components/content_settings/core/browser/host_content_settings_map.h"
|
| @@ -1133,7 +1133,37 @@ void ProfileIOData::Init(
|
| new net::MultiLogCTVerifier());
|
| ct_verifier->AddLogs(io_thread_globals->ct_logs);
|
| main_request_context_->set_cert_transparency_verifier(ct_verifier.get());
|
| +
|
| + VLOG(1) << "Creating TreeStateTracker observer on ProfileIOData.";
|
| +
|
| + /*
|
| + if (!IsOffTheRecord()) {
|
| + VLOG(1) << "New Disk-based TreeStateStorage in "
|
| + << profile_params_->path.AsUTF8Unsafe();
|
| + tree_storage.reset(new certificate_transparency::DiskTreeStateStorage(
|
| + profile_params_->path.Append("CertificateTransparency")));
|
| + } else {
|
| + VLOG(1) << "New Memory-based TreeStateStorage.";
|
| + tree_storage.reset(new certificate_transparency::MemoryTreeStateStorage());
|
| + }
|
| + */
|
| +
|
| + scoped_ptr<certificate_transparency::TreeStateTracker> scts_observer(
|
| + new certificate_transparency::TreeStateTracker(
|
| + io_thread_globals->ct_logs));
|
| + ct_verifier->SetObserver(scts_observer.get());
|
| cert_transparency_verifier_ = std::move(ct_verifier);
|
| + cert_transparency_observer_ = std::move(scts_observer);
|
| + VLOG(1) << "XXX Registering observer to the STHReporter.";
|
| +
|
| + io_thread_globals->sth_observers_registrar.SignUpForRegistration(
|
| + cert_transparency_observer_.get());
|
| + cert_transparency_observer_unregistration_ = base::Bind(
|
| + &net::ct::STHReporterRegistrar::UnregisterObserver,
|
| + base::Unretained(&(io_thread_globals->sth_observers_registrar)),
|
| + cert_transparency_observer_.get());
|
| +
|
| + VLOG(1) << "TreeStateTracker observer on ProfileIOData created.";
|
|
|
| InitializeInternal(std::move(network_delegate), profile_params_.get(),
|
| protocol_handlers, std::move(request_interceptors));
|
| @@ -1280,6 +1310,12 @@ void ProfileIOData::set_channel_id_service(
|
|
|
| void ProfileIOData::DestroyResourceContext() {
|
| resource_context_.reset();
|
| + // Stop any new URLRequests from being made by the cert_transparency_observer_
|
| + // by stopping notifications to it from the CTVerifier.
|
| + cert_transparency_verifier_->SetObserver(nullptr);
|
| + cert_transparency_observer_unregistration_.Run();
|
| +
|
| + VLOG(1) << "XXX: ProfileIOData::DestroyResourceContext";
|
| }
|
|
|
| scoped_ptr<net::HttpNetworkSession> ProfileIOData::CreateHttpNetworkSession(
|
|
|