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

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

Issue 100963003: Use V8TRYCATCH_FOR_V8STRINGRESOURCE() macro instead of toCoreStringWithUndefinedOrNullCheck() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Take Yury's feedback into consideration 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) 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 if (isPaused()) 376 if (isPaused())
377 return; 377 return;
378 378
379 ScriptDebugListener* listener = getDebugListenerForContext(m_pausedContext); 379 ScriptDebugListener* listener = getDebugListenerForContext(m_pausedContext);
380 if (!listener) 380 if (!listener)
381 return; 381 return;
382 382
383 Vector<String> breakpointIds; 383 Vector<String> breakpointIds;
384 if (!hitBreakpointNumbers.IsEmpty()) { 384 if (!hitBreakpointNumbers.IsEmpty()) {
385 breakpointIds.resize(hitBreakpointNumbers->Length()); 385 breakpointIds.resize(hitBreakpointNumbers->Length());
386 for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++) 386 for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++) {
387 breakpointIds[i] = toCoreStringWithUndefinedOrNullCheck(hitBreakpoin tNumbers->Get(i)); 387 v8::Handle<v8::Value> hitBreakpointNumber = hitBreakpointNumbers->Ge t(i);
388 ASSERT(!hitBreakpointNumber.IsEmpty() && hitBreakpointNumber->IsInt3 2());
389 breakpointIds[i] = String::number(hitBreakpointNumber->Int32Value()) ;
390 }
388 } 391 }
389 392
390 m_executionState.set(m_isolate, executionState); 393 m_executionState.set(m_isolate, executionState);
391 ScriptState* currentCallFrameState = ScriptState::forContext(m_pausedContext ); 394 ScriptState* currentCallFrameState = ScriptState::forContext(m_pausedContext );
392 listener->didPause(currentCallFrameState, currentCallFrames(), ScriptValue(e xception, currentCallFrameState->isolate()), breakpointIds); 395 listener->didPause(currentCallFrameState, currentCallFrames(), ScriptValue(e xception, currentCallFrameState->isolate()), breakpointIds);
393 396
394 m_runningNestedMessageLoop = true; 397 m_runningNestedMessageLoop = true;
395 runMessageLoopOnPause(m_pausedContext); 398 runMessageLoopOnPause(m_pausedContext);
396 m_runningNestedMessageLoop = false; 399 m_runningNestedMessageLoop = false;
397 } 400 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 skipRequest = listener->shouldSkipStepPause(topFrame); 484 skipRequest = listener->shouldSkipStepPause(topFrame);
482 if (executeSkipPauseRequest(skipRequest, eventDetails.GetExecutionSt ate())) 485 if (executeSkipPauseRequest(skipRequest, eventDetails.GetExecutionSt ate()))
483 return; 486 return;
484 handleProgramBreak(eventDetails, v8::Handle<v8::Value>(), hitBreakpo ints.As<v8::Array>()); 487 handleProgramBreak(eventDetails, v8::Handle<v8::Value>(), hitBreakpo ints.As<v8::Array>());
485 } 488 }
486 } 489 }
487 } 490 }
488 491
489 void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8 ::Handle<v8::Object> object) 492 void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8 ::Handle<v8::Object> object)
490 { 493 {
491 String sourceID = toCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicS tring(m_isolate, "id"))); 494 v8::Handle<v8::Value> id = object->Get(v8AtomicString(m_isolate, "id"));
495 ASSERT(!id.IsEmpty() && id->IsInt32());
496 String sourceID = String::number(id->Int32Value());
492 497
493 ScriptDebugListener::Script script; 498 ScriptDebugListener::Script script;
494 script.url = toCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString (m_isolate, "name"))); 499 script.url = toCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString (m_isolate, "name")));
495 script.source = toCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicStr ing(m_isolate, "source"))); 500 script.source = toCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicStr ing(m_isolate, "source")));
496 script.sourceMappingURL = toCoreStringWithUndefinedOrNullCheck(object->Get(v 8AtomicString(m_isolate, "sourceMappingURL"))); 501 script.sourceMappingURL = toCoreStringWithUndefinedOrNullCheck(object->Get(v 8AtomicString(m_isolate, "sourceMappingURL")));
497 script.startLine = object->Get(v8AtomicString(m_isolate, "startLine"))->ToIn teger()->Value(); 502 script.startLine = object->Get(v8AtomicString(m_isolate, "startLine"))->ToIn teger()->Value();
498 script.startColumn = object->Get(v8AtomicString(m_isolate, "startColumn"))-> ToInteger()->Value(); 503 script.startColumn = object->Get(v8AtomicString(m_isolate, "startColumn"))-> ToInteger()->Value();
499 script.endLine = object->Get(v8AtomicString(m_isolate, "endLine"))->ToIntege r()->Value(); 504 script.endLine = object->Get(v8AtomicString(m_isolate, "endLine"))->ToIntege r()->Value();
500 script.endColumn = object->Get(v8AtomicString(m_isolate, "endColumn"))->ToIn teger()->Value(); 505 script.endColumn = object->Get(v8AtomicString(m_isolate, "endColumn"))->ToIn teger()->Value();
501 script.isContentScript = object->Get(v8AtomicString(m_isolate, "isContentScr ipt"))->ToBoolean()->Value(); 506 script.isContentScript = object->Get(v8AtomicString(m_isolate, "isContentScr ipt"))->ToBoolean()->Value();
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 { 622 {
618 return PassOwnPtr<ScriptSourceCode>(); 623 return PassOwnPtr<ScriptSourceCode>();
619 } 624 }
620 625
621 String ScriptDebugServer::preprocessEventListener(Frame*, const String& source, const String& url, const String& functionName) 626 String ScriptDebugServer::preprocessEventListener(Frame*, const String& source, const String& url, const String& functionName)
622 { 627 {
623 return source; 628 return source;
624 } 629 }
625 630
626 } // namespace WebCore 631 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/Window/showModalDialog-invalid-arguments-expected.txt ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698