Commit 5b306f72 authored by kozyatinskiy's avatar kozyatinskiy Committed by Commit bot

Revert of [inspector] convert V8Console static methods into members (patchset...

Revert of [inspector] convert V8Console static methods into members (patchset #2 id:20001 of https://codereview.chromium.org/2783073002/ )

Reason for revert:
Too many simulatenously landed CLs, this one should be rebased first.

Original issue's description:
> [inspector] convert V8Console static methods into members
>
> This step is required to implement console as builtin which calls console delegate methods.
>
> BUG=v8:6168
> R=dgozman@chromium.org
>
> Review-Url: https://codereview.chromium.org/2783073002
> Cr-Commit-Position: refs/heads/master@{#44283}
> Committed: https://chromium.googlesource.com/v8/v8/+/fe27dccd873024213b16d1e9810dda6a6c705571

TBR=dgozman@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:6168

Review-Url: https://codereview.chromium.org/2793443002
Cr-Commit-Position: refs/heads/master@{#44284}
parent fe27dccd
......@@ -406,12 +406,9 @@ Response InjectedScript::wrapEvaluateResult(
}
v8::Local<v8::Object> InjectedScript::commandLineAPI() {
if (m_commandLineAPI.IsEmpty()) {
m_commandLineAPI.Reset(
m_context->isolate(),
m_context->inspector()->console()->createCommandLineAPI(
m_context->context()));
}
if (m_commandLineAPI.IsEmpty())
m_commandLineAPI.Reset(m_context->isolate(),
V8Console::createCommandLineAPI(m_context));
return m_commandLineAPI.Get(m_context->isolate());
}
......
......@@ -28,10 +28,9 @@ InspectedContext::InspectedContext(V8InspectorImpl* inspector,
info.context->SetEmbedderData(static_cast<int>(v8::Context::kDebugIdIndex),
v8::Int32::New(isolate, contextId));
v8::Local<v8::Object> global = info.context->Global();
v8::Local<v8::Object> console =
m_inspector->console()->createConsole(info.context);
v8::Local<v8::Object> console = V8Console::createConsole(this);
if (info.hasMemoryOnConsole) {
m_inspector->console()->installMemoryGetter(info.context, console);
V8Console::installMemoryGetter(m_inspector, info.context, console);
}
if (!global
->Set(info.context, toV8StringInternalized(isolate, "console"),
......
This diff is collapsed.
......@@ -18,9 +18,10 @@ class V8InspectorImpl;
// https://console.spec.whatwg.org/#console-interface
class V8Console {
public:
v8::Local<v8::Object> createConsole(v8::Local<v8::Context> context);
v8::Local<v8::Object> createCommandLineAPI(v8::Local<v8::Context> context);
void installMemoryGetter(v8::Local<v8::Context> context,
static v8::Local<v8::Object> createConsole(InspectedContext*);
static v8::Local<v8::Object> createCommandLineAPI(InspectedContext*);
static void installMemoryGetter(V8InspectorImpl* inspector,
v8::Local<v8::Context> context,
v8::Local<v8::Object> console);
class CommandLineAPIScope {
......@@ -46,74 +47,72 @@ class V8Console {
DISALLOW_COPY_AND_ASSIGN(CommandLineAPIScope);
};
explicit V8Console(V8InspectorImpl* inspector);
private:
void debugCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void errorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void infoCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void logCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void warnCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void dirCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void dirxmlCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void tableCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void traceCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void groupCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void groupCollapsedCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void groupEndCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void clearCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void countCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void assertCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void markTimelineCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void profileCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void profileEndCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void timelineCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void timelineEndCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void timeCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void timeEndCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void timeStampCallback(const v8::FunctionCallbackInfo<v8::Value>&);
template <void (V8Console::*func)(const v8::FunctionCallbackInfo<v8::Value>&)>
static void call(const v8::FunctionCallbackInfo<v8::Value>& info) {
V8Console* console =
static_cast<V8Console*>(info.Data().As<v8::External>()->Value());
(console->*func)(info);
}
static void debugCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void errorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void infoCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void logCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void warnCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void dirCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void dirxmlCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void tableCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void traceCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void groupCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void groupCollapsedCallback(
const v8::FunctionCallbackInfo<v8::Value>&);
static void groupEndCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void clearCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void countCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void assertCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void markTimelineCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void profileCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void profileEndCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void timelineCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void timelineEndCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void timeCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void timeEndCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void timeStampCallback(const v8::FunctionCallbackInfo<v8::Value>&);
// TODO(foolip): There is no spec for the Memory Info API, see blink-dev:
// https://groups.google.com/a/chromium.org/d/msg/blink-dev/g5YRCGpC9vs/b4OJz71NmPwJ
void memoryGetterCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void memorySetterCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void memoryGetterCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void memorySetterCallback(const v8::FunctionCallbackInfo<v8::Value>&);
// CommandLineAPI
void keysCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void valuesCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void debugFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void undebugFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void monitorFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void unmonitorFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void lastEvaluationResultCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void inspectCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void copyCallback(const v8::FunctionCallbackInfo<v8::Value>&);
void inspectedObject(const v8::FunctionCallbackInfo<v8::Value>&,
static void keysCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void valuesCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void debugFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void undebugFunctionCallback(
const v8::FunctionCallbackInfo<v8::Value>&);
static void monitorFunctionCallback(
const v8::FunctionCallbackInfo<v8::Value>&);
static void unmonitorFunctionCallback(
const v8::FunctionCallbackInfo<v8::Value>&);
static void lastEvaluationResultCallback(
const v8::FunctionCallbackInfo<v8::Value>&);
static void inspectCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void copyCallback(const v8::FunctionCallbackInfo<v8::Value>&);
static void inspectedObject(const v8::FunctionCallbackInfo<v8::Value>&,
unsigned num);
void inspectedObject0(const v8::FunctionCallbackInfo<v8::Value>& info) {
static void inspectedObject0(
const v8::FunctionCallbackInfo<v8::Value>& info) {
inspectedObject(info, 0);
}
void inspectedObject1(const v8::FunctionCallbackInfo<v8::Value>& info) {
static void inspectedObject1(
const v8::FunctionCallbackInfo<v8::Value>& info) {
inspectedObject(info, 1);
}
void inspectedObject2(const v8::FunctionCallbackInfo<v8::Value>& info) {
static void inspectedObject2(
const v8::FunctionCallbackInfo<v8::Value>& info) {
inspectedObject(info, 2);
}
void inspectedObject3(const v8::FunctionCallbackInfo<v8::Value>& info) {
static void inspectedObject3(
const v8::FunctionCallbackInfo<v8::Value>& info) {
inspectedObject(info, 3);
}
void inspectedObject4(const v8::FunctionCallbackInfo<v8::Value>& info) {
static void inspectedObject4(
const v8::FunctionCallbackInfo<v8::Value>& info) {
inspectedObject(info, 4);
}
V8InspectorImpl* m_inspector;
};
} // namespace v8_inspector
......
......@@ -34,7 +34,6 @@
#include "src/inspector/string-util.h"
#include "src/inspector/v8-console-agent-impl.h"
#include "src/inspector/v8-console-message.h"
#include "src/inspector/v8-console.h"
#include "src/inspector/v8-debugger-agent-impl.h"
#include "src/inspector/v8-debugger.h"
#include "src/inspector/v8-inspector-session-impl.h"
......@@ -336,9 +335,4 @@ V8InspectorSessionImpl* V8InspectorImpl::sessionForContextGroup(
return iter == m_sessions.end() ? nullptr : iter->second;
}
V8Console* V8InspectorImpl::console() {
if (!m_console) m_console.reset(new V8Console(this));
return m_console.get();
}
} // namespace v8_inspector
......@@ -41,7 +41,6 @@
namespace v8_inspector {
class InspectedContext;
class V8Console;
class V8ConsoleMessageStorage;
class V8Debugger;
class V8DebuggerAgentImpl;
......@@ -112,7 +111,6 @@ class V8InspectorImpl : public V8Inspector {
V8DebuggerAgentImpl* enabledDebuggerAgentForGroup(int contextGroupId);
V8RuntimeAgentImpl* enabledRuntimeAgentForGroup(int contextGroupId);
V8ProfilerAgentImpl* enabledProfilerAgentForGroup(int contextGroupId);
V8Console* console();
private:
v8::Isolate* m_isolate;
......@@ -139,8 +137,6 @@ class V8InspectorImpl : public V8Inspector {
protocol::HashMap<int, int> m_contextIdToGroupIdMap;
std::unique_ptr<V8Console> m_console;
DISALLOW_COPY_AND_ASSIGN(V8InspectorImpl);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment