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

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

Issue 6895039: Merge 82409 - Add command-line control of the HSTS preload list. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/742/src/
Patch Set: Created 9 years, 8 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
« no previous file with comments | « no previous file | net/base/net_switches.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/transport_security_persister.h" 5 #include "chrome/browser/transport_security_persister.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 44 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
45 NewRunnableMethod(this, 45 NewRunnableMethod(this,
46 &TransportSecurityPersister::CompleteLoad, 46 &TransportSecurityPersister::CompleteLoad,
47 state)); 47 state));
48 } 48 }
49 49
50 void TransportSecurityPersister::CompleteLoad(const std::string& state) { 50 void TransportSecurityPersister::CompleteLoad(const std::string& state) {
51 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 51 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
52 52
53 bool dirty = false; 53 bool dirty = false;
54 if (!transport_security_state_->Deserialise(state, &dirty)) { 54 if (!transport_security_state_->LoadEntries(state, &dirty)) {
55 LOG(ERROR) << "Failed to deserialize state: " << state; 55 LOG(ERROR) << "Failed to deserialize state: " << state;
56 return; 56 return;
57 } 57 }
58 if (dirty) 58 if (dirty)
59 StateIsDirty(transport_security_state_); 59 StateIsDirty(transport_security_state_);
60 } 60 }
61 61
62 void TransportSecurityPersister::StateIsDirty( 62 void TransportSecurityPersister::StateIsDirty(
63 net::TransportSecurityState* state) { 63 net::TransportSecurityState* state) {
64 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 64 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
(...skipping 22 matching lines...) Expand all
87 &TransportSecurityPersister::CompleteSave, 87 &TransportSecurityPersister::CompleteSave,
88 state)); 88 state));
89 } 89 }
90 90
91 void TransportSecurityPersister::CompleteSave(const std::string& state) { 91 void TransportSecurityPersister::CompleteSave(const std::string& state) {
92 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 92 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
93 DCHECK(!readonly_); 93 DCHECK(!readonly_);
94 94
95 file_util::WriteFile(state_file_, state.data(), state.size()); 95 file_util::WriteFile(state_file_, state.data(), state.size());
96 } 96 }
OLDNEW
« no previous file with comments | « no previous file | net/base/net_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698