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

Side by Side Diff: src/extensions/statistics-extension.cc

Issue 15129002: stop using AsciiValue (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: adding deprecation notice Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/extensions/externalize-string-extension.cc ('k') | test/cctest/test-api.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 18 matching lines...) Expand all
29 29
30 namespace v8 { 30 namespace v8 {
31 namespace internal { 31 namespace internal {
32 32
33 const char* const StatisticsExtension::kSource = 33 const char* const StatisticsExtension::kSource =
34 "native function getV8Statistics();"; 34 "native function getV8Statistics();";
35 35
36 36
37 v8::Handle<v8::FunctionTemplate> StatisticsExtension::GetNativeFunction( 37 v8::Handle<v8::FunctionTemplate> StatisticsExtension::GetNativeFunction(
38 v8::Handle<v8::String> str) { 38 v8::Handle<v8::String> str) {
39 ASSERT(strcmp(*v8::String::AsciiValue(str), "getV8Statistics") == 0); 39 ASSERT(strcmp(*v8::String::Utf8Value(str), "getV8Statistics") == 0);
40 return v8::FunctionTemplate::New(StatisticsExtension::GetCounters); 40 return v8::FunctionTemplate::New(StatisticsExtension::GetCounters);
41 } 41 }
42 42
43 43
44 static void AddCounter(v8::Local<v8::Object> object, 44 static void AddCounter(v8::Local<v8::Object> object,
45 StatsCounter* counter, 45 StatsCounter* counter,
46 const char* name) { 46 const char* name) {
47 if (counter->Enabled()) { 47 if (counter->Enabled()) {
48 object->Set(v8::String::New(name), 48 object->Set(v8::String::New(name),
49 v8::Number::New(*counter->GetInternalPointer())); 49 v8::Number::New(*counter->GetInternalPointer()));
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 return result; 144 return result;
145 } 145 }
146 146
147 147
148 void StatisticsExtension::Register() { 148 void StatisticsExtension::Register() {
149 static StatisticsExtension statistics_extension; 149 static StatisticsExtension statistics_extension;
150 static v8::DeclareExtension declaration(&statistics_extension); 150 static v8::DeclareExtension declaration(&statistics_extension);
151 } 151 }
152 152
153 } } // namespace v8::internal 153 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/extensions/externalize-string-extension.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698