| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |