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

Side by Side Diff: chrome/browser/net/transport_security_persister.cc

Issue 15987009: Update chrome/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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/net/transport_security_persister.h" 5 #include "chrome/browser/net/transport_security_persister.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
95 state_valid_ = file_util::ReadFileToString(path_, &state_); 95 state_valid_ = file_util::ReadFileToString(path_, &state_);
96 } 96 }
97 97
98 void CompleteLoad() { 98 void CompleteLoad() {
99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
100 100
101 // Make sure we're deleted. 101 // Make sure we're deleted.
102 scoped_ptr<Loader> deleter(this); 102 scoped_ptr<Loader> deleter(this);
103 103
104 if (!persister_ || !state_valid_) 104 if (!persister_.get() || !state_valid_)
105 return; 105 return;
106 persister_->CompleteLoad(state_); 106 persister_->CompleteLoad(state_);
107 } 107 }
108 108
109 private: 109 private:
110 base::WeakPtr<TransportSecurityPersister> persister_; 110 base::WeakPtr<TransportSecurityPersister> persister_;
111 111
112 base::FilePath path_; 112 base::FilePath path_;
113 113
114 std::string state_; 114 std::string state_;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 309 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
310 310
311 bool dirty = false; 311 bool dirty = false;
312 if (!LoadEntries(state, &dirty)) { 312 if (!LoadEntries(state, &dirty)) {
313 LOG(ERROR) << "Failed to deserialize state: " << state; 313 LOG(ERROR) << "Failed to deserialize state: " << state;
314 return; 314 return;
315 } 315 }
316 if (dirty) 316 if (dirty)
317 StateIsDirty(transport_security_state_); 317 StateIsDirty(transport_security_state_);
318 } 318 }
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_url_request_context.cc ('k') | chrome/browser/policy/cloud/external_policy_data_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698