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

Side by Side Diff: extensions/browser/api/metrics_private/metrics_private_api.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "extensions/browser/api/metrics_private/metrics_private_api.h" 5 #include "extensions/browser/api/metrics_private/metrics_private_api.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ExtensionsAPIClient::Get()->GetMetricsPrivateDelegate(); 45 ExtensionsAPIClient::Get()->GetMetricsPrivateDelegate();
46 46
47 return RespondNow(OneArgument(base::MakeUnique<base::Value>( 47 return RespondNow(OneArgument(base::MakeUnique<base::Value>(
48 delegate && delegate->IsCrashReportingEnabled()))); 48 delegate && delegate->IsCrashReportingEnabled())));
49 } 49 }
50 50
51 ExtensionFunction::ResponseAction MetricsPrivateGetFieldTrialFunction::Run() { 51 ExtensionFunction::ResponseAction MetricsPrivateGetFieldTrialFunction::Run() {
52 std::string name; 52 std::string name;
53 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &name)); 53 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &name));
54 54
55 return RespondNow(OneArgument(base::MakeUnique<base::StringValue>( 55 return RespondNow(OneArgument(
56 base::FieldTrialList::FindFullName(name)))); 56 base::MakeUnique<base::Value>(base::FieldTrialList::FindFullName(name))));
57 } 57 }
58 58
59 ExtensionFunction::ResponseAction 59 ExtensionFunction::ResponseAction
60 MetricsPrivateGetVariationParamsFunction::Run() { 60 MetricsPrivateGetVariationParamsFunction::Run() {
61 std::unique_ptr<GetVariationParams::Params> params( 61 std::unique_ptr<GetVariationParams::Params> params(
62 GetVariationParams::Params::Create(*args_)); 62 GetVariationParams::Params::Create(*args_));
63 EXTENSION_FUNCTION_VALIDATE(params.get()); 63 EXTENSION_FUNCTION_VALIDATE(params.get());
64 64
65 GetVariationParams::Results::Params result; 65 GetVariationParams::Results::Params result;
66 std::unique_ptr<base::DictionaryValue> dict; 66 std::unique_ptr<base::DictionaryValue> dict;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 std::unique_ptr<RecordLongTime::Params> params( 206 std::unique_ptr<RecordLongTime::Params> params(
207 RecordLongTime::Params::Create(*args_)); 207 RecordLongTime::Params::Create(*args_));
208 EXTENSION_FUNCTION_VALIDATE(params.get()); 208 EXTENSION_FUNCTION_VALIDATE(params.get());
209 static const int kOneHourMs = 60 * 60 * 1000; 209 static const int kOneHourMs = 60 * 60 * 1000;
210 RecordValue(params->metric_name, base::HISTOGRAM, 1, kOneHourMs, 50, 210 RecordValue(params->metric_name, base::HISTOGRAM, 1, kOneHourMs, 50,
211 params->value); 211 params->value);
212 return RespondNow(NoArguments()); 212 return RespondNow(NoArguments());
213 } 213 }
214 214
215 } // namespace extensions 215 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/idle/idle_manager.cc ('k') | extensions/browser/api/networking_private/networking_private_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698