OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007-2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2007-2011 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 v8SetReturnValue(info, tryCatch.ReThrow()); | 358 v8SetReturnValue(info, tryCatch.ReThrow()); |
359 return; | 359 return; |
360 } | 360 } |
361 v8SetReturnValue(info, result); | 361 v8SetReturnValue(info, result); |
362 } | 362 } |
363 | 363 |
364 void V8InjectedScriptHost::setFunctionVariableValueMethodCustom(const v8::Functi
onCallbackInfo<v8::Value>& info) | 364 void V8InjectedScriptHost::setFunctionVariableValueMethodCustom(const v8::Functi
onCallbackInfo<v8::Value>& info) |
365 { | 365 { |
366 v8::Handle<v8::Value> functionValue = info[0]; | 366 v8::Handle<v8::Value> functionValue = info[0]; |
367 int scopeIndex = info[1]->Int32Value(); | 367 int scopeIndex = info[1]->Int32Value(); |
368 String variableName = toWebCoreStringWithUndefinedOrNullCheck(info[2]); | 368 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe
ck>, variableName, info[2]); |
369 v8::Handle<v8::Value> newValue = info[3]; | 369 v8::Handle<v8::Value> newValue = info[3]; |
370 | 370 |
371 InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder()); | 371 InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder()); |
372 ScriptDebugServer& debugServer = host->scriptDebugServer(); | 372 ScriptDebugServer& debugServer = host->scriptDebugServer(); |
373 v8SetReturnValue(info, debugServer.setFunctionVariableValue(functionValue, s
copeIndex, variableName, newValue)); | 373 v8SetReturnValue(info, debugServer.setFunctionVariableValue(functionValue, s
copeIndex, variableName, newValue)); |
374 } | 374 } |
375 | 375 |
376 static bool getFunctionLocation(const v8::FunctionCallbackInfo<v8::Value>& info,
String* scriptId, int* lineNumber, int* columnNumber) | 376 static bool getFunctionLocation(const v8::FunctionCallbackInfo<v8::Value>& info,
String* scriptId, int* lineNumber, int* columnNumber) |
377 { | 377 { |
378 if (info.Length() < 1) | 378 if (info.Length() < 1) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 if (!getFunctionLocation(info, &scriptId, &lineNumber, &columnNumber)) | 421 if (!getFunctionLocation(info, &scriptId, &lineNumber, &columnNumber)) |
422 return; | 422 return; |
423 | 423 |
424 v8::Handle<v8::Value> name; | 424 v8::Handle<v8::Value> name; |
425 if (info.Length() > 0 && info[0]->IsFunction()) { | 425 if (info.Length() > 0 && info[0]->IsFunction()) { |
426 v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(info[
0]); | 426 v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(info[
0]); |
427 name = function->GetName(); | 427 name = function->GetName(); |
428 if (!name->IsString() || !v8::Handle<v8::String>::Cast(name)->Length()) | 428 if (!name->IsString() || !v8::Handle<v8::String>::Cast(name)->Length()) |
429 name = function->GetInferredName(); | 429 name = function->GetInferredName(); |
430 } | 430 } |
| 431 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe
ck>, nameResource, name); |
431 | 432 |
432 InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder()); | 433 InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder()); |
433 host->monitorFunction(scriptId, lineNumber, columnNumber, toWebCoreStringWit
hUndefinedOrNullCheck(name)); | 434 host->monitorFunction(scriptId, lineNumber, columnNumber, nameResource); |
434 } | 435 } |
435 | 436 |
436 void V8InjectedScriptHost::unmonitorFunctionMethodCustom(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 437 void V8InjectedScriptHost::unmonitorFunctionMethodCustom(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
437 { | 438 { |
438 String scriptId; | 439 String scriptId; |
439 int lineNumber; | 440 int lineNumber; |
440 int columnNumber; | 441 int columnNumber; |
441 if (!getFunctionLocation(info, &scriptId, &lineNumber, &columnNumber)) | 442 if (!getFunctionLocation(info, &scriptId, &lineNumber, &columnNumber)) |
442 return; | 443 return; |
443 | 444 |
444 InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder()); | 445 InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder()); |
445 host->unmonitorFunction(scriptId, lineNumber, columnNumber); | 446 host->unmonitorFunction(scriptId, lineNumber, columnNumber); |
446 } | 447 } |
447 | 448 |
448 } // namespace WebCore | 449 } // namespace WebCore |
OLD | NEW |