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

Side by Side Diff: chrome/browser/sync/sync_stopped_reporter.cc

Issue 1269773002: Cleanup VersionInfo after componentization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/sync_stopped_reporter.h" 5 #include "chrome/browser/sync/sync_stopped_reporter.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
11 #include "base/thread_task_runner_handle.h" 11 #include "base/thread_task_runner_handle.h"
12 #include "base/timer/timer.h" 12 #include "base/timer/timer.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h" 14 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h"
15 #include "chrome/common/chrome_version_info.h"
16 #include "net/base/load_flags.h" 15 #include "net/base/load_flags.h"
17 #include "net/http/http_status_code.h" 16 #include "net/http/http_status_code.h"
18 #include "net/url_request/url_fetcher.h" 17 #include "net/url_request/url_fetcher.h"
19 #include "net/url_request/url_request_context_getter.h" 18 #include "net/url_request/url_request_context_getter.h"
20 #include "sync/protocol/sync.pb.h" 19 #include "sync/protocol/sync.pb.h"
21 20
22 namespace { 21 namespace {
23 22
24 const char kEventEndpoint[] = "event"; 23 const char kEventEndpoint[] = "event";
25 24
26 // The request is tiny, so even on poor connections 10 seconds should be 25 // The request is tiny, so even on poor connections 10 seconds should be
27 // plenty of time. Since sync is off when this request is started, we don't 26 // plenty of time. Since sync is off when this request is started, we don't
28 // want anything sync-related hanging around for very long from a human 27 // want anything sync-related hanging around for very long from a human
29 // perspective either. This seems like a good compromise. 28 // perspective either. This seems like a good compromise.
30 const int kRequestTimeoutSeconds = 10; 29 const int kRequestTimeoutSeconds = 10;
31 30
32 std::string GetUserAgent() { 31 std::string GetUserAgent() {
33 chrome::VersionInfo version_info; 32 return browser_sync::LocalDeviceInfoProviderImpl::MakeUserAgentForSyncApi();
34 return browser_sync::LocalDeviceInfoProviderImpl::MakeUserAgentForSyncApi(
35 version_info);
36 } 33 }
37 34
38 } // namespace 35 } // namespace
39 36
40 namespace browser_sync { 37 namespace browser_sync {
41 38
42 SyncStoppedReporter::SyncStoppedReporter( 39 SyncStoppedReporter::SyncStoppedReporter(
43 const GURL& sync_service_url, 40 const GURL& sync_service_url,
44 const scoped_refptr<net::URLRequestContextGetter>& request_context, 41 const scoped_refptr<net::URLRequestContextGetter>& request_context,
45 const ResultCallback& callback) 42 const ResultCallback& callback)
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 replacements.SetPathStr(path); 116 replacements.SetPathStr(path);
120 return sync_service_url.ReplaceComponents(replacements); 117 return sync_service_url.ReplaceComponents(replacements);
121 } 118 }
122 119
123 void SyncStoppedReporter::SetTimerTaskRunnerForTest( 120 void SyncStoppedReporter::SetTimerTaskRunnerForTest(
124 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { 121 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
125 timer_.SetTaskRunner(task_runner); 122 timer_.SetTaskRunner(task_runner);
126 } 123 }
127 124
128 } // namespace browser_sync 125 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698