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

Side by Side Diff: Source/bindings/v8/V8ErrorHandler.cpp

Issue 23470004: Have handleMaxRecursionDepthExceeded() take an isolate in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global(); 63 v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global();
64 64
65 v8::Local<v8::Value> error = jsEvent->ToObject()->GetHiddenValue(V8Hidde nPropertyName::error()); 65 v8::Local<v8::Value> error = jsEvent->ToObject()->GetHiddenValue(V8Hidde nPropertyName::error());
66 if (error.IsEmpty()) 66 if (error.IsEmpty())
67 error = v8::Null(isolate); 67 error = v8::Null(isolate);
68 68
69 v8::Handle<v8::Value> parameters[5] = { v8String(errorEvent->message(), isolate), v8String(errorEvent->filename(), isolate), v8::Integer::New(errorEvent ->lineno(), isolate), v8::Integer::New(errorEvent->colno(), isolate), error }; 69 v8::Handle<v8::Value> parameters[5] = { v8String(errorEvent->message(), isolate), v8String(errorEvent->filename(), isolate), v8::Integer::New(errorEvent ->lineno(), isolate), v8::Integer::New(errorEvent->colno(), isolate), error };
70 v8::TryCatch tryCatch; 70 v8::TryCatch tryCatch;
71 tryCatch.SetVerbose(true); 71 tryCatch.SetVerbose(true);
72 if (worldType(isolate) == WorkerWorld) 72 if (worldType(isolate) == WorkerWorld)
73 returnValue = V8ScriptRunner::callFunction(callFunction, context, th isValue, WTF_ARRAY_LENGTH(parameters), parameters); 73 returnValue = V8ScriptRunner::callFunction(callFunction, context, th isValue, WTF_ARRAY_LENGTH(parameters), parameters, isolate);
74 else 74 else
75 returnValue = ScriptController::callFunctionWithInstrumentation(0, c allFunction, thisValue, WTF_ARRAY_LENGTH(parameters), parameters); 75 returnValue = ScriptController::callFunctionWithInstrumentation(0, c allFunction, thisValue, WTF_ARRAY_LENGTH(parameters), parameters, isolate);
76 } 76 }
77 return returnValue; 77 return returnValue;
78 } 78 }
79 79
80 // static 80 // static
81 void V8ErrorHandler::storeExceptionOnErrorEventWrapper(ErrorEvent* event, v8::Ha ndle<v8::Value> data, v8::Isolate* isolate) 81 void V8ErrorHandler::storeExceptionOnErrorEventWrapper(ErrorEvent* event, v8::Ha ndle<v8::Value> data, v8::Isolate* isolate)
82 { 82 {
83 v8::Local<v8::Value> wrappedEvent = toV8(event, v8::Handle<v8::Object>(), is olate); 83 v8::Local<v8::Value> wrappedEvent = toV8(event, v8::Handle<v8::Object>(), is olate);
84 if (!wrappedEvent.IsEmpty()) { 84 if (!wrappedEvent.IsEmpty()) {
85 ASSERT(wrappedEvent->IsObject()); 85 ASSERT(wrappedEvent->IsObject());
86 v8::Local<v8::Object>::Cast(wrappedEvent)->SetHiddenValue(V8HiddenProper tyName::error(), data); 86 v8::Local<v8::Object>::Cast(wrappedEvent)->SetHiddenValue(V8HiddenProper tyName::error(), data);
87 } 87 }
88 } 88 }
89 89
90 bool V8ErrorHandler::shouldPreventDefault(v8::Local<v8::Value> returnValue) 90 bool V8ErrorHandler::shouldPreventDefault(v8::Local<v8::Value> returnValue)
91 { 91 {
92 return returnValue->IsBoolean() && returnValue->BooleanValue(); 92 return returnValue->IsBoolean() && returnValue->BooleanValue();
93 } 93 }
94 94
95 } // namespace WebCore 95 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698