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

Side by Side Diff: Source/bindings/v8/ScriptDebugServer.cpp

Issue 98853012: Revert of 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
« no previous file with comments | « Source/bindings/v8/PageScriptDebugServer.cpp ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. 2 * Copyright (c) 2010-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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 if (normalResult->IsObject()) 291 if (normalResult->IsObject())
292 *result = ScriptObject(ScriptState::current(), normalResult->ToO bject()); 292 *result = ScriptObject(ScriptState::current(), normalResult->ToO bject());
293 // Call stack may have changed after if the edited function was on t he stack. 293 // Call stack may have changed after if the edited function was on t he stack.
294 if (!preview && isPaused()) 294 if (!preview && isPaused())
295 *newCallFrames = currentCallFrames(); 295 *newCallFrames = currentCallFrames();
296 return true; 296 return true;
297 } 297 }
298 // Compile error. 298 // Compile error.
299 case 1: 299 case 1:
300 { 300 {
301 V8StringResource<WithUndefinedOrNullCheck> message(resultTuple->Get( 2));
302 if (!message.prepare()) {
303 *error = "Unknown error.";
304 return false;
305 }
306 RefPtr<TypeBuilder::Debugger::SetScriptSourceError::CompileError> co mpileError = 301 RefPtr<TypeBuilder::Debugger::SetScriptSourceError::CompileError> co mpileError =
307 TypeBuilder::Debugger::SetScriptSourceError::CompileError::creat e() 302 TypeBuilder::Debugger::SetScriptSourceError::CompileError::creat e()
308 .setMessage(message) 303 .setMessage(toWebCoreStringWithUndefinedOrNullCheck(resultTu ple->Get(2)))
309 .setLineNumber(resultTuple->Get(3)->ToInteger()->Value()) 304 .setLineNumber(resultTuple->Get(3)->ToInteger()->Value())
310 .setColumnNumber(resultTuple->Get(4)->ToInteger()->Value()); 305 .setColumnNumber(resultTuple->Get(4)->ToInteger()->Value());
311 306
312 V8StringResource<WithUndefinedOrNullCheck> errorResource(resultTuple ->Get(1)); 307 *error = toWebCoreStringWithUndefinedOrNullCheck(resultTuple->Get(1) );
313 if (!errorResource.prepare()) {
314 *error = "Unknown error.";
315 return false;
316 }
317 *error = errorResource;
318 errorData = TypeBuilder::Debugger::SetScriptSourceError::create(); 308 errorData = TypeBuilder::Debugger::SetScriptSourceError::create();
319 errorData->setCompileError(compileError); 309 errorData->setCompileError(compileError);
320 return false; 310 return false;
321 } 311 }
322 } 312 }
323 *error = "Unknown error."; 313 *error = "Unknown error.";
324 return false; 314 return false;
325 } 315 }
326 316
327 PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::wrapCallFrames(v8::Handle<v8: :Object> executionState, int maximumLimit) 317 PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::wrapCallFrames(v8::Handle<v8: :Object> executionState, int maximumLimit)
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 if (isPaused()) 377 if (isPaused())
388 return; 378 return;
389 379
390 ScriptDebugListener* listener = getDebugListenerForContext(m_pausedContext); 380 ScriptDebugListener* listener = getDebugListenerForContext(m_pausedContext);
391 if (!listener) 381 if (!listener)
392 return; 382 return;
393 383
394 Vector<String> breakpointIds; 384 Vector<String> breakpointIds;
395 if (!hitBreakpointNumbers.IsEmpty()) { 385 if (!hitBreakpointNumbers.IsEmpty()) {
396 breakpointIds.resize(hitBreakpointNumbers->Length()); 386 breakpointIds.resize(hitBreakpointNumbers->Length());
397 for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++) { 387 for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++)
398 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedO rNullCheck>, hitBreakpointNumber, hitBreakpointNumbers->Get(i)); 388 breakpointIds[i] = toWebCoreStringWithUndefinedOrNullCheck(hitBreakp ointNumbers->Get(i));
399 breakpointIds[i] = hitBreakpointNumber;
400 }
401 } 389 }
402 390
403 m_executionState.set(m_isolate, executionState); 391 m_executionState.set(m_isolate, executionState);
404 ScriptState* currentCallFrameState = ScriptState::forContext(m_pausedContext ); 392 ScriptState* currentCallFrameState = ScriptState::forContext(m_pausedContext );
405 listener->didPause(currentCallFrameState, currentCallFrames(), ScriptValue(e xception, currentCallFrameState->isolate()), breakpointIds); 393 listener->didPause(currentCallFrameState, currentCallFrames(), ScriptValue(e xception, currentCallFrameState->isolate()), breakpointIds);
406 394
407 m_runningNestedMessageLoop = true; 395 m_runningNestedMessageLoop = true;
408 runMessageLoopOnPause(m_pausedContext); 396 runMessageLoopOnPause(m_pausedContext);
409 m_runningNestedMessageLoop = false; 397 m_runningNestedMessageLoop = false;
410 } 398 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 skipRequest = listener->shouldSkipStepPause(topFrame); 482 skipRequest = listener->shouldSkipStepPause(topFrame);
495 if (executeSkipPauseRequest(skipRequest, eventDetails.GetExecutionSt ate())) 483 if (executeSkipPauseRequest(skipRequest, eventDetails.GetExecutionSt ate()))
496 return; 484 return;
497 handleProgramBreak(eventDetails, v8::Handle<v8::Value>(), hitBreakpo ints.As<v8::Array>()); 485 handleProgramBreak(eventDetails, v8::Handle<v8::Value>(), hitBreakpo ints.As<v8::Array>());
498 } 486 }
499 } 487 }
500 } 488 }
501 489
502 void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8 ::Handle<v8::Object> object) 490 void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8 ::Handle<v8::Object> object)
503 { 491 {
504 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe ck>, sourceID, object->Get(v8AtomicString(m_isolate, "id"))); 492 String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8Atom icString(m_isolate, "id")));
505 493
506 ScriptDebugListener::Script script; 494 ScriptDebugListener::Script script;
507 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe ck>, url, object->Get(v8AtomicString(m_isolate, "name"))); 495 script.url = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicStr ing(m_isolate, "name")));
508 script.url = url; 496 script.source = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8Atomic String(m_isolate, "source")));
509 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe ck>, source, object->Get(v8AtomicString(m_isolate, "source"))); 497 script.sourceMappingURL = toWebCoreStringWithUndefinedOrNullCheck(object->Ge t(v8AtomicString(m_isolate, "sourceMappingURL")));
510 script.source = source;
511 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe ck>, sourceMappingURL, object->Get(v8AtomicString(m_isolate, "sourceMappingURL") ));
512 script.sourceMappingURL = sourceMappingURL;
513 script.startLine = object->Get(v8AtomicString(m_isolate, "startLine"))->ToIn teger()->Value(); 498 script.startLine = object->Get(v8AtomicString(m_isolate, "startLine"))->ToIn teger()->Value();
514 script.startColumn = object->Get(v8AtomicString(m_isolate, "startColumn"))-> ToInteger()->Value(); 499 script.startColumn = object->Get(v8AtomicString(m_isolate, "startColumn"))-> ToInteger()->Value();
515 script.endLine = object->Get(v8AtomicString(m_isolate, "endLine"))->ToIntege r()->Value(); 500 script.endLine = object->Get(v8AtomicString(m_isolate, "endLine"))->ToIntege r()->Value();
516 script.endColumn = object->Get(v8AtomicString(m_isolate, "endColumn"))->ToIn teger()->Value(); 501 script.endColumn = object->Get(v8AtomicString(m_isolate, "endColumn"))->ToIn teger()->Value();
517 script.isContentScript = object->Get(v8AtomicString(m_isolate, "isContentScr ipt"))->ToBoolean()->Value(); 502 script.isContentScript = object->Get(v8AtomicString(m_isolate, "isContentScr ipt"))->ToBoolean()->Value();
518 503
519 listener->didParseSource(sourceID, script); 504 listener->didParseSource(sourceID, script);
520 } 505 }
521 506
522 void ScriptDebugServer::ensureDebuggerScriptCompiled() 507 void ScriptDebugServer::ensureDebuggerScriptCompiled()
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 { 618 {
634 return PassOwnPtr<ScriptSourceCode>(); 619 return PassOwnPtr<ScriptSourceCode>();
635 } 620 }
636 621
637 String ScriptDebugServer::preprocessEventListener(Frame*, const String& source, const String& url, const String& functionName) 622 String ScriptDebugServer::preprocessEventListener(Frame*, const String& source, const String& url, const String& functionName)
638 { 623 {
639 return source; 624 return source;
640 } 625 }
641 626
642 } // namespace WebCore 627 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/PageScriptDebugServer.cpp ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698