| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "components/safe_browsing/browser/safe_browsing_url_request_context_get
ter.h" | 5 #include "components/safe_browsing/browser/safe_browsing_url_request_context_get
ter.h" |
| 6 | 6 |
| 7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
| 8 #include "base/task_scheduler/post_task.h" | 8 #include "base/task_scheduler/post_task.h" |
| 9 #include "components/safe_browsing/common/safebrowsing_constants.h" | 9 #include "components/safe_browsing/common/safebrowsing_constants.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 safe_browsing_request_context_->set_channel_id_service( | 71 safe_browsing_request_context_->set_channel_id_service( |
| 72 channel_id_service_.get()); | 72 channel_id_service_.get()); |
| 73 safe_browsing_cookie_store_->SetChannelIDServiceID( | 73 safe_browsing_cookie_store_->SetChannelIDServiceID( |
| 74 channel_id_service_->GetUniqueID()); | 74 channel_id_service_->GetUniqueID()); |
| 75 | 75 |
| 76 // Rebuild the HttpNetworkSession and the HttpTransactionFactory to use the | 76 // Rebuild the HttpNetworkSession and the HttpTransactionFactory to use the |
| 77 // new ChannelIDService. | 77 // new ChannelIDService. |
| 78 if (safe_browsing_request_context_->http_transaction_factory() && | 78 if (safe_browsing_request_context_->http_transaction_factory() && |
| 79 safe_browsing_request_context_->http_transaction_factory() | 79 safe_browsing_request_context_->http_transaction_factory() |
| 80 ->GetSession()) { | 80 ->GetSession()) { |
| 81 net::HttpNetworkSession::Params safe_browsing_params = | 81 net::HttpNetworkSession::Params safe_browsing_session_params = |
| 82 safe_browsing_request_context_->http_transaction_factory() | 82 safe_browsing_request_context_->http_transaction_factory() |
| 83 ->GetSession() | 83 ->GetSession() |
| 84 ->params(); | 84 ->params(); |
| 85 safe_browsing_params.channel_id_service = channel_id_service_.get(); | 85 net::HttpNetworkSession::Context safe_browsing_session_context = |
| 86 http_network_session_.reset( | 86 safe_browsing_request_context_->http_transaction_factory() |
| 87 new net::HttpNetworkSession(safe_browsing_params)); | 87 ->GetSession() |
| 88 ->context(); |
| 89 safe_browsing_session_context.channel_id_service = |
| 90 channel_id_service_.get(); |
| 91 http_network_session_.reset(new net::HttpNetworkSession( |
| 92 safe_browsing_session_params, safe_browsing_session_context)); |
| 88 http_transaction_factory_.reset( | 93 http_transaction_factory_.reset( |
| 89 new net::HttpNetworkLayer(http_network_session_.get())); | 94 new net::HttpNetworkLayer(http_network_session_.get())); |
| 90 safe_browsing_request_context_->set_http_transaction_factory( | 95 safe_browsing_request_context_->set_http_transaction_factory( |
| 91 http_transaction_factory_.get()); | 96 http_transaction_factory_.get()); |
| 92 } | 97 } |
| 93 safe_browsing_request_context_->set_name("safe_browsing"); | 98 safe_browsing_request_context_->set_name("safe_browsing"); |
| 94 } | 99 } |
| 95 | 100 |
| 96 return safe_browsing_request_context_.get(); | 101 return safe_browsing_request_context_.get(); |
| 97 } | 102 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 125 return base::FilePath(GetBaseFilename().value() + kCookiesFile); | 130 return base::FilePath(GetBaseFilename().value() + kCookiesFile); |
| 126 } | 131 } |
| 127 | 132 |
| 128 base::FilePath SafeBrowsingURLRequestContextGetter::ChannelIDFilePath() { | 133 base::FilePath SafeBrowsingURLRequestContextGetter::ChannelIDFilePath() { |
| 129 return base::FilePath(GetBaseFilename().value() + kChannelIDFile); | 134 return base::FilePath(GetBaseFilename().value() + kChannelIDFile); |
| 130 } | 135 } |
| 131 | 136 |
| 132 SafeBrowsingURLRequestContextGetter::~SafeBrowsingURLRequestContextGetter() {} | 137 SafeBrowsingURLRequestContextGetter::~SafeBrowsingURLRequestContextGetter() {} |
| 133 | 138 |
| 134 } // namespace safe_browsing | 139 } // namespace safe_browsing |
| OLD | NEW |