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

Unified Diff: src/messages.cc

Issue 12254007: Make the Isolate parameter mandatory for internal HandleScopes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 7 years, 10 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/messages.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.cc
diff --git a/src/messages.cc b/src/messages.cc
index 801930d2b3f4b86b2dacb9b5ffe2ef3b5b6c6560..b6c10c55b950b25787330bbfae9abd0900c95051 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -38,13 +38,14 @@ namespace internal {
// If no message listeners have been registered this one is called
// by default.
-void MessageHandler::DefaultMessageReport(const MessageLocation* loc,
+void MessageHandler::DefaultMessageReport(Isolate* isolate,
+ const MessageLocation* loc,
Handle<Object> message_obj) {
- SmartArrayPointer<char> str = GetLocalizedMessage(message_obj);
+ SmartArrayPointer<char> str = GetLocalizedMessage(isolate, message_obj);
if (loc == NULL) {
PrintF("%s\n", *str);
} else {
- HandleScope scope;
+ HandleScope scope(isolate);
Handle<Object> data(loc->script()->name());
SmartArrayPointer<char> data_str;
if (data->IsString())
@@ -124,13 +125,13 @@ void MessageHandler::ReportMessage(Isolate* isolate,
v8::NeanderArray global_listeners(FACTORY->message_listeners());
int global_length = global_listeners.length();
if (global_length == 0) {
- DefaultMessageReport(loc, message);
+ DefaultMessageReport(isolate, loc, message);
if (isolate->has_scheduled_exception()) {
isolate->clear_scheduled_exception();
}
} else {
for (int i = 0; i < global_length; i++) {
- HandleScope scope;
+ HandleScope scope(isolate);
if (global_listeners.get(i)->IsUndefined()) continue;
Handle<Foreign> callback_obj(Foreign::cast(global_listeners.get(i)));
v8::MessageCallback callback =
@@ -183,8 +184,9 @@ Handle<String> MessageHandler::GetMessage(Handle<Object> data) {
SmartArrayPointer<char> MessageHandler::GetLocalizedMessage(
+ Isolate* isolate,
Handle<Object> data) {
- HandleScope scope;
+ HandleScope scope(isolate);
return GetMessage(data)->ToCString(DISALLOW_NULLS);
}
« no previous file with comments | « src/messages.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698