| 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> |
| 8 |
| 7 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
| 8 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| 9 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 10 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 11 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "chrome/browser/tracing/crash_service_uploader.h" | 16 #include "chrome/browser/tracing/crash_service_uploader.h" |
| 15 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/browser/ui/browser_list.h" | 18 #include "chrome/browser/ui/browser_list.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 void ChromeTracingDelegate::GenerateMetadataDict( | 145 void ChromeTracingDelegate::GenerateMetadataDict( |
| 144 base::DictionaryValue* metadata_dict) { | 146 base::DictionaryValue* metadata_dict) { |
| 145 DCHECK(metadata_dict); | 147 DCHECK(metadata_dict); |
| 146 std::vector<std::string> variations; | 148 std::vector<std::string> variations; |
| 147 variations::GetFieldTrialActiveGroupIdsAsStrings(&variations); | 149 variations::GetFieldTrialActiveGroupIdsAsStrings(&variations); |
| 148 | 150 |
| 149 scoped_ptr<base::ListValue> variations_list(new base::ListValue()); | 151 scoped_ptr<base::ListValue> variations_list(new base::ListValue()); |
| 150 for (const auto& it : variations) | 152 for (const auto& it : variations) |
| 151 variations_list->Append(new base::StringValue(it)); | 153 variations_list->Append(new base::StringValue(it)); |
| 152 | 154 |
| 153 metadata_dict->Set("field-trials", variations_list.Pass()); | 155 metadata_dict->Set("field-trials", std::move(variations_list)); |
| 154 } | 156 } |
| 155 | 157 |
| 156 content::MetadataFilterPredicate | 158 content::MetadataFilterPredicate |
| 157 ChromeTracingDelegate::GetMetadataFilterPredicate() { | 159 ChromeTracingDelegate::GetMetadataFilterPredicate() { |
| 158 return base::Bind(&IsMetadataWhitelisted); | 160 return base::Bind(&IsMetadataWhitelisted); |
| 159 } | 161 } |
| OLD | NEW |