| OLD | NEW |
| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include "statistics-extension.h" | 28 #include "statistics-extension.h" |
| 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::GetNativeFunctionTemplate( |
| 38 v8::Isolate* isolate, |
| 38 v8::Handle<v8::String> str) { | 39 v8::Handle<v8::String> str) { |
| 39 ASSERT(strcmp(*v8::String::Utf8Value(str), "getV8Statistics") == 0); | 40 ASSERT(strcmp(*v8::String::Utf8Value(str), "getV8Statistics") == 0); |
| 40 return v8::FunctionTemplate::New(StatisticsExtension::GetCounters); | 41 return v8::FunctionTemplate::New(StatisticsExtension::GetCounters); |
| 41 } | 42 } |
| 42 | 43 |
| 43 | 44 |
| 44 static void AddCounter(v8::Isolate* isolate, | 45 static void AddCounter(v8::Isolate* isolate, |
| 45 v8::Local<v8::Object> object, | 46 v8::Local<v8::Object> object, |
| 46 StatsCounter* counter, | 47 StatsCounter* counter, |
| 47 const char* name) { | 48 const char* name) { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 args.GetReturnValue().Set(result); | 170 args.GetReturnValue().Set(result); |
| 170 } | 171 } |
| 171 | 172 |
| 172 | 173 |
| 173 void StatisticsExtension::Register() { | 174 void StatisticsExtension::Register() { |
| 174 static StatisticsExtension statistics_extension; | 175 static StatisticsExtension statistics_extension; |
| 175 static v8::DeclareExtension declaration(&statistics_extension); | 176 static v8::DeclareExtension declaration(&statistics_extension); |
| 176 } | 177 } |
| 177 | 178 |
| 178 } } // namespace v8::internal | 179 } } // namespace v8::internal |
| OLD | NEW |