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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp

Issue 1921143002: [DevTools] Align Console implementation with The JSey way (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-part-command-line-api-to-native
Patch Set: Created 4 years, 8 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 | « third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
index 2b94263b4be3e4a8b992a1c1fc6f544f725aebfb..ebedf0edb3570681cb99637714bb84a6690ec76e 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
@@ -295,14 +295,10 @@ void V8DebuggerImpl::breakProgram()
return;
v8::HandleScope scope(m_isolate);
- if (m_breakProgramCallbackTemplate.IsEmpty()) {
- v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(m_isolate);
- templ->SetCallHandler(&V8DebuggerImpl::breakProgramCallback, v8::External::New(m_isolate, this));
- m_breakProgramCallbackTemplate.Reset(m_isolate, templ);
- }
-
- v8::Local<v8::Function> breakProgramFunction = v8::Local<v8::FunctionTemplate>::New(m_isolate, m_breakProgramCallbackTemplate)->GetFunction();
- v8::Debug::Call(debuggerContext(), breakProgramFunction).ToLocalChecked();
+ v8::Local<v8::Function> breakFunction;
+ if (!v8::Function::New(m_isolate->GetCurrentContext(), &V8DebuggerImpl::breakProgramCallback, v8::External::New(m_isolate, this)).ToLocal(&breakFunction))
+ return;
+ v8::Debug::Call(debuggerContext(), breakFunction).ToLocalChecked();
}
void V8DebuggerImpl::continueProgram()
@@ -843,17 +839,4 @@ V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI
return contextGroupId ? m_sessions.get(contextGroupId) : nullptr;
}
-v8::MaybeLocal<v8::FunctionTemplate> V8DebuggerImpl::functionTemplate(const String16& name)
-{
- if (!m_templates.contains(name))
- return v8::MaybeLocal<v8::FunctionTemplate>();
- return m_templates.get(name)->Get(m_isolate);
-}
-
-void V8DebuggerImpl::setFunctionTemplate(const String16& name, v8::Local<v8::FunctionTemplate> functionTemplate)
-{
- OwnPtr<v8::Global<v8::FunctionTemplate>> global = adoptPtr(new v8::Global<v8::FunctionTemplate>(m_isolate, functionTemplate));
- m_templates.set(name, global.release());
-}
-
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698