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

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

Issue 2874973002: Flush Channel IDs when Cookies get saved to a persistent backend (Closed)
Patch Set: Initialize channel_id_service to nullptr Created 3 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/quota_policy_channel_id_store.h" 5 #include "chrome/browser/net/quota_policy_channel_id_store.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 server_identifiers_.insert(channel_id.server_identifier()); 55 server_identifiers_.insert(channel_id.server_identifier());
56 persistent_store_->AddChannelID(channel_id); 56 persistent_store_->AddChannelID(channel_id);
57 } 57 }
58 58
59 void QuotaPolicyChannelIDStore::DeleteChannelID( 59 void QuotaPolicyChannelIDStore::DeleteChannelID(
60 const net::DefaultChannelIDStore::ChannelID& channel_id) { 60 const net::DefaultChannelIDStore::ChannelID& channel_id) {
61 server_identifiers_.erase(channel_id.server_identifier()); 61 server_identifiers_.erase(channel_id.server_identifier());
62 persistent_store_->DeleteChannelID(channel_id); 62 persistent_store_->DeleteChannelID(channel_id);
63 } 63 }
64 64
65 void QuotaPolicyChannelIDStore::Flush() {
66 persistent_store_->Flush();
67 }
68
65 void QuotaPolicyChannelIDStore::SetForceKeepSessionState() { 69 void QuotaPolicyChannelIDStore::SetForceKeepSessionState() {
66 special_storage_policy_ = NULL; 70 special_storage_policy_ = NULL;
67 } 71 }
68 72
69 void QuotaPolicyChannelIDStore::OnLoad( 73 void QuotaPolicyChannelIDStore::OnLoad(
70 const LoadedCallback& loaded_callback, 74 const LoadedCallback& loaded_callback,
71 std::unique_ptr<ChannelIDVector> channel_ids) { 75 std::unique_ptr<ChannelIDVector> channel_ids) {
72 for (ChannelIDVector::const_iterator channel_id = channel_ids->begin(); 76 for (ChannelIDVector::const_iterator channel_id = channel_ids->begin();
73 channel_id != channel_ids->end(); 77 channel_id != channel_ids->end();
74 ++channel_id) { 78 ++channel_id) {
75 server_identifiers_.insert((*channel_id)->server_identifier()); 79 server_identifiers_.insert((*channel_id)->server_identifier());
76 } 80 }
77 loaded_callback.Run(std::move(channel_ids)); 81 loaded_callback.Run(std::move(channel_ids));
78 } 82 }
OLDNEW
« no previous file with comments | « chrome/browser/net/quota_policy_channel_id_store.h ('k') | chrome/browser/profiles/profile_impl_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698