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

Side by Side Diff: Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp

Issue 110663003: Remove uses of deprecated toWebCoreStringWithUndefinedOrNullCheck(v8::Handle<v8::Value>) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8Binding.h ('k') | Source/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698