OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/metrics/google_update_metrics_provider_win.h" | 5 #include "chrome/browser/metrics/google_update_metrics_provider_win.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/task_scheduler/post_task.h" | 9 #include "base/task_scheduler/post_task.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 void GoogleUpdateMetricsProviderWin::GetGoogleUpdateData( | 50 void GoogleUpdateMetricsProviderWin::GetGoogleUpdateData( |
51 const base::Closure& done_callback) { | 51 const base::Closure& done_callback) { |
52 if (!IsOfficialBuild()) { | 52 if (!IsOfficialBuild()) { |
53 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, done_callback); | 53 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, done_callback); |
54 return; | 54 return; |
55 } | 55 } |
56 | 56 |
57 // Schedules a task on a blocking pool thread to gather Google Update | 57 // Schedules a task on a blocking pool thread to gather Google Update |
58 // statistics (requires Registry reads). | 58 // statistics (requires Registry reads). |
59 base::PostTaskWithTraitsAndReplyWithResult( | 59 base::PostTaskWithTraitsAndReplyWithResult( |
60 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( | 60 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
61 base::TaskPriority::BACKGROUND), | |
62 base::Bind(&GoogleUpdateMetricsProviderWin::GetGoogleUpdateDataBlocking), | 61 base::Bind(&GoogleUpdateMetricsProviderWin::GetGoogleUpdateDataBlocking), |
63 base::Bind(&GoogleUpdateMetricsProviderWin::ReceiveGoogleUpdateData, | 62 base::Bind(&GoogleUpdateMetricsProviderWin::ReceiveGoogleUpdateData, |
64 weak_ptr_factory_.GetWeakPtr(), done_callback)); | 63 weak_ptr_factory_.GetWeakPtr(), done_callback)); |
65 } | 64 } |
66 | 65 |
67 void GoogleUpdateMetricsProviderWin::ProvideSystemProfileMetrics( | 66 void GoogleUpdateMetricsProviderWin::ProvideSystemProfileMetrics( |
68 metrics::SystemProfileProto* system_profile_proto) { | 67 metrics::SystemProfileProto* system_profile_proto) { |
69 if (!IsOfficialBuild()) | 68 if (!IsOfficialBuild()) |
70 return; | 69 return; |
71 | 70 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 GoogleUpdateSettings::GetUpdateDetail(&google_update_metrics.product_data); | 121 GoogleUpdateSettings::GetUpdateDetail(&google_update_metrics.product_data); |
123 return google_update_metrics; | 122 return google_update_metrics; |
124 } | 123 } |
125 | 124 |
126 void GoogleUpdateMetricsProviderWin::ReceiveGoogleUpdateData( | 125 void GoogleUpdateMetricsProviderWin::ReceiveGoogleUpdateData( |
127 const base::Closure& done_callback, | 126 const base::Closure& done_callback, |
128 const GoogleUpdateMetrics& google_update_metrics) { | 127 const GoogleUpdateMetrics& google_update_metrics) { |
129 google_update_metrics_ = google_update_metrics; | 128 google_update_metrics_ = google_update_metrics; |
130 done_callback.Run(); | 129 done_callback.Run(); |
131 } | 130 } |
OLD | NEW |