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

Unified Diff: Source/bindings/v8/ScriptController.cpp

Issue 68073005: Update ScriptController's resourceInfo() to use V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptController.cpp
diff --git a/Source/bindings/v8/ScriptController.cpp b/Source/bindings/v8/ScriptController.cpp
index 199c0ca7deecb83da87def13ff925c2dbbaf4297..fa37c6ca54824fa3ca1dc9fea1f45b622989f94a 100644
--- a/Source/bindings/v8/ScriptController.cpp
+++ b/Source/bindings/v8/ScriptController.cpp
@@ -153,16 +153,18 @@ v8::Local<v8::Value> ScriptController::callFunction(v8::Handle<v8::Function> fun
return ScriptController::callFunction(m_frame->document(), function, receiver, argc, info, m_isolate);
}
-static void resourceInfo(const v8::Handle<v8::Function> function, String& resourceName, int& lineNumber)
+static bool resourceInfo(const v8::Handle<v8::Function> function, String& resourceName, int& lineNumber)
{
v8::ScriptOrigin origin = function->GetScriptOrigin();
if (origin.ResourceName().IsEmpty()) {
resourceName = "undefined";
lineNumber = 1;
} else {
- resourceName = toWebCoreString(origin.ResourceName());
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, stringResourceName, origin.ResourceName(), false);
haraken 2013/11/15 16:23:11 Is there any code that wants to return other than
Inactive 2013/11/15 16:28:49 Yes, some call sites want to return something else
+ resourceName = stringResourceName;
lineNumber = function->GetScriptLineNumber() + 1;
}
+ return true;
}
v8::Local<v8::Value> ScriptController::callFunction(ExecutionContext* context, v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> info[], v8::Isolate* isolate)
@@ -171,7 +173,8 @@ v8::Local<v8::Value> ScriptController::callFunction(ExecutionContext* context, v
if (InspectorInstrumentation::timelineAgentEnabled(context)) {
String resourceName;
int lineNumber;
- resourceInfo(function, resourceName, lineNumber);
+ if (!resourceInfo(function, resourceName, lineNumber))
+ return v8::Local<v8::Value>();
cookie = InspectorInstrumentation::willCallFunction(context, resourceName, lineNumber);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698