OLD | NEW |
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 "webkit/extensions/v8/profiler_extension.h" | 5 #include "webkit/extensions/v8/profiler_extension.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "v8/include/v8.h" | 8 #include "v8/include/v8.h" |
9 | 9 |
10 #if defined(USE_TCMALLOC) && defined(OS_POSIX) && !defined(OS_MACOSX) | 10 #if defined(USE_TCMALLOC) && defined(OS_POSIX) && !defined(OS_MACOSX) |
11 #include "third_party/tcmalloc/chromium/src/gperftools/profiler.h" | 11 #include "third_party/tcmalloc/chromium/src/google/profiler.h" |
12 #endif | 12 #endif |
13 | 13 |
14 const char kProfilerExtensionName[] = "v8/Profiler"; | 14 const char kProfilerExtensionName[] = "v8/Profiler"; |
15 | 15 |
16 namespace extensions_v8 { | 16 namespace extensions_v8 { |
17 | 17 |
18 class ProfilerWrapper : public v8::Extension { | 18 class ProfilerWrapper : public v8::Extension { |
19 public: | 19 public: |
20 ProfilerWrapper() : | 20 ProfilerWrapper() : |
21 v8::Extension(kProfilerExtensionName, | 21 v8::Extension(kProfilerExtensionName, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 return v8::Undefined(); | 96 return v8::Undefined(); |
97 } | 97 } |
98 }; | 98 }; |
99 | 99 |
100 v8::Extension* ProfilerExtension::Get() { | 100 v8::Extension* ProfilerExtension::Get() { |
101 return new ProfilerWrapper(); | 101 return new ProfilerWrapper(); |
102 } | 102 } |
103 | 103 |
104 } // namespace extensions_v8 | 104 } // namespace extensions_v8 |
OLD | NEW |