 Chromium Code Reviews
 Chromium Code Reviews Issue 68073005:
  Update ScriptController's resourceInfo() to use V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN()  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 68073005:
  Update ScriptController's resourceInfo() to use V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN()  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| 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); | 
| } |