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

Unified Diff: chrome/browser/extensions/app_notification_manager.cc

Issue 9460047: sync: remove use of protobuf extensions in protocol to reduce static init overhead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fred's review Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/app_notification_manager_sync_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/app_notification_manager.cc
diff --git a/chrome/browser/extensions/app_notification_manager.cc b/chrome/browser/extensions/app_notification_manager.cc
index 269107b1b43e1188e89c5953683f16e020893b45..f1272fa39ac051d95c9e09476dbf653acbe6e058 100644
--- a/chrome/browser/extensions/app_notification_manager.cc
+++ b/chrome/browser/extensions/app_notification_manager.cc
@@ -14,6 +14,7 @@
#include "base/time.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/protocol/app_notification_specifics.pb.h"
+#include "chrome/browser/sync/protocol/sync.pb.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "content/public/browser/notification_service.h"
@@ -56,8 +57,7 @@ void PopulateGuidToSyncDataMap(const SyncDataList& sync_data,
SyncDataMap* data_map) {
for (SyncDataList::const_iterator iter = sync_data.begin();
iter != sync_data.end(); ++iter) {
- (*data_map)[iter->GetSpecifics().GetExtension(
- sync_pb::app_notification).guid()] = *iter;
+ (*data_map)[iter->GetSpecifics().app_notification().guid()] = *iter;
}
}
} // namespace
@@ -515,7 +515,7 @@ SyncData AppNotificationManager::CreateSyncDataFromNotification(
DCHECK(!notification.is_local());
sync_pb::EntitySpecifics specifics;
sync_pb::AppNotification* notif_specifics =
- specifics.MutableExtension(sync_pb::app_notification);
+ specifics.mutable_app_notification();
notif_specifics->set_app_id(notification.extension_id());
notif_specifics->set_creation_timestamp_ms(
notification.creation_time().ToInternalValue());
@@ -532,7 +532,7 @@ SyncData AppNotificationManager::CreateSyncDataFromNotification(
AppNotification* AppNotificationManager::CreateNotificationFromSyncData(
const SyncData& sync_data) {
sync_pb::AppNotification specifics =
- sync_data.GetSpecifics().GetExtension(sync_pb::app_notification);
+ sync_data.GetSpecifics().app_notification();
// Check for mandatory fields.
if (!specifics.has_app_id() || !specifics.has_guid() ||
« no previous file with comments | « no previous file | chrome/browser/extensions/app_notification_manager_sync_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698