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

Unified Diff: sync/tools/sync_listen_notifications.cc

Issue 15580002: Make use of InvalidationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 6 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 | « sync/tools/sync_client.cc ('k') | sync/tools/testserver/xmppserver.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/tools/sync_listen_notifications.cc
diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc
index dc548865c227e3b4122d78c77399e67ab965cec1..615d6bded6e709ab9edeeb4dff4db1011708ea66 100644
--- a/sync/tools/sync_listen_notifications.cc
+++ b/sync/tools/sync_listen_notifications.cc
@@ -13,6 +13,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
+#include "base/rand_util.h"
#include "base/threading/thread.h"
#include "jingle/notifier/base/notification_method.h"
#include "jingle/notifier/base/notifier_options.h"
@@ -27,7 +28,7 @@
#include "sync/notifier/invalidation_state_tracker.h"
#include "sync/notifier/invalidation_util.h"
#include "sync/notifier/invalidator.h"
-#include "sync/notifier/invalidator_factory.h"
+#include "sync/notifier/non_blocking_invalidator.h"
#include "sync/tools/null_invalidation_state_tracker.h"
#if defined(OS_MACOSX)
@@ -134,12 +135,6 @@ notifier::NotifierOptions ParseNotifierOptions(
LOG_IF(INFO, notifier_options.allow_insecure_connection)
<< "Allowing insecure XMPP connections.";
- if (command_line.HasSwitch(kNotificationMethodSwitch)) {
- notifier_options.notification_method =
- notifier::StringToNotificationMethod(
- command_line.GetSwitchValueASCII(kNotificationMethodSwitch));
- }
-
return notifier_options;
}
@@ -169,15 +164,13 @@ int SyncListenNotificationsMain(int argc, char* argv[]) {
if (email.empty() || token.empty()) {
std::printf("Usage: %s --%s=foo@bar.com --%s=token\n"
"[--%s=host:port] [--%s] [--%s]\n"
- "[--%s=(server|p2p)]\n\n"
"Run chrome and set a breakpoint on\n"
"syncer::SyncManagerImpl::UpdateCredentials() "
"after logging into\n"
"sync to get the token to pass into this utility.\n",
argv[0],
kEmailSwitch, kTokenSwitch, kHostPortSwitch,
- kTrySslTcpFirstSwitch, kAllowInsecureConnectionSwitch,
- kNotificationMethodSwitch);
+ kTrySslTcpFirstSwitch, kAllowInsecureConnectionSwitch);
return -1;
}
@@ -191,11 +184,16 @@ int SyncListenNotificationsMain(int argc, char* argv[]) {
new MyTestURLRequestContextGetter(io_thread.message_loop_proxy()));
const char kClientInfo[] = "sync_listen_notifications";
NullInvalidationStateTracker null_invalidation_state_tracker;
- InvalidatorFactory invalidator_factory(
- notifier_options, kClientInfo,
- null_invalidation_state_tracker.AsWeakPtr());
scoped_ptr<Invalidator> invalidator(
- invalidator_factory.CreateInvalidator());
+ new NonBlockingInvalidator(
+ notifier_options,
+ base::RandBytesAsString(8),
+ null_invalidation_state_tracker.GetAllInvalidationStates(),
+ null_invalidation_state_tracker.GetBootstrapData(),
+ WeakHandle<InvalidationStateTracker>(
+ null_invalidation_state_tracker.AsWeakPtr()),
+ kClientInfo));
+
NotificationPrinter notification_printer;
invalidator->UpdateCredentials(email, token);
« no previous file with comments | « sync/tools/sync_client.cc ('k') | sync/tools/testserver/xmppserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698