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

Side by Side Diff: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp

Issue 2116563003: [DevTools] Report unhandled exceptions and promise rejections through Runtime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after ExceptionDetails change Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 Google Inc. All rights reserved. 2 * Copyright (c) 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 DOMWrapperWorld& world = scriptState->world(); 116 DOMWrapperWorld& world = scriptState->world();
117 debugger()->contextCreated(V8ContextInfo(scriptState->context(), contextGrou pId(frame), world.isMainWorld(), origin ? origin->toRawString() : "", world.isIs olatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFactory: :frameId(frame), scriptState->getExecutionContext()->isDocument())); 117 debugger()->contextCreated(V8ContextInfo(scriptState->context(), contextGrou pId(frame), world.isMainWorld(), origin ? origin->toRawString() : "", world.isIs olatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFactory: :frameId(frame), scriptState->getExecutionContext()->isDocument()));
118 } 118 }
119 119
120 void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState) 120 void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState)
121 { 121 {
122 v8::HandleScope handles(scriptState->isolate()); 122 v8::HandleScope handles(scriptState->isolate());
123 debugger()->contextDestroyed(scriptState->context()); 123 debugger()->contextDestroyed(scriptState->context());
124 } 124 }
125 125
126 void MainThreadDebugger::exceptionThrown(LocalFrame* frame, const String& errorM essage, std::unique_ptr<SourceLocation> location)
127 {
128 debugger()->exceptionThrown(contextGroupId(frame), errorMessage, location->u rl(), location->lineNumber(), location->columnNumber(), location->cloneStackTrac e(), location->scriptId());
129 }
130
126 int MainThreadDebugger::contextGroupId(LocalFrame* frame) 131 int MainThreadDebugger::contextGroupId(LocalFrame* frame)
127 { 132 {
128 LocalFrame* localFrameRoot = frame->localFrameRoot(); 133 LocalFrame* localFrameRoot = frame->localFrameRoot();
129 return frameId(localFrameRoot); 134 return frameId(localFrameRoot);
130 } 135 }
131 136
132 MainThreadDebugger* MainThreadDebugger::instance() 137 MainThreadDebugger* MainThreadDebugger::instance()
133 { 138 {
134 ASSERT(isMainThread()); 139 ASSERT(isMainThread());
135 V8PerIsolateData* data = V8PerIsolateData::from(V8PerIsolateData::mainThread Isolate()); 140 V8PerIsolateData* data = V8PerIsolateData::from(V8PerIsolateData::mainThread Isolate());
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 return; 308 return;
304 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get Isolate())).FromMaybe(false)) 309 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get Isolate())).FromMaybe(false))
305 return; 310 return;
306 } 311 }
307 info.GetReturnValue().Set(nodes); 312 info.GetReturnValue().Set(nodes);
308 } 313 }
309 exceptionState.throwIfNeeded(); 314 exceptionState.throwIfNeeded();
310 } 315 }
311 316
312 } // namespace blink 317 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698