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

Side by Side Diff: components/gcm_driver/gcm_driver_desktop.cc

Issue 1243563002: Teach the GCM Driver how to decrypt incoming messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm-push-keys
Patch Set: address comment Created 5 years, 2 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
« no previous file with comments | « components/gcm_driver/gcm_driver_android.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/gcm_driver/gcm_driver_desktop.h" 5 #include "components/gcm_driver/gcm_driver_desktop.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 } 1188 }
1189 1189
1190 void GCMDriverDesktop::MessageReceived(const std::string& app_id, 1190 void GCMDriverDesktop::MessageReceived(const std::string& app_id,
1191 const IncomingMessage& message) { 1191 const IncomingMessage& message) {
1192 DCHECK(ui_thread_->RunsTasksOnCurrentThread()); 1192 DCHECK(ui_thread_->RunsTasksOnCurrentThread());
1193 1193
1194 // Drop the event if the service has been stopped. 1194 // Drop the event if the service has been stopped.
1195 if (!gcm_started_) 1195 if (!gcm_started_)
1196 return; 1196 return;
1197 1197
1198 GetAppHandler(app_id)->OnMessage(app_id, message); 1198 DispatchMessage(app_id, message);
1199 } 1199 }
1200 1200
1201 void GCMDriverDesktop::MessagesDeleted(const std::string& app_id) { 1201 void GCMDriverDesktop::MessagesDeleted(const std::string& app_id) {
1202 DCHECK(ui_thread_->RunsTasksOnCurrentThread()); 1202 DCHECK(ui_thread_->RunsTasksOnCurrentThread());
1203 1203
1204 // Drop the event if the service has been stopped. 1204 // Drop the event if the service has been stopped.
1205 if (!gcm_started_) 1205 if (!gcm_started_)
1206 return; 1206 return;
1207 1207
1208 GetAppHandler(app_id)->OnMessagesDeleted(app_id); 1208 GetAppHandler(app_id)->OnMessagesDeleted(app_id);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 1298
1299 if (base::get<1>(a) < base::get<1>(b)) 1299 if (base::get<1>(a) < base::get<1>(b))
1300 return true; 1300 return true;
1301 if (base::get<1>(a) > base::get<1>(b)) 1301 if (base::get<1>(a) > base::get<1>(b))
1302 return false; 1302 return false;
1303 1303
1304 return base::get<2>(a) < base::get<2>(b); 1304 return base::get<2>(a) < base::get<2>(b);
1305 } 1305 }
1306 1306
1307 } // namespace gcm 1307 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_driver_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698