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: chrome/renderer/benchmarking_extension.cc

Issue 12813004: Chromium style checker cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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 | Annotate | Revision Log
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.h" 9 #include "base/time.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 " this.microseconds = function() {" 49 " this.microseconds = function() {"
50 " var stop = stop_;" 50 " var stop = stop_;"
51 " if (stop == 0 && start_ != 0)" 51 " if (stop == 0 && start_ != 0)"
52 " stop = HiResTime();" 52 " stop = HiResTime();"
53 " return Math.ceil(stop - start_);" 53 " return Math.ceil(stop - start_);"
54 " };" 54 " };"
55 "}" 55 "}"
56 ) {} 56 ) {}
57 57
58 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction( 58 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
59 v8::Handle<v8::String> name) { 59 v8::Handle<v8::String> name) OVERRIDE {
60 if (name->Equals(v8::String::New("GetCounter"))) { 60 if (name->Equals(v8::String::New("GetCounter"))) {
61 return v8::FunctionTemplate::New(GetCounter); 61 return v8::FunctionTemplate::New(GetCounter);
62 } else if (name->Equals(v8::String::New("IsSingleProcess"))) { 62 } else if (name->Equals(v8::String::New("IsSingleProcess"))) {
63 return v8::FunctionTemplate::New(IsSingleProcess); 63 return v8::FunctionTemplate::New(IsSingleProcess);
64 } else if (name->Equals(v8::String::New("HiResTime"))) { 64 } else if (name->Equals(v8::String::New("HiResTime"))) {
65 return v8::FunctionTemplate::New(HiResTime); 65 return v8::FunctionTemplate::New(HiResTime);
66 } 66 }
67 67
68 return v8::Handle<v8::FunctionTemplate>(); 68 return v8::Handle<v8::FunctionTemplate>();
69 } 69 }
(...skipping 21 matching lines...) Expand all
91 return v8::Number::New( 91 return v8::Number::New(
92 static_cast<double>(base::TimeTicks::HighResNow().ToInternalValue())); 92 static_cast<double>(base::TimeTicks::HighResNow().ToInternalValue()));
93 } 93 }
94 }; 94 };
95 95
96 v8::Extension* BenchmarkingExtension::Get() { 96 v8::Extension* BenchmarkingExtension::Get() {
97 return new BenchmarkingWrapper(); 97 return new BenchmarkingWrapper();
98 } 98 }
99 99
100 } // namespace extensions_v8 100 } // namespace extensions_v8
OLDNEW
« no previous file with comments | « chrome/common/extensions/manifest_handler_unittest.cc ('k') | chrome/renderer/net_benchmarking_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698