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

Unified Diff: Source/bindings/core/dart/DartScriptDebugServer.cpp

Issue 1663753002: Apply all blink changes between @202695 and tip of trunk (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/2454_1
Patch Set: Created 4 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/core/dart/DartNativeUtilities.cpp ('k') | Source/bindings/core/dart/DartService.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/dart/DartScriptDebugServer.cpp
diff --git a/Source/bindings/core/dart/DartScriptDebugServer.cpp b/Source/bindings/core/dart/DartScriptDebugServer.cpp
index 47f4d271f80a4ae22600c6abf556999d2468e5fc..a0d168b952e528341b6dd41dc586d94891c53b28 100644
--- a/Source/bindings/core/dart/DartScriptDebugServer.cpp
+++ b/Source/bindings/core/dart/DartScriptDebugServer.cpp
@@ -208,6 +208,10 @@ String DartPageDebug::setBreakpoint(const String& sourceID, const ScriptBreakpoi
DartIsolateScope scope(isolate);
DartApiScope apiScope;
Dart_Handle exception = 0;
+ if (!DartDOMData::current()->hasApplicationLoader()) {
+ // TODO(jacobr): why are we still hitting this case?
+ break;
+ }
if (!DartDOMData::current()->applicationLoader()->running()) {
// Skip until the loader is actually running. We'll set the breakpoint at that point.
break;
@@ -314,11 +318,15 @@ void DartPageDebug::dispatchDidParseSource(intptr_t libraryId, Dart_Handle scrip
break;
}
}
- Dart_Handle exception = 0;
- lastLineNumber = DartUtilities::toInteger(Dart_ListGetAt(info, lastLineStart + 1), exception);
- ASSERT(!exception);
- lastColumnNumber = DartUtilities::toInteger(Dart_ListGetAt(info, infoLength - 1), exception);
- ASSERT(!exception);
+ // we shouldn't crash even if a script has zero valid Dart tokens.
+ // TODO(jacobr): I don't know why this occurs.
+ if (lastLineStart + 1 < infoLength && infoLength > 0) {
+ Dart_Handle exception = 0;
+ lastLineNumber = DartUtilities::toInteger(Dart_ListGetAt(info, lastLineStart + 1), exception);
+ ASSERT(!exception);
+ lastColumnNumber = DartUtilities::toInteger(Dart_ListGetAt(info, infoLength - 1), exception);
+ ASSERT(!exception);
+ }
script.startLine = 0;
script.startColumn = 0;
@@ -605,10 +613,14 @@ String DartScriptDebugServer::getScriptId(const String& url, Dart_Isolate isolat
void DartScriptDebugServer::registerIsolate(Dart_Isolate isolate, Page* page)
{
- threadSafeIsolateTracker().add(isolate);
-
DartIsolateScope scope(isolate);
DartApiScope apiScope;
+ // Check whether this is an isolate we really want to debug.
+ if (DartDOMData::current() == NULL || !DartDOMData::current()->hasApplicationLoader()) {
+ return;
+ }
+
+ threadSafeIsolateTracker().add(isolate);
DartPageDebug* pageDebug = lookupPageDebug(page);
pageDebug->registerIsolate(isolate);
« no previous file with comments | « Source/bindings/core/dart/DartNativeUtilities.cpp ('k') | Source/bindings/core/dart/DartService.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698