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

Unified Diff: src/extensions/statistics-extension.cc

Issue 1162363005: Remove usage of to-be-deprecated APIs from v8 core (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/extensions/gc-extension.cc ('k') | src/full-codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/extensions/statistics-extension.cc
diff --git a/src/extensions/statistics-extension.cc b/src/extensions/statistics-extension.cc
index d1bb0918403f6c02ca0983d1a723bac5432ac30d..7093625270ee35ac1d087bd0c222bc038a289cef 100644
--- a/src/extensions/statistics-extension.cc
+++ b/src/extensions/statistics-extension.cc
@@ -24,8 +24,11 @@ static void AddCounter(v8::Isolate* isolate,
StatsCounter* counter,
const char* name) {
if (counter->Enabled()) {
- object->Set(v8::String::NewFromUtf8(isolate, name),
- v8::Number::New(isolate, *counter->GetInternalPointer()));
+ object->Set(isolate->GetCurrentContext(),
+ v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal)
+ .ToLocalChecked(),
+ v8::Number::New(isolate, *counter->GetInternalPointer()))
+ .FromJust();
}
}
@@ -33,8 +36,10 @@ static void AddNumber(v8::Isolate* isolate,
v8::Local<v8::Object> object,
intptr_t value,
const char* name) {
- object->Set(v8::String::NewFromUtf8(isolate, name),
- v8::Number::New(isolate, static_cast<double>(value)));
+ object->Set(isolate->GetCurrentContext(),
+ v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal)
+ .ToLocalChecked(),
+ v8::Number::New(isolate, static_cast<double>(value))).FromJust();
}
@@ -42,8 +47,10 @@ static void AddNumber64(v8::Isolate* isolate,
v8::Local<v8::Object> object,
int64_t value,
const char* name) {
- object->Set(v8::String::NewFromUtf8(isolate, name),
- v8::Number::New(isolate, static_cast<double>(value)));
+ object->Set(isolate->GetCurrentContext(),
+ v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal)
+ .ToLocalChecked(),
+ v8::Number::New(isolate, static_cast<double>(value))).FromJust();
}
@@ -54,7 +61,9 @@ void StatisticsExtension::GetCounters(
if (args.Length() > 0) { // GC if first argument evaluates to true.
if (args[0]->IsBoolean() &&
- args[0]->ToBoolean(args.GetIsolate())->Value()) {
+ args[0]
+ ->BooleanValue(args.GetIsolate()->GetCurrentContext())
+ .FromMaybe(false)) {
heap->CollectAllGarbage(Heap::kNoGCFlags, "counters extension");
}
}
« no previous file with comments | « src/extensions/gc-extension.cc ('k') | src/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698