diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-25 05:35:38 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-25 05:35:38 +0000 |
commit | cb69cbfbeebbaf0fe06083ccf4e8f6523d60297d (patch) | |
tree | e4005d3660b9aa1ab1ab365842c82e34518fdfcb /chrome/browser/sync | |
parent | f3964ad144ead73929d06441910a26994879377f (diff) | |
download | chromium_src-cb69cbfbeebbaf0fe06083ccf4e8f6523d60297d.zip chromium_src-cb69cbfbeebbaf0fe06083ccf4e8f6523d60297d.tar.gz chromium_src-cb69cbfbeebbaf0fe06083ccf4e8f6523d60297d.tar.bz2 |
[Sync] Roll cache-invalidation to @70
Pass user agent to InvalidationClientImpl as client_info.
Pick up fix for bug that was causing increased server traffic.
BUG=70674
TEST=none
Review URL: http://codereview.chromium.org/6310015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72468 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
5 files changed, 20 insertions, 11 deletions
diff --git a/chrome/browser/sync/notifier/chrome_invalidation_client.cc b/chrome/browser/sync/notifier/chrome_invalidation_client.cc index 1fe2de0..7b17f9a 100644 --- a/chrome/browser/sync/notifier/chrome_invalidation_client.cc +++ b/chrome/browser/sync/notifier/chrome_invalidation_client.cc @@ -38,9 +38,9 @@ ChromeInvalidationClient::~ChromeInvalidationClient() { } void ChromeInvalidationClient::Start( - const std::string& client_id, const std::string& state, - Listener* listener, StateWriter* state_writer, - base::WeakPtr<talk_base::Task> base_task) { + const std::string& client_id, const std::string& client_info, + const std::string& state, Listener* listener, + StateWriter* state_writer, base::WeakPtr<talk_base::Task> base_task) { DCHECK(non_thread_safe_.CalledOnValidThread()); Stop(); @@ -64,8 +64,8 @@ void ChromeInvalidationClient::Start( client_config.max_ops_per_message = 40; invalidation_client_.reset( new invalidation::InvalidationClientImpl( - &chrome_system_resources_, client_type, client_id, client_config, - this)); + &chrome_system_resources_, client_type, client_id, client_info, + client_config, this)); invalidation_client_->Start(state); invalidation::NetworkEndpoint* network_endpoint = invalidation_client_->network_endpoint(); diff --git a/chrome/browser/sync/notifier/chrome_invalidation_client.h b/chrome/browser/sync/notifier/chrome_invalidation_client.h index 99af02c..3d4e1d7 100644 --- a/chrome/browser/sync/notifier/chrome_invalidation_client.h +++ b/chrome/browser/sync/notifier/chrome_invalidation_client.h @@ -54,9 +54,9 @@ class ChromeInvalidationClient // Does not take ownership of |listener| or |state_writer|. // |base_task| must still be non-NULL. void Start( - const std::string& client_id, const std::string& state, - Listener* listener, StateWriter* state_writer, - base::WeakPtr<talk_base::Task> base_task); + const std::string& client_id, const std::string& client_info, + const std::string& state, Listener* listener, + StateWriter* state_writer, base::WeakPtr<talk_base::Task> base_task); void Stop(); diff --git a/chrome/browser/sync/notifier/chrome_invalidation_client_unittest.cc b/chrome/browser/sync/notifier/chrome_invalidation_client_unittest.cc index 8e09e13..809e32a 100644 --- a/chrome/browser/sync/notifier/chrome_invalidation_client_unittest.cc +++ b/chrome/browser/sync/notifier/chrome_invalidation_client_unittest.cc @@ -37,13 +37,15 @@ class MockInvalidationClient : public invalidation::InvalidationClient { namespace { const char kClientId[] = "client_id"; +const char kClientInfo[] = "client_info"; const char kState[] = "state"; } // namespace class ChromeInvalidationClientTest : public testing::Test { protected: virtual void SetUp() { - client_.Start(kClientId, kState, &mock_listener_, &mock_state_writer_, + client_.Start(kClientId, kClientInfo, kState, + &mock_listener_, &mock_state_writer_, fake_base_task_.AsWeakPtr()); } diff --git a/chrome/browser/sync/notifier/server_notifier_thread.cc b/chrome/browser/sync/notifier/server_notifier_thread.cc index 0c123c8..ae15943 100644 --- a/chrome/browser/sync/notifier/server_notifier_thread.cc +++ b/chrome/browser/sync/notifier/server_notifier_thread.cc @@ -9,9 +9,11 @@ #include "base/logging.h" #include "chrome/browser/sync/notifier/chrome_invalidation_client.h" +#include "googleurl/src/gurl.h" #include "jingle/notifier/base/notifier_options.h" #include "jingle/notifier/listener/notification_defines.h" #include "talk/xmpp/xmppclient.h" +#include "webkit/glue/webkit_glue.h" namespace sync_notifier { @@ -113,8 +115,11 @@ void ServerNotifierThread::DoListenForUpdates() { // make it so that we won't receive any notifications that were // generated from our own changes. const std::string kClientId = "server_notifier_thread"; + // Use user agent as |client_info| so we can use it for debugging + // server-side. + const std::string& client_info = webkit_glue::GetUserAgent(GURL()); chrome_invalidation_client_->Start( - kClientId, state_, this, this, base_task_); + kClientId, client_info, state_, this, this, base_task_); state_.clear(); } } diff --git a/chrome/browser/sync/tools/sync_listen_notifications.cc b/chrome/browser/sync/tools/sync_listen_notifications.cc index 5c93904..842c230 100644 --- a/chrome/browser/sync/tools/sync_listen_notifications.cc +++ b/chrome/browser/sync/tools/sync_listen_notifications.cc @@ -185,7 +185,9 @@ class ServerNotifierDelegate // TODO(akalin): app_name should be per-client unique. const std::string kAppName = "cc_sync_listen_notifications"; - chrome_invalidation_client_.Start(kAppName, server_notifier_state_, + const std::string kAppInfo = kAppName; + chrome_invalidation_client_.Start(kAppName, kAppInfo, + server_notifier_state_, &chrome_invalidation_listener_, this, base_task); chrome_invalidation_client_.RegisterTypes(); |