| OLD | NEW |
| 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/tracing/chrome_tracing_delegate.h" | 5 #include "chrome/browser/tracing/chrome_tracing_delegate.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "chrome/browser/tracing/crash_service_uploader.h" | 14 #include "chrome/browser/tracing/crash_service_uploader.h" |
| 15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/browser/ui/browser_list.h" | 16 #include "chrome/browser/ui/browser_list.h" |
| 17 #include "chrome/browser/ui/browser_otr_state.h" | 17 #include "chrome/browser/ui/browser_otr_state.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "chrome/common/trace_event_args_whitelist.h" | 19 #include "chrome/common/trace_event_args_whitelist.h" |
| 20 #include "components/metrics/metrics_pref_names.h" | 20 #include "components/metrics/metrics_pref_names.h" |
| 21 #include "components/prefs/pref_registry_simple.h" | 21 #include "components/prefs/pref_registry_simple.h" |
| 22 #include "components/prefs/pref_service.h" | 22 #include "components/prefs/pref_service.h" |
| 23 #include "components/variations/active_field_trials.h" | 23 #include "components/variations/active_field_trials.h" |
| 24 #include "components/version_info/version_info.h" |
| 24 #include "content/public/browser/background_tracing_config.h" | 25 #include "content/public/browser/background_tracing_config.h" |
| 25 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| 26 | 27 |
| 27 namespace { | 28 namespace { |
| 28 | 29 |
| 29 const int kMinDaysUntilNextUpload = 7; | 30 const int kMinDaysUntilNextUpload = 7; |
| 30 | 31 |
| 31 } // namespace | 32 } // namespace |
| 32 | 33 |
| 33 void ChromeTracingDelegate::RegisterPrefs(PrefRegistrySimple* registry) { | 34 void ChromeTracingDelegate::RegisterPrefs(PrefRegistrySimple* registry) { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 base::DictionaryValue* metadata_dict) { | 161 base::DictionaryValue* metadata_dict) { |
| 161 DCHECK(metadata_dict); | 162 DCHECK(metadata_dict); |
| 162 std::vector<std::string> variations; | 163 std::vector<std::string> variations; |
| 163 variations::GetFieldTrialActiveGroupIdsAsStrings(&variations); | 164 variations::GetFieldTrialActiveGroupIdsAsStrings(&variations); |
| 164 | 165 |
| 165 std::unique_ptr<base::ListValue> variations_list(new base::ListValue()); | 166 std::unique_ptr<base::ListValue> variations_list(new base::ListValue()); |
| 166 for (const auto& it : variations) | 167 for (const auto& it : variations) |
| 167 variations_list->AppendString(it); | 168 variations_list->AppendString(it); |
| 168 | 169 |
| 169 metadata_dict->Set("field-trials", std::move(variations_list)); | 170 metadata_dict->Set("field-trials", std::move(variations_list)); |
| 171 metadata_dict->SetString("revision", version_info::GetLastChange()); |
| 170 } | 172 } |
| 171 | 173 |
| 172 content::MetadataFilterPredicate | 174 content::MetadataFilterPredicate |
| 173 ChromeTracingDelegate::GetMetadataFilterPredicate() { | 175 ChromeTracingDelegate::GetMetadataFilterPredicate() { |
| 174 return base::Bind(&IsMetadataWhitelisted); | 176 return base::Bind(&IsMetadataWhitelisted); |
| 175 } | 177 } |
| OLD | NEW |