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

Side by Side Diff: chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler.cc

Issue 10911084: Implement Invalidator::Acknowledge (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adapt patch to new TickClock interface Created 7 years, 9 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/extensions/api/push_messaging/push_messaging_invalidati on_handler.h" 5 #include "chrome/browser/extensions/api/push_messaging/push_messaging_invalidati on_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 DCHECK(thread_checker_.CalledOnValidThread()); 118 DCHECK(thread_checker_.CalledOnValidThread());
119 for (syncer::ObjectIdInvalidationMap::const_iterator it = 119 for (syncer::ObjectIdInvalidationMap::const_iterator it =
120 invalidation_map.begin(); it != invalidation_map.end(); ++it) { 120 invalidation_map.begin(); it != invalidation_map.end(); ++it) {
121 std::string extension_id; 121 std::string extension_id;
122 int subchannel; 122 int subchannel;
123 if (ObjectIdToExtensionAndSubchannel(it->first, 123 if (ObjectIdToExtensionAndSubchannel(it->first,
124 &extension_id, 124 &extension_id,
125 &subchannel)) { 125 &subchannel)) {
126 delegate_->OnMessage(extension_id, subchannel, it->second.payload); 126 delegate_->OnMessage(extension_id, subchannel, it->second.payload);
127 } 127 }
128 service_->AcknowledgeInvalidation(it->first, it->second.ack_handle);
128 } 129 }
129 } 130 }
130 131
131 void PushMessagingInvalidationHandler::UpdateRegistrations() { 132 void PushMessagingInvalidationHandler::UpdateRegistrations() {
132 syncer::ObjectIdSet ids; 133 syncer::ObjectIdSet ids;
133 for (std::set<std::string>::const_iterator it = 134 for (std::set<std::string>::const_iterator it =
134 registered_extensions_.begin(); it != registered_extensions_.end(); 135 registered_extensions_.begin(); it != registered_extensions_.end();
135 ++it) { 136 ++it) {
136 const syncer::ObjectIdSet& object_ids = ExtensionIdToObjectIds(*it); 137 const syncer::ObjectIdSet& object_ids = ExtensionIdToObjectIds(*it);
137 ids.insert(object_ids.begin(), object_ids.end()); 138 ids.insert(object_ids.begin(), object_ids.end());
138 } 139 }
139 service_->UpdateRegisteredInvalidationIds(this, ids); 140 service_->UpdateRegisteredInvalidationIds(this, ids);
140 } 141 }
141 142
142 } // namespace extensions 143 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698