| Index: test/cctest/profiler-extension.cc
|
| diff --git a/test/cctest/profiler-extension.cc b/test/cctest/profiler-extension.cc
|
| index c8cb0fb7ca9c0e3ae350e38caf29f6e08458f962..b332c1c4d40eb877c1e2e35de3d6ed6d63871568 100644
|
| --- a/test/cctest/profiler-extension.cc
|
| +++ b/test/cctest/profiler-extension.cc
|
| @@ -27,6 +27,9 @@
|
| //
|
| // Tests of profiles generator and utilities.
|
|
|
| +// TODO(jochen): Remove this after the setting is turned on globally.
|
| +#define V8_IMMINENT_DEPRECATION_WARNINGS
|
| +
|
| #include "src/base/logging.h"
|
| #include "test/cctest/profiler-extension.h"
|
|
|
| @@ -39,17 +42,25 @@ const char* ProfilerExtension::kSource =
|
| "native function startProfiling();"
|
| "native function stopProfiling();";
|
|
|
| -v8::Handle<v8::FunctionTemplate> ProfilerExtension::GetNativeFunctionTemplate(
|
| - v8::Isolate* isolate, v8::Handle<v8::String> name) {
|
| - if (name->Equals(v8::String::NewFromUtf8(isolate, "startProfiling"))) {
|
| +v8::Local<v8::FunctionTemplate> ProfilerExtension::GetNativeFunctionTemplate(
|
| + v8::Isolate* isolate, v8::Local<v8::String> name) {
|
| + v8::Local<v8::Context> context = isolate->GetCurrentContext();
|
| + if (name->Equals(context, v8::String::NewFromUtf8(isolate, "startProfiling",
|
| + v8::NewStringType::kNormal)
|
| + .ToLocalChecked())
|
| + .FromJust()) {
|
| return v8::FunctionTemplate::New(isolate,
|
| ProfilerExtension::StartProfiling);
|
| - } else if (name->Equals(v8::String::NewFromUtf8(isolate, "stopProfiling"))) {
|
| + } else if (name->Equals(context,
|
| + v8::String::NewFromUtf8(isolate, "stopProfiling",
|
| + v8::NewStringType::kNormal)
|
| + .ToLocalChecked())
|
| + .FromJust()) {
|
| return v8::FunctionTemplate::New(isolate,
|
| ProfilerExtension::StopProfiling);
|
| } else {
|
| CHECK(false);
|
| - return v8::Handle<v8::FunctionTemplate>();
|
| + return v8::Local<v8::FunctionTemplate>();
|
| }
|
| }
|
|
|
|
|