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

Unified Diff: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp

Issue 1859293002: [DevTools] Move Console to v8_inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added missing tests 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
Index: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
diff --git a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
index 1263f5c57531c3cddbb564157202b0ad4d27102f..d2620bf6ef0b1a78b8e9fd592cb2988d8a08adeb 100644
--- a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
@@ -42,6 +42,7 @@
#include "core/inspector/IdentifiersFactory.h"
#include "core/inspector/InspectedFrames.h"
#include "core/inspector/InspectorTaskRunner.h"
+#include "core/timing/MemoryInfo.h"
#include "core/workers/MainThreadWorkletGlobalScope.h"
#include "platform/UserGestureIndicator.h"
#include "platform/v8_inspector/public/V8Debugger.h"
@@ -103,7 +104,8 @@ void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* fr
DOMWrapperWorld& world = scriptState->world();
if (frame->localFrameRoot() == frame && world.isMainWorld())
debugger()->resetContextGroup(contextGroupId(frame));
- debugger()->contextCreated(V8ContextInfo(scriptState->context(), contextGroupId(frame), world.isMainWorld(), origin ? origin->toRawString() : "", world.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFactory::frameId(frame)));
+ ExecutionContext* executionContext = scriptState->getExecutionContext();
+ debugger()->contextCreated(V8ContextInfo(scriptState->context(), contextGroupId(frame), world.isMainWorld(), origin ? origin->toRawString() : "", world.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFactory::frameId(frame), executionContext->isDocument()));
dgozman 2016/04/12 03:32:15 Inline it!
kozy 2016/04/12 21:58:31 Done.
}
void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState)
@@ -204,4 +206,32 @@ int MainThreadDebugger::ensureDefaultContextInGroup(int contextGroupId)
return V8Debugger::contextId(scriptState->context());
}
+void MainThreadDebugger::reportMessageToConsole(v8::Local<v8::Context> context, ConsoleMessage* consoleMessage)
+{
+ ExecutionContext* executionContext = toExecutionContext(context);
+ ASSERT(executionContext);
+ if (executionContext->isWorkletGlobalScope()) {
+ executionContext->addConsoleMessage(consoleMessage);
+ return;
+ }
+
+ DOMWindow* window = toDOMWindow(context);
+ if (!window)
+ return;
+ LocalDOMWindow* localDomWindow = toLocalDOMWindow(window);
+ if (!localDomWindow)
+ return;
+ LocalFrame* frame = localDomWindow->frame();
+ if (!frame)
+ return;
+ frame->console().addMessage(consoleMessage);
+}
+
+v8::MaybeLocal<v8::Value> MainThreadDebugger::memoryInfo(v8::Isolate* isolate, v8::Local<v8::Context> context, v8::Local<v8::Object> creationContext)
+{
+ ExecutionContext* executionContext = toExecutionContext(context);
+ ASSERT(executionContext);
+ return executionContext->isDocument() ? toV8(MemoryInfo::create(), creationContext, isolate) : v8::MaybeLocal<v8::Value>();
dgozman 2016/04/12 03:32:15 ASSERT(executionContext->isDocument())
kozy 2016/04/12 21:58:32 Done.
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698