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

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

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 DISALLOW_COPY_AND_ASSIGN(Loader); 117 DISALLOW_COPY_AND_ASSIGN(Loader);
118 }; 118 };
119 119
120 TransportSecurityPersister::TransportSecurityPersister( 120 TransportSecurityPersister::TransportSecurityPersister(
121 TransportSecurityState* state, 121 TransportSecurityState* state,
122 const base::FilePath& profile_path, 122 const base::FilePath& profile_path,
123 bool readonly) 123 bool readonly)
124 : transport_security_state_(state), 124 : transport_security_state_(state),
125 writer_(profile_path.AppendASCII("TransportSecurity"), 125 writer_(profile_path.AppendASCII("TransportSecurity"),
126 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)), 126 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)
127 .get()),
127 readonly_(readonly), 128 readonly_(readonly),
128 weak_ptr_factory_(this) { 129 weak_ptr_factory_(this) {
129 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 130 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
130 131
131 transport_security_state_->SetDelegate(this); 132 transport_security_state_->SetDelegate(this);
132 133
133 Loader* loader = new Loader(weak_ptr_factory_.GetWeakPtr(), writer_.path()); 134 Loader* loader = new Loader(weak_ptr_factory_.GetWeakPtr(), writer_.path());
134 BrowserThread::PostTaskAndReply( 135 BrowserThread::PostTaskAndReply(
135 BrowserThread::FILE, FROM_HERE, 136 BrowserThread::FILE, FROM_HERE,
136 base::Bind(&Loader::Load, base::Unretained(loader)), 137 base::Bind(&Loader::Load, base::Unretained(loader)),
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 310 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
310 311
311 bool dirty = false; 312 bool dirty = false;
312 if (!LoadEntries(state, &dirty)) { 313 if (!LoadEntries(state, &dirty)) {
313 LOG(ERROR) << "Failed to deserialize state: " << state; 314 LOG(ERROR) << "Failed to deserialize state: " << state;
314 return; 315 return;
315 } 316 }
316 if (dirty) 317 if (dirty)
317 StateIsDirty(transport_security_state_); 318 StateIsDirty(transport_security_state_);
318 } 319 }
OLDNEW
« no previous file with comments | « chrome/browser/net/proxy_service_factory.cc ('k') | chrome/browser/notifications/message_center_settings_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698