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

Unified Diff: src/inspector/v8-debugger.cc

Issue 2471583003: [inspector] migrate Debugger to new style (Closed)
Patch Set: addressed comments Created 4 years, 1 month 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 | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-debugger.cc
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
index 8b8f62881a8f9eead222bf814047bc11f5826912..7db9bb4823d54601230e826a7e3501c00b6346e4 100644
--- a/src/inspector/v8-debugger.cc
+++ b/src/inspector/v8-debugger.cc
@@ -329,11 +329,11 @@ void V8Debugger::clearStepping() {
v8::DebugInterface::ClearStepping(m_isolate);
}
-bool V8Debugger::setScriptSource(
+Response V8Debugger::setScriptSource(
const String16& sourceID, v8::Local<v8::String> newSource, bool dryRun,
- ErrorString* error,
Maybe<protocol::Runtime::ExceptionDetails>* exceptionDetails,
- JavaScriptCallFrames* newCallFrames, Maybe<bool>* stackChanged) {
+ JavaScriptCallFrames* newCallFrames, Maybe<bool>* stackChanged,
+ bool* compileError) {
class EnableLiveEditScope {
public:
explicit EnableLiveEditScope(v8::Isolate* isolate) : m_isolate(isolate) {
@@ -349,6 +349,7 @@ bool V8Debugger::setScriptSource(
v8::Isolate* m_isolate;
};
+ *compileError = false;
DCHECK(enabled());
v8::HandleScope scope(m_isolate);
@@ -369,10 +370,9 @@ bool V8Debugger::setScriptSource(
if (tryCatch.HasCaught()) {
v8::Local<v8::Message> message = tryCatch.Message();
if (!message.IsEmpty())
- *error = toProtocolStringWithTypeCheck(message->Get());
+ return Response::Error(toProtocolStringWithTypeCheck(message->Get()));
else
- *error = "Unknown error.";
- return false;
+ return Response::InternalError();
}
v8result = maybeResult.ToLocalChecked();
}
@@ -397,7 +397,7 @@ bool V8Debugger::setScriptSource(
JavaScriptCallFrames frames = currentCallFrames();
newCallFrames->swap(frames);
}
- return true;
+ return Response::OK();
}
// Compile error.
case 1: {
@@ -419,11 +419,11 @@ bool V8Debugger::setScriptSource(
->Value()) -
1)
.build();
- return false;
+ *compileError = true;
+ return Response::OK();
}
}
- *error = "Unknown error.";
- return false;
+ return Response::InternalError();
}
JavaScriptCallFrames V8Debugger::currentCallFrames(int limit) {
« no previous file with comments | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698