diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-20 00:11:21 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-20 00:11:21 +0000 |
commit | b41b3e277f6472c97e44e4cc8f402eee9c906c3b (patch) | |
tree | 641fa4fbf0d4c2716b1147e7b91d75e45a827a4e /jingle | |
parent | 051b74fdf31cb369f0f16811bc58d425a9c3dd04 (diff) | |
download | chromium_src-b41b3e277f6472c97e44e4cc8f402eee9c906c3b.zip chromium_src-b41b3e277f6472c97e44e4cc8f402eee9c906c3b.tar.gz chromium_src-b41b3e277f6472c97e44e4cc8f402eee9c906c3b.tar.bz2 |
Convert LOG(INFO) to VLOG(1) - jingle/.
Also eliminates some extra {}s.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3885002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63147 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
-rw-r--r-- | jingle/notifier/base/xmpp_connection.cc | 2 | ||||
-rw-r--r-- | jingle/notifier/communicator/login.cc | 13 | ||||
-rw-r--r-- | jingle/notifier/communicator/single_login_attempt.cc | 14 | ||||
-rw-r--r-- | jingle/notifier/communicator/xmpp_connection_generator.cc | 32 | ||||
-rw-r--r-- | jingle/notifier/listener/listen_task.cc | 11 | ||||
-rw-r--r-- | jingle/notifier/listener/mediator_thread_impl.cc | 4 | ||||
-rw-r--r-- | jingle/notifier/listener/push_notifications_listen_task.cc | 8 | ||||
-rw-r--r-- | jingle/notifier/listener/push_notifications_subscribe_task.cc | 12 | ||||
-rw-r--r-- | jingle/notifier/listener/send_update_task.cc | 11 | ||||
-rw-r--r-- | jingle/notifier/listener/subscribe_task.cc | 12 | ||||
-rw-r--r-- | jingle/notifier/listener/talk_mediator_impl.cc | 25 |
11 files changed, 66 insertions, 78 deletions
diff --git a/jingle/notifier/base/xmpp_connection.cc b/jingle/notifier/base/xmpp_connection.cc index 634ad54..5e08eb9 100644 --- a/jingle/notifier/base/xmpp_connection.cc +++ b/jingle/notifier/base/xmpp_connection.cc @@ -83,7 +83,7 @@ XmppConnection::~XmppConnection() { void XmppConnection::OnStateChange(buzz::XmppEngine::State state) { DCHECK(non_thread_safe_.CalledOnValidThread()); - LOG(INFO) << "XmppClient state changed to " << state; + VLOG(1) << "XmppClient state changed to " << state; if (!weak_xmpp_client_.get()) { LOG(DFATAL) << "weak_xmpp_client_ unexpectedly NULL"; return; diff --git a/jingle/notifier/communicator/login.cc b/jingle/notifier/communicator/login.cc index 251a813..c12ca06 100644 --- a/jingle/notifier/communicator/login.cc +++ b/jingle/notifier/communicator/login.cc @@ -64,7 +64,7 @@ void Login::StartConnection() { login_settings_->clear_server_override(); } - LOG(INFO) << "Starting connection..."; + VLOG(1) << "Starting connection..."; single_attempt_.reset(new SingleLoginAttempt(login_settings_.get())); @@ -95,7 +95,7 @@ void Login::OnConnect(base::WeakPtr<talk_base::Task> base_task) { } void Login::OnIPAddressChanged() { - LOG(INFO) << "Detected IP address change"; + VLOG(1) << "Detected IP address change"; // Reconnect in 1 to 9 seconds (vary the time a little to try to // avoid spikey behavior on network hiccups). reconnect_interval_ = base::TimeDelta::FromSeconds(base::RandInt(1, 9)); @@ -112,8 +112,8 @@ void Login::TryReconnect() { DCHECK_GT(reconnect_interval_.InSeconds(), 0); single_attempt_.reset(); reconnect_timer_.Stop(); - LOG(INFO) << "Reconnecting in " - << reconnect_interval_.InSeconds() << " seconds"; + VLOG(1) << "Reconnecting in " + << reconnect_interval_.InSeconds() << " seconds"; reconnect_timer_.Start( reconnect_interval_, this, &Login::DoReconnect); SignalDisconnect(); @@ -124,10 +124,9 @@ void Login::DoReconnect() { const base::TimeDelta kMaxReconnectInterval = base::TimeDelta::FromMinutes(30); reconnect_interval_ *= 2; - if (reconnect_interval_ > kMaxReconnectInterval) { + if (reconnect_interval_ > kMaxReconnectInterval) reconnect_interval_ = kMaxReconnectInterval; - } - LOG(INFO) << "Reconnecting..."; + VLOG(1) << "Reconnecting..."; StartConnection(); } diff --git a/jingle/notifier/communicator/single_login_attempt.cc b/jingle/notifier/communicator/single_login_attempt.cc index 83fd21f..4c361bd 100644 --- a/jingle/notifier/communicator/single_login_attempt.cc +++ b/jingle/notifier/communicator/single_login_attempt.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -53,11 +53,10 @@ void SingleLoginAttempt::OnConnect(base::WeakPtr<talk_base::Task> base_task) { void SingleLoginAttempt::OnError(buzz::XmppEngine::Error error, int subcode, const buzz::XmlElement* stream_error) { - LOG(INFO) << "Error: " << error << ", subcode: " << subcode; + VLOG(1) << "Error: " << error << ", subcode: " << subcode; if (stream_error) { DCHECK_EQ(error, buzz::XmppEngine::ERROR_STREAM); - LOG(INFO) << "Stream error: " - << XmlElementToString(*stream_error); + VLOG(1) << "Stream error: " << XmlElementToString(*stream_error); } // Check for redirection. @@ -101,10 +100,9 @@ void SingleLoginAttempt::OnError(buzz::XmppEngine::Error error, int subcode, void SingleLoginAttempt::OnAttemptedAllConnections( bool successfully_resolved_dns, int first_dns_error) { - if (!successfully_resolved_dns) { - LOG(INFO) << "Could not resolve DNS: " << first_dns_error; - } - LOG(INFO) << "Could not connect to any XMPP server"; + if (!successfully_resolved_dns) + VLOG(1) << "Could not resolve DNS: " << first_dns_error; + VLOG(1) << "Could not connect to any XMPP server"; SignalNeedAutoReconnect(); } diff --git a/jingle/notifier/communicator/xmpp_connection_generator.cc b/jingle/notifier/communicator/xmpp_connection_generator.cc index 469f3d4..e62f176 100644 --- a/jingle/notifier/communicator/xmpp_connection_generator.cc +++ b/jingle/notifier/communicator/xmpp_connection_generator.cc @@ -65,12 +65,12 @@ XmppConnectionGenerator::XmppConnectionGenerator( } XmppConnectionGenerator::~XmppConnectionGenerator() { - LOG(INFO) << "XmppConnectionGenerator::~XmppConnectionGenerator"; + VLOG(1) << "XmppConnectionGenerator::~XmppConnectionGenerator"; } // Starts resolving proxy information. void XmppConnectionGenerator::StartGenerating() { - LOG(INFO) << "XmppConnectionGenerator::StartGenerating"; + VLOG(1) << "XmppConnectionGenerator::StartGenerating"; // TODO(akalin): Detect proxy settings once we use Chrome sockets. @@ -125,15 +125,13 @@ void XmppConnectionGenerator::OnServerDNSResolved(int status) { void XmppConnectionGenerator::HandleServerDNSResolved(int status) { DCHECK_NE(status, net::ERR_IO_PENDING); - LOG(INFO) << "XmppConnectionGenerator::HandleServerDNSResolved"; + VLOG(1) << "XmppConnectionGenerator::HandleServerDNSResolved"; // Print logging info. - LOG(INFO) << " server: " - << server_list_[server_index_].server.ToString() - << ", error: " << status; + VLOG(1) << " server: " << server_list_[server_index_].server.ToString() + << ", error: " << status; if (status != net::OK) { - if (first_dns_error_ == 0) { + if (first_dns_error_ == 0) first_dns_error_ = status; - } return; } @@ -149,9 +147,8 @@ void XmppConnectionGenerator::HandleServerDNSResolved(int status) { successfully_resolved_dns_ = !ip_list.empty(); for (int i = 0; i < static_cast<int>(ip_list.size()); ++i) { - LOG(INFO) - << " ip " << i << " : " - << talk_base::SocketAddress::IPToString(ip_list[i]); + VLOG(1) << " ip " << i + << " : " << talk_base::SocketAddress::IPToString(ip_list[i]); } // Build the ip list. @@ -175,20 +172,19 @@ static const char* ProtocolToString(cricket::ProtocolType proto) { } void XmppConnectionGenerator::UseCurrentConnection() { - LOG(INFO) << "XmppConnectionGenerator::UseCurrentConnection"; + VLOG(1) << "XmppConnectionGenerator::UseCurrentConnection"; ConnectionSettings* settings = settings_list_->GetSettings(settings_index_); - LOG(INFO) << "*** Attempting " - << ProtocolToString(settings->protocol()) << " connection to " - << settings->server().IPAsString() << ":" - << settings->server().port(); + VLOG(1) << "*** Attempting " << ProtocolToString(settings->protocol()) + << " connection to " << settings->server().IPAsString() + << ":" << settings->server().port(); SignalNewSettings(*settings); } void XmppConnectionGenerator::HandleExhaustedConnections() { - LOG(INFO) << "(" << buzz::XmppEngine::ERROR_SOCKET - << ", " << first_dns_error_ << ")"; + VLOG(1) << "(" << buzz::XmppEngine::ERROR_SOCKET + << ", " << first_dns_error_ << ")"; SignalExhaustedSettings(successfully_resolved_dns_, first_dns_error_); } diff --git a/jingle/notifier/listener/listen_task.cc b/jingle/notifier/listener/listen_task.cc index bfa79c1..8466c57 100644 --- a/jingle/notifier/listener/listen_task.cc +++ b/jingle/notifier/listener/listen_task.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -24,16 +24,15 @@ ListenTask::~ListenTask() { } int ListenTask::ProcessStart() { - LOG(INFO) << "P2P: Listener task started."; + VLOG(1) << "P2P: Listener task started."; return STATE_RESPONSE; } int ListenTask::ProcessResponse() { - LOG(INFO) << "P2P: Listener response received."; + VLOG(1) << "P2P: Listener response received."; const buzz::XmlElement* stanza = NextStanza(); - if (stanza == NULL) { + if (stanza == NULL) return STATE_BLOCKED; - } // Acknowledge receipt of the notification to the buzz server. scoped_ptr<buzz::XmlElement> response_stanza(MakeIqResult(stanza)); SendStanza(response_stanza.get()); @@ -115,7 +114,7 @@ int ListenTask::ProcessResponse() { } bool ListenTask::HandleStanza(const buzz::XmlElement* stanza) { - LOG(INFO) << "P2P: Stanza received: " << XmlElementToString(*stanza); + VLOG(1) << "P2P: Stanza received: " << XmlElementToString(*stanza); // TODO(akalin): Do more verification on stanza depending on // the sync notification method if (IsValidNotification(stanza)) { diff --git a/jingle/notifier/listener/mediator_thread_impl.cc b/jingle/notifier/listener/mediator_thread_impl.cc index 24ff3a34..8a2877d 100644 --- a/jingle/notifier/listener/mediator_thread_impl.cc +++ b/jingle/notifier/listener/mediator_thread_impl.cc @@ -117,7 +117,7 @@ MessageLoop* MediatorThreadImpl::worker_message_loop() { void MediatorThreadImpl::DoLogin( const buzz::XmppClientSettings& settings) { DCHECK_EQ(MessageLoop::current(), worker_message_loop()); - LOG(INFO) << "P2P: Thread logging into talk network."; + VLOG(1) << "P2P: Thread logging into talk network."; base_task_.reset(); @@ -166,7 +166,7 @@ void MediatorThreadImpl::DoLogin( void MediatorThreadImpl::DoDisconnect() { DCHECK_EQ(MessageLoop::current(), worker_message_loop()); - LOG(INFO) << "P2P: Thread logging out of talk network."; + VLOG(1) << "P2P: Thread logging out of talk network."; login_.reset(); host_resolver_.reset(); base_task_.reset(); diff --git a/jingle/notifier/listener/push_notifications_listen_task.cc b/jingle/notifier/listener/push_notifications_listen_task.cc index 20dc448..ecf7b95 100644 --- a/jingle/notifier/listener/push_notifications_listen_task.cc +++ b/jingle/notifier/listener/push_notifications_listen_task.cc @@ -29,12 +29,12 @@ PushNotificationsListenTask::~PushNotificationsListenTask() { } int PushNotificationsListenTask::ProcessStart() { - LOG(INFO) << "Push notifications: Listener task started."; + VLOG(1) << "Push notifications: Listener task started."; return STATE_RESPONSE; } int PushNotificationsListenTask::ProcessResponse() { - LOG(INFO) << "Push notifications: Listener response received."; + VLOG(1) << "Push notifications: Listener response received."; const buzz::XmlElement* stanza = NextStanza(); if (stanza == NULL) { return STATE_BLOCKED; @@ -74,8 +74,8 @@ int PushNotificationsListenTask::ProcessResponse() { } bool PushNotificationsListenTask::HandleStanza(const buzz::XmlElement* stanza) { - LOG(INFO) << "Push notifications: Stanza received: " - << XmlElementToString(*stanza); + VLOG(1) << "Push notifications: Stanza received: " + << XmlElementToString(*stanza); if (IsValidNotification(stanza)) { QueueStanza(stanza); return true; diff --git a/jingle/notifier/listener/push_notifications_subscribe_task.cc b/jingle/notifier/listener/push_notifications_subscribe_task.cc index 3601b5e..d63c775 100644 --- a/jingle/notifier/listener/push_notifications_subscribe_task.cc +++ b/jingle/notifier/listener/push_notifications_subscribe_task.cc @@ -38,13 +38,13 @@ bool PushNotificationsSubscribeTask::HandleStanza( } int PushNotificationsSubscribeTask::ProcessStart() { - LOG(INFO) << "Push notifications: Subscription task started."; + VLOG(1) << "Push notifications: Subscription task started."; scoped_ptr<buzz::XmlElement> iq_stanza( MakeSubscriptionMessage(channels_list_, GetClient()->jid(), task_id())); std::string stanza_str = XmlElementToString(*iq_stanza.get()); - LOG(INFO) << "Push notifications: Subscription stanza: " - << XmlElementToString(*iq_stanza.get()); + VLOG(1) << "Push notifications: Subscription stanza: " + << XmlElementToString(*iq_stanza.get()); if (SendStanza(iq_stanza.get()) != buzz::XMPP_RETURN_OK) { if (delegate_) @@ -55,14 +55,14 @@ int PushNotificationsSubscribeTask::ProcessStart() { } int PushNotificationsSubscribeTask::ProcessResponse() { - LOG(INFO) << "Push notifications: Subscription response received."; + VLOG(1) << "Push notifications: Subscription response received."; const buzz::XmlElement* stanza = NextStanza(); if (stanza == NULL) { return STATE_BLOCKED; } std::string stanza_str = XmlElementToString(*stanza); - LOG(INFO) << "Push notifications: Subscription response: " << - XmlElementToString(*stanza); + VLOG(1) << "Push notifications: Subscription response: " + << XmlElementToString(*stanza); // We've receieved a response to our subscription request. if (stanza->HasAttr(buzz::QN_TYPE) && stanza->Attr(buzz::QN_TYPE) == buzz::STR_RESULT) { diff --git a/jingle/notifier/listener/send_update_task.cc b/jingle/notifier/listener/send_update_task.cc index e4b2884..4e34c7d 100644 --- a/jingle/notifier/listener/send_update_task.cc +++ b/jingle/notifier/listener/send_update_task.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -33,12 +33,11 @@ bool SendUpdateTask::HandleStanza(const buzz::XmlElement* stanza) { } int SendUpdateTask::ProcessStart() { - LOG(INFO) << "P2P: Notification task started."; + VLOG(1) << "P2P: Notification task started."; scoped_ptr<buzz::XmlElement> stanza( MakeUpdateMessage(notification_data_, GetClient()->jid().BareJid(), task_id())); - LOG(INFO) << "P2P: Notification stanza: " - << XmlElementToString(*stanza.get()); + VLOG(1) << "P2P: Notification stanza: " << XmlElementToString(*stanza.get()); if (SendStanza(stanza.get()) != buzz::XMPP_RETURN_OK) { // TODO(brg) : Retry on error. @@ -52,12 +51,12 @@ int SendUpdateTask::ProcessStart() { } int SendUpdateTask::ProcessResponse() { - LOG(INFO) << "P2P: Notification response received."; + VLOG(1) << "P2P: Notification response received."; const buzz::XmlElement* stanza = NextStanza(); if (stanza == NULL) { return STATE_BLOCKED; } - LOG(INFO) << "P2P: Notification response: " << XmlElementToString(*stanza); + VLOG(1) << "P2P: Notification response: " << XmlElementToString(*stanza); if (stanza->HasAttr(buzz::QN_TYPE) && stanza->Attr(buzz::QN_TYPE) == buzz::STR_RESULT) { // Notify listeners of success. diff --git a/jingle/notifier/listener/subscribe_task.cc b/jingle/notifier/listener/subscribe_task.cc index 7636b48..ea36047 100644 --- a/jingle/notifier/listener/subscribe_task.cc +++ b/jingle/notifier/listener/subscribe_task.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -36,12 +36,12 @@ bool SubscribeTask::HandleStanza(const buzz::XmlElement* stanza) { } int SubscribeTask::ProcessStart() { - LOG(INFO) << "P2P: Subscription task started."; + VLOG(1) << "P2P: Subscription task started."; scoped_ptr<buzz::XmlElement> iq_stanza( MakeSubscriptionMessage(subscribed_services_list_, GetClient()->jid().BareJid(), task_id())); - LOG(INFO) << "P2P: Subscription stanza: " - << XmlElementToString(*iq_stanza.get()); + VLOG(1) << "P2P: Subscription stanza: " + << XmlElementToString(*iq_stanza.get()); if (SendStanza(iq_stanza.get()) != buzz::XMPP_RETURN_OK) { SignalStatusUpdate(false); @@ -52,12 +52,12 @@ int SubscribeTask::ProcessStart() { } int SubscribeTask::ProcessResponse() { - LOG(INFO) << "P2P: Subscription response received."; + VLOG(1) << "P2P: Subscription response received."; const buzz::XmlElement* stanza = NextStanza(); if (stanza == NULL) { return STATE_BLOCKED; } - LOG(INFO) << "P2P: Subscription response: " << XmlElementToString(*stanza); + VLOG(1) << "P2P: Subscription response: " << XmlElementToString(*stanza); // We've receieved a response to our subscription request. if (stanza->HasAttr(buzz::QN_TYPE) && stanza->Attr(buzz::QN_TYPE) == buzz::STR_RESULT) { diff --git a/jingle/notifier/listener/talk_mediator_impl.cc b/jingle/notifier/listener/talk_mediator_impl.cc index bf86f91..8ac91c7 100644 --- a/jingle/notifier/listener/talk_mediator_impl.cc +++ b/jingle/notifier/listener/talk_mediator_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -100,7 +100,7 @@ void TalkMediatorImpl::AddSubscribedServiceUrl( DCHECK(non_thread_safe_.CalledOnValidThread()); subscribed_services_list_.push_back(service_url); if (state_.logged_in) { - LOG(INFO) << "Resubscribing for updates, a new service got added"; + VLOG(1) << "Resubscribing for updates, a new service got added"; mediator_thread_->SubscribeForUpdates(subscribed_services_list_); } } @@ -111,14 +111,14 @@ void TalkMediatorImpl::OnConnectionStateChange(bool logged_in) { state_.logging_in = 0; state_.logged_in = logged_in; if (logged_in) { - LOG(INFO) << "P2P: Logged in."; + VLOG(1) << "P2P: Logged in."; // ListenForUpdates enables the ListenTask. This is done before // SubscribeForUpdates. mediator_thread_->ListenForUpdates(); // Now subscribe for updates to all the services we are interested in mediator_thread_->SubscribeForUpdates(subscribed_services_list_); } else { - LOG(INFO) << "P2P: Logged off."; + VLOG(1) << "P2P: Logged off."; OnSubscriptionStateChange(false); } } @@ -126,28 +126,25 @@ void TalkMediatorImpl::OnConnectionStateChange(bool logged_in) { void TalkMediatorImpl::OnSubscriptionStateChange(bool subscribed) { DCHECK(non_thread_safe_.CalledOnValidThread()); state_.subscribed = subscribed; - LOG(INFO) << "P2P: " << (subscribed ? "subscribed" : "unsubscribed"); - if (delegate_) { + VLOG(1) << "P2P: " << (subscribed ? "subscribed" : "unsubscribed"); + if (delegate_) delegate_->OnNotificationStateChange(subscribed); - } } void TalkMediatorImpl::OnIncomingNotification( const IncomingNotificationData& notification_data) { DCHECK(non_thread_safe_.CalledOnValidThread()); - LOG(INFO) << "P2P: Updates are available on the server."; - if (delegate_) { + VLOG(1) << "P2P: Updates are available on the server."; + if (delegate_) delegate_->OnIncomingNotification(notification_data); - } } void TalkMediatorImpl::OnOutgoingNotification() { DCHECK(non_thread_safe_.CalledOnValidThread()); - LOG(INFO) << - "P2P: Peers were notified that updates are available on the server."; - if (delegate_) { + VLOG(1) << "P2P: Peers were notified that updates are available on the " + "server."; + if (delegate_) delegate_->OnOutgoingNotification(); - } } } // namespace notifier |