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

Unified Diff: trunk/src/sync/tools/sync_listen_notifications.cc

Issue 17610004: Revert 208315 "Make use of InvalidationService" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 | « trunk/src/sync/tools/sync_client.cc ('k') | trunk/src/sync/tools/testserver/xmppserver.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/sync/tools/sync_listen_notifications.cc
===================================================================
--- trunk/src/sync/tools/sync_listen_notifications.cc (revision 208346)
+++ trunk/src/sync/tools/sync_listen_notifications.cc (working copy)
@@ -13,7 +13,6 @@
#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"
@@ -28,7 +27,7 @@
#include "sync/notifier/invalidation_state_tracker.h"
#include "sync/notifier/invalidation_util.h"
#include "sync/notifier/invalidator.h"
-#include "sync/notifier/non_blocking_invalidator.h"
+#include "sync/notifier/invalidator_factory.h"
#include "sync/tools/null_invalidation_state_tracker.h"
#if defined(OS_MACOSX)
@@ -135,6 +134,12 @@
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;
}
@@ -164,13 +169,15 @@
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);
+ kTrySslTcpFirstSwitch, kAllowInsecureConnectionSwitch,
+ kNotificationMethodSwitch);
return -1;
}
@@ -184,16 +191,11 @@
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(
- 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));
-
+ invalidator_factory.CreateInvalidator());
NotificationPrinter notification_printer;
invalidator->UpdateCredentials(email, token);
« no previous file with comments | « trunk/src/sync/tools/sync_client.cc ('k') | trunk/src/sync/tools/testserver/xmppserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698