summaryrefslogtreecommitdiffstats
path: root/jingle
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-24 22:31:48 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-24 22:31:48 +0000
commit0a80fed149df03558c03fa5820dc2173528398f9 (patch)
tree53d84752078389454802c85ed944247592879c32 /jingle
parentc4dac57959faeafa6fb6158382fa7fb899d0bc6d (diff)
downloadchromium_src-0a80fed149df03558c03fa5820dc2173528398f9.zip
chromium_src-0a80fed149df03558c03fa5820dc2173528398f9.tar.gz
chromium_src-0a80fed149df03558c03fa5820dc2173528398f9.tar.bz2
[Sync] Delete ServerNotifierThread and refactor InvalidationNotifier
Basically replace the InvalidationNotifier/ServerNotifierThread combo with InvalidationNotifier and NonBlockingInvalidationNotifier. Some minor cleanup in jingle files. This finishes steps 1 and 2 in the bug. BUG=76764 TEST= Review URL: http://codereview.chromium.org/6696051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79334 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
-rw-r--r--jingle/notifier/communicator/login.h4
-rw-r--r--jingle/notifier/listener/mediator_thread_impl.cc13
-rw-r--r--jingle/notifier/listener/mediator_thread_impl.h13
3 files changed, 7 insertions, 23 deletions
diff --git a/jingle/notifier/communicator/login.h b/jingle/notifier/communicator/login.h
index 0e5b11b..8f3b4a61 100644
--- a/jingle/notifier/communicator/login.h
+++ b/jingle/notifier/communicator/login.h
@@ -112,6 +112,10 @@ class Login : public net::NetworkChangeNotifier::IPAddressObserver,
DISALLOW_COPY_AND_ASSIGN(Login);
};
+// Workaround for MSVS 2005 bug that fails to handle inheritance from a nested
+// class properly if it comes directly on a base class list.
+typedef Login::Delegate LoginDelegate;
+
} // namespace notifier
#endif // JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_
diff --git a/jingle/notifier/listener/mediator_thread_impl.cc b/jingle/notifier/listener/mediator_thread_impl.cc
index 556a035..6887f10 100644
--- a/jingle/notifier/listener/mediator_thread_impl.cc
+++ b/jingle/notifier/listener/mediator_thread_impl.cc
@@ -131,10 +131,6 @@ void MediatorThreadImpl::DoLogin(
base_task_.reset();
- // TODO(akalin): Use an existing HostResolver from somewhere (maybe
- // the IOThread one).
- // TODO(wtc): Sharing HostResolver and CertVerifier with the IO Thread won't
- // work because HostResolver and CertVerifier are single-threaded.
host_resolver_.reset(
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
NULL, NULL));
@@ -191,7 +187,8 @@ void MediatorThreadImpl::OnSubscriptionError() {
void MediatorThreadImpl::OnNotificationReceived(
const Notification& notification) {
- OnIncomingNotification(notification);
+ DCHECK_EQ(MessageLoop::current(), worker_message_loop());
+ observers_->Notify(&Observer::OnIncomingNotification, notification);
}
void MediatorThreadImpl::DoSendNotification(
@@ -220,12 +217,6 @@ void MediatorThreadImpl::DoUpdateXmppSettings(
}
-void MediatorThreadImpl::OnIncomingNotification(
- const Notification& notification) {
- DCHECK_EQ(MessageLoop::current(), worker_message_loop());
- observers_->Notify(&Observer::OnIncomingNotification, notification);
-}
-
void MediatorThreadImpl::OnConnect(base::WeakPtr<talk_base::Task> base_task) {
DCHECK_EQ(MessageLoop::current(), worker_message_loop());
base_task_ = base_task;
diff --git a/jingle/notifier/listener/mediator_thread_impl.h b/jingle/notifier/listener/mediator_thread_impl.h
index 4ac582e..33395c4 100644
--- a/jingle/notifier/listener/mediator_thread_impl.h
+++ b/jingle/notifier/listener/mediator_thread_impl.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -48,10 +48,6 @@ class HostResolver;
namespace notifier {
-// Workaround for MSVS 2005 bug that fails to handle inheritance from a nested
-// class properly if it comes directly on a base class list.
-typedef Login::Delegate LoginDelegate;
-
class MediatorThreadImpl : public MediatorThread, public LoginDelegate,
public PushNotificationsListenTaskDelegate,
public PushNotificationsSubscribeTaskDelegate {
@@ -89,13 +85,6 @@ class MediatorThreadImpl : public MediatorThread, public LoginDelegate,
// Should only be called after Start().
MessageLoop* worker_message_loop();
- // These handle messages indicating an event happened in the outside
- // world. These are all called from the worker thread. They are protected
- // so they can be used by subclasses.
- void OnIncomingNotification(
- const Notification& notification);
- void OnSubscriptionStateChange(bool success);
-
scoped_refptr<ObserverListThreadSafe<Observer> > observers_;
MessageLoop* parent_message_loop_;
base::WeakPtr<talk_base::Task> base_task_;