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

Side by Side Diff: chrome/renderer/benchmarking_extension.cc

Issue 744723002: remove some calls to to-be-deprecated v8::Value::To* functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | chrome/renderer/extensions/enterprise_platform_keys_natives.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer/benchmarking_extension.h" 5 #include "chrome/renderer/benchmarking_extension.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/stats_table.h" 8 #include "base/metrics/stats_table.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 /* 80 /*
81 * Extract the counter name from arguments. 81 * Extract the counter name from arguments.
82 */ 82 */
83 static void ExtractCounterName( 83 static void ExtractCounterName(
84 const v8::FunctionCallbackInfo<v8::Value>& args, 84 const v8::FunctionCallbackInfo<v8::Value>& args,
85 char* name, 85 char* name,
86 size_t capacity) { 86 size_t capacity) {
87 name[0] = 'c'; 87 name[0] = 'c';
88 name[1] = ':'; 88 name[1] = ':';
89 args[0]->ToString()->WriteUtf8(&name[2], capacity - 3); 89 args[0]->ToString(args.GetIsolate())->WriteUtf8(&name[2], capacity - 3);
90 } 90 }
91 91
92 static void GetCounter(const v8::FunctionCallbackInfo<v8::Value>& args) { 92 static void GetCounter(const v8::FunctionCallbackInfo<v8::Value>& args) {
93 if (!args.Length() || !args[0]->IsString() || !base::StatsTable::current()) 93 if (!args.Length() || !args[0]->IsString() || !base::StatsTable::current())
94 return; 94 return;
95 95
96 char name[256]; 96 char name[256];
97 ExtractCounterName(args, name, sizeof(name)); 97 ExtractCounterName(args, name, sizeof(name));
98 int counter = base::StatsTable::current()->GetCounterValue(name); 98 int counter = base::StatsTable::current()->GetCounterValue(name);
99 args.GetReturnValue().Set(static_cast<int32_t>(counter)); 99 args.GetReturnValue().Set(static_cast<int32_t>(counter));
(...skipping 21 matching lines...) Expand all
121 args.GetReturnValue().Set( 121 args.GetReturnValue().Set(
122 static_cast<double>(base::TimeTicks::HighResNow().ToInternalValue())); 122 static_cast<double>(base::TimeTicks::HighResNow().ToInternalValue()));
123 } 123 }
124 }; 124 };
125 125
126 v8::Extension* BenchmarkingExtension::Get() { 126 v8::Extension* BenchmarkingExtension::Get() {
127 return new BenchmarkingWrapper(); 127 return new BenchmarkingWrapper();
128 } 128 }
129 129
130 } // namespace extensions_v8 130 } // namespace extensions_v8
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/extensions/enterprise_platform_keys_natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698