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

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

Issue 113213002: Rename toWebCoreString*() utility methods to toCoreString*() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Keep "to" prefix 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 String variableName = toCoreStringWithUndefinedOrNullCheck(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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 431
432 InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder()); 432 InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder());
433 host->monitorFunction(scriptId, lineNumber, columnNumber, toWebCoreStringWit hUndefinedOrNullCheck(name)); 433 host->monitorFunction(scriptId, lineNumber, columnNumber, toCoreStringWithUn definedOrNullCheck(name));
434 } 434 }
435 435
436 void V8InjectedScriptHost::unmonitorFunctionMethodCustom(const v8::FunctionCallb ackInfo<v8::Value>& info) 436 void V8InjectedScriptHost::unmonitorFunctionMethodCustom(const v8::FunctionCallb ackInfo<v8::Value>& info)
437 { 437 {
438 String scriptId; 438 String scriptId;
439 int lineNumber; 439 int lineNumber;
440 int columnNumber; 440 int columnNumber;
441 if (!getFunctionLocation(info, &scriptId, &lineNumber, &columnNumber)) 441 if (!getFunctionLocation(info, &scriptId, &lineNumber, &columnNumber))
442 return; 442 return;
443 443
444 InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder()); 444 InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder());
445 host->unmonitorFunction(scriptId, lineNumber, columnNumber); 445 host->unmonitorFunction(scriptId, lineNumber, columnNumber);
446 } 446 }
447 447
448 } // namespace WebCore 448 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698