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

Unified Diff: src/api.cc

Issue 365153002: Remove a bunch of Isolate::UncheckedCurrent calls (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 5 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
« include/v8.h ('K') | « include/v8.h ('k') | src/counters.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index f458c86bc2cb3ddefcac057640aec071daa84dbf..6cb6b9ebdf23310d22c8d99568805204d31726de 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -370,14 +370,14 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) {
void V8::SetFatalErrorHandler(FatalErrorCallback that) {
- i::Isolate* isolate = i::Isolate::UncheckedCurrent();
+ i::Isolate* isolate = i::Isolate::Current();
isolate->set_exception_behavior(that);
}
void V8::SetAllowCodeGenerationFromStringsCallback(
AllowCodeGenerationFromStringsCallback callback) {
- i::Isolate* isolate = i::Isolate::UncheckedCurrent();
+ i::Isolate* isolate = i::Isolate::Current();
isolate->set_allow_code_gen_callback(callback);
}
@@ -6602,7 +6602,7 @@ void Isolate::RequestGarbageCollectionForTesting(GarbageCollectionType type) {
Isolate* Isolate::GetCurrent() {
- i::Isolate* isolate = i::Isolate::UncheckedCurrent();
+ i::Isolate* isolate = i::Isolate::Current();
return reinterpret_cast<Isolate*>(isolate);
}
@@ -6768,6 +6768,30 @@ void Isolate::SetUseCounterCallback(UseCounterCallback callback) {
}
+void Isolate::SetCounterFunction(CounterLookupCallback callback) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
+ isolate->stats_table()->SetCounterFunction(callback);
+ isolate->InitializeLoggingAndCounters();
+ isolate->counters()->ResetCounters();
+}
+
+
+void Isolate::SetCreateHistogramFunction(CreateHistogramCallback callback) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
+ isolate->stats_table()->SetCreateHistogramFunction(callback);
+ isolate->InitializeLoggingAndCounters();
+ isolate->counters()->ResetHistograms();
+}
+
+
+void Isolate::SetAddHistogramSampleFunction(
+ AddHistogramSampleCallback callback) {
+ reinterpret_cast<i::Isolate*>(this)
+ ->stats_table()
+ ->SetAddHistogramSampleFunction(callback);
+}
+
+
String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj)
: str_(NULL), length_(0) {
i::Isolate* isolate = i::Isolate::Current();
« include/v8.h ('K') | « include/v8.h ('k') | src/counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698