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

Unified Diff: chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc

Issue 3191024: Fixed CacheInvalidationPacketHandler crash. (Closed)
Patch Set: Fixed another use of NewCallback Created 10 years, 4 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 | « chrome/browser/sync/notifier/cache_invalidation_packet_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc
diff --git a/chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc b/chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc
index ca2f7c2a2c05c8293da2a5bb14d37dadab913054..b2b17662200d0614c7e3e47f9fe8b2fc1fa94577 100644
--- a/chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc
+++ b/chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc
@@ -8,6 +8,7 @@
#include "base/base64.h"
#include "base/callback.h"
+#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/rand_util.h"
#include "base/string_number_conversions.h"
@@ -197,7 +198,8 @@ std::string MakeSid() {
CacheInvalidationPacketHandler::CacheInvalidationPacketHandler(
buzz::XmppClient* xmpp_client,
invalidation::InvalidationClient* invalidation_client)
- : xmpp_client_(xmpp_client),
+ : scoped_callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
+ xmpp_client_(xmpp_client),
invalidation_client_(invalidation_client),
seq_(0),
sid_(MakeSid()) {
@@ -207,14 +209,13 @@ CacheInvalidationPacketHandler::CacheInvalidationPacketHandler(
invalidation_client_->network_endpoint();
CHECK(network_endpoint);
network_endpoint->RegisterOutboundListener(
- invalidation::NewPermanentCallback(
- this,
+ scoped_callback_factory_.NewCallback(
&CacheInvalidationPacketHandler::HandleOutboundPacket));
// Owned by xmpp_client.
CacheInvalidationListenTask* listen_task =
new CacheInvalidationListenTask(
- xmpp_client, NewCallback(
- this, &CacheInvalidationPacketHandler::HandleInboundPacket));
+ xmpp_client, scoped_callback_factory_.NewCallback(
+ &CacheInvalidationPacketHandler::HandleInboundPacket));
listen_task->Start();
}
« no previous file with comments | « chrome/browser/sync/notifier/cache_invalidation_packet_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698