Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 2373753002: Avoid dereferencing nullptr during ProfileIOData destruction (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 net::ChannelIDService* channel_id_service) const { 1319 net::ChannelIDService* channel_id_service) const {
1320 channel_id_service_.reset(channel_id_service); 1320 channel_id_service_.reset(channel_id_service);
1321 } 1321 }
1322 1322
1323 void ProfileIOData::DestroyResourceContext() { 1323 void ProfileIOData::DestroyResourceContext() {
1324 resource_context_.reset(); 1324 resource_context_.reset();
1325 // Prevent the cert_transparency_observer_ from getting any more 1325 // Prevent the cert_transparency_observer_ from getting any more
1326 // notifications by severing the link between it and the 1326 // notifications by severing the link between it and the
1327 // cert_transparency_verifier_ and unregistering it from new STH 1327 // cert_transparency_verifier_ and unregistering it from new STH
1328 // notifications. 1328 // notifications.
1329 cert_transparency_verifier_->SetObserver(nullptr); 1329 // Only do this if the profile was initalized and
1330 ct_tree_tracker_unregistration_.Run(); 1330 // |cert_transparency_verifier_| is not null.
1331 if (cert_transparency_verifier_) {
1332 cert_transparency_verifier_->SetObserver(nullptr);
1333 ct_tree_tracker_unregistration_.Run();
1334 }
1331 } 1335 }
1332 1336
1333 std::unique_ptr<net::HttpNetworkSession> 1337 std::unique_ptr<net::HttpNetworkSession>
1334 ProfileIOData::CreateHttpNetworkSession( 1338 ProfileIOData::CreateHttpNetworkSession(
1335 const ProfileParams& profile_params) const { 1339 const ProfileParams& profile_params) const {
1336 net::URLRequestContext* context = main_request_context(); 1340 net::URLRequestContext* context = main_request_context();
1337 1341
1338 IOThread* const io_thread = profile_params.io_thread; 1342 IOThread* const io_thread = profile_params.io_thread;
1339 1343
1340 net::HttpNetworkSession::Params params(io_thread->NetworkSessionParams()); 1344 net::HttpNetworkSession::Params params(io_thread->NetworkSessionParams());
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 void ProfileIOData::SetCookieSettingsForTesting( 1377 void ProfileIOData::SetCookieSettingsForTesting(
1374 content_settings::CookieSettings* cookie_settings) { 1378 content_settings::CookieSettings* cookie_settings) {
1375 DCHECK(!cookie_settings_.get()); 1379 DCHECK(!cookie_settings_.get());
1376 cookie_settings_ = cookie_settings; 1380 cookie_settings_ = cookie_settings;
1377 } 1381 }
1378 1382
1379 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( 1383 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState(
1380 const GURL& url) const { 1384 const GURL& url) const {
1381 return url_blacklist_manager_->GetURLBlacklistState(url); 1385 return url_blacklist_manager_->GetURLBlacklistState(url);
1382 } 1386 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698