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

Side by Side Diff: sync/tools/sync_listen_notifications.cc

Issue 23238005: sync: Remove ModelTypeInvalidationMap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sort entries in gyp files Created 7 years, 3 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
« no previous file with comments | « sync/test/engine/mock_connection_manager.h ('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 (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 <cstddef> 5 #include <cstddef>
6 #include <cstdio> 6 #include <cstdio>
7 #include <string> 7 #include <string>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/rand_util.h" 16 #include "base/rand_util.h"
17 #include "base/threading/thread.h" 17 #include "base/threading/thread.h"
18 #include "jingle/notifier/base/notification_method.h" 18 #include "jingle/notifier/base/notification_method.h"
19 #include "jingle/notifier/base/notifier_options.h" 19 #include "jingle/notifier/base/notifier_options.h"
20 #include "net/base/host_port_pair.h" 20 #include "net/base/host_port_pair.h"
21 #include "net/base/network_change_notifier.h" 21 #include "net/base/network_change_notifier.h"
22 #include "net/dns/host_resolver.h" 22 #include "net/dns/host_resolver.h"
23 #include "net/http/transport_security_state.h" 23 #include "net/http/transport_security_state.h"
24 #include "net/url_request/url_request_test_util.h" 24 #include "net/url_request/url_request_test_util.h"
25 #include "sync/internal_api/public/base/model_type.h" 25 #include "sync/internal_api/public/base/model_type.h"
26 #include "sync/internal_api/public/base/model_type_invalidation_map.h"
27 #include "sync/notifier/invalidation_handler.h" 26 #include "sync/notifier/invalidation_handler.h"
28 #include "sync/notifier/invalidation_state_tracker.h" 27 #include "sync/notifier/invalidation_state_tracker.h"
29 #include "sync/notifier/invalidation_util.h" 28 #include "sync/notifier/invalidation_util.h"
30 #include "sync/notifier/invalidator.h" 29 #include "sync/notifier/invalidator.h"
31 #include "sync/notifier/non_blocking_invalidator.h" 30 #include "sync/notifier/non_blocking_invalidator.h"
32 #include "sync/tools/null_invalidation_state_tracker.h" 31 #include "sync/tools/null_invalidation_state_tracker.h"
33 32
34 #if defined(OS_MACOSX) 33 #if defined(OS_MACOSX)
35 #include "base/mac/scoped_nsautorelease_pool.h" 34 #include "base/mac/scoped_nsautorelease_pool.h"
36 #endif 35 #endif
(...skipping 17 matching lines...) Expand all
54 NotificationPrinter() {} 53 NotificationPrinter() {}
55 virtual ~NotificationPrinter() {} 54 virtual ~NotificationPrinter() {}
56 55
57 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE { 56 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE {
58 LOG(INFO) << "Invalidator state changed to " 57 LOG(INFO) << "Invalidator state changed to "
59 << InvalidatorStateToString(state); 58 << InvalidatorStateToString(state);
60 } 59 }
61 60
62 virtual void OnIncomingInvalidation( 61 virtual void OnIncomingInvalidation(
63 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE { 62 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE {
64 const ModelTypeInvalidationMap& type_invalidation_map = 63 for (ObjectIdInvalidationMap::const_iterator it = invalidation_map.begin();
65 ObjectIdInvalidationMapToModelTypeInvalidationMap(invalidation_map); 64 it != invalidation_map.end(); ++it) {
66 for (ModelTypeInvalidationMap::const_iterator it = 65 LOG(INFO) << "Remote invalidation: id = "
67 type_invalidation_map.begin(); it != type_invalidation_map.end(); 66 << ObjectIdToString(it->first)
68 ++it) { 67 << ", version = " << it->second.version
69 LOG(INFO) << "Remote invalidation: type = "
70 << ModelTypeToString(it->first)
71 << ", payload = " << it->second.payload; 68 << ", payload = " << it->second.payload;
72 } 69 }
73 } 70 }
74 71
75 private: 72 private:
76 DISALLOW_COPY_AND_ASSIGN(NotificationPrinter); 73 DISALLOW_COPY_AND_ASSIGN(NotificationPrinter);
77 }; 74 };
78 75
79 // Needed to use a real host resolver. 76 // Needed to use a real host resolver.
80 class MyTestURLRequestContext : public net::TestURLRequestContext { 77 class MyTestURLRequestContext : public net::TestURLRequestContext {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 io_thread.Stop(); 206 io_thread.Stop();
210 return 0; 207 return 0;
211 } 208 }
212 209
213 } // namespace 210 } // namespace
214 } // namespace syncer 211 } // namespace syncer
215 212
216 int main(int argc, char* argv[]) { 213 int main(int argc, char* argv[]) {
217 return syncer::SyncListenNotificationsMain(argc, argv); 214 return syncer::SyncListenNotificationsMain(argc, argv);
218 } 215 }
OLDNEW
« no previous file with comments | « sync/test/engine/mock_connection_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698