Commit 321fe25d authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

[cleanup][inspector] Remove DISALLOW_COPY_AND_ASSIGN

Bug: v8:11074
Change-Id: I71fabf7628ec13440585c24381f5ba89e4df03d3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2543168Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71246}
parent f003f73b
......@@ -69,6 +69,8 @@ class InjectedScript final {
public:
InjectedScript(InspectedContext*, int sessionId);
~InjectedScript();
InjectedScript(const InjectedScript&) = delete;
InjectedScript& operator=(const InjectedScript&) = delete;
InspectedContext* context() const { return m_context; }
......@@ -175,18 +177,20 @@ class InjectedScript final {
public:
ContextScope(V8InspectorSessionImpl*, int executionContextId);
~ContextScope() override;
ContextScope(const ContextScope&) = delete;
ContextScope& operator=(const ContextScope&) = delete;
private:
Response findInjectedScript(V8InspectorSessionImpl*) override;
int m_executionContextId;
DISALLOW_COPY_AND_ASSIGN(ContextScope);
};
class ObjectScope : public Scope {
public:
ObjectScope(V8InspectorSessionImpl*, const String16& remoteObjectId);
~ObjectScope() override;
ObjectScope(const ObjectScope&) = delete;
ObjectScope& operator=(const ObjectScope&) = delete;
const String16& objectGroupName() const { return m_objectGroupName; }
v8::Local<v8::Value> object() const { return m_object; }
......@@ -195,22 +199,20 @@ class InjectedScript final {
String16 m_remoteObjectId;
String16 m_objectGroupName;
v8::Local<v8::Value> m_object;
DISALLOW_COPY_AND_ASSIGN(ObjectScope);
};
class CallFrameScope : public Scope {
public:
CallFrameScope(V8InspectorSessionImpl*, const String16& remoteCallFrameId);
~CallFrameScope() override;
CallFrameScope(const CallFrameScope&) = delete;
CallFrameScope& operator=(const CallFrameScope&) = delete;
size_t frameOrdinal() const { return m_frameOrdinal; }
private:
Response findInjectedScript(V8InspectorSessionImpl*) override;
String16 m_remoteCallFrameId;
size_t m_frameOrdinal;
DISALLOW_COPY_AND_ASSIGN(CallFrameScope);
};
String16 bindObject(v8::Local<v8::Value>, const String16& groupName);
......@@ -241,8 +243,6 @@ class InjectedScript final {
std::unordered_map<String16, std::vector<int>> m_nameToObjectGroup;
std::unordered_set<EvaluateCallback*> m_evaluateCallbacks;
bool m_customPreviewEnabled = false;
DISALLOW_COPY_AND_ASSIGN(InjectedScript);
};
} // namespace v8_inspector
......
......@@ -27,6 +27,8 @@ enum class V8InternalValueType { kNone, kEntry, kScope, kScopeList };
class InspectedContext {
public:
~InspectedContext();
InspectedContext(const InspectedContext&) = delete;
InspectedContext& operator=(const InspectedContext&) = delete;
static int contextId(v8::Local<v8::Context>);
......@@ -68,8 +70,6 @@ class InspectedContext {
std::unordered_map<int, std::unique_ptr<InjectedScript>> m_injectedScripts;
WeakCallbackData* m_weakCallbackData;
v8::Global<v8::debug::WeakMap> m_internalObjects;
DISALLOW_COPY_AND_ASSIGN(InspectedContext);
};
} // namespace v8_inspector
......
......@@ -21,6 +21,8 @@ class V8ConsoleAgentImpl : public protocol::Console::Backend {
V8ConsoleAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*,
protocol::DictionaryValue* state);
~V8ConsoleAgentImpl() override;
V8ConsoleAgentImpl(const V8ConsoleAgentImpl&) = delete;
V8ConsoleAgentImpl& operator=(const V8ConsoleAgentImpl&) = delete;
Response enable() override;
Response disable() override;
......@@ -39,8 +41,6 @@ class V8ConsoleAgentImpl : public protocol::Console::Backend {
protocol::DictionaryValue* m_state;
protocol::Console::Frontend m_frontend;
bool m_enabled;
DISALLOW_COPY_AND_ASSIGN(V8ConsoleAgentImpl);
};
} // namespace v8_inspector
......
......@@ -43,6 +43,9 @@ class ConsoleHelper {
m_contextId(InspectedContext::contextId(m_context)),
m_groupId(m_inspector->contextGroupId(m_contextId)) {}
ConsoleHelper(const ConsoleHelper&) = delete;
ConsoleHelper& operator=(const ConsoleHelper&) = delete;
int contextId() const { return m_contextId; }
int groupId() const { return m_groupId; }
......@@ -156,8 +159,6 @@ class ConsoleHelper {
V8InspectorImpl* m_inspector = nullptr;
int m_contextId;
int m_groupId;
DISALLOW_COPY_AND_ASSIGN(ConsoleHelper);
};
void returnDataCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
......
......@@ -30,6 +30,8 @@ class V8Console : public v8::debug::ConsoleDelegate {
v8::Local<v8::Object> commandLineAPI,
v8::Local<v8::Object> global);
~CommandLineAPIScope();
CommandLineAPIScope(const CommandLineAPIScope&) = delete;
CommandLineAPIScope& operator=(const CommandLineAPIScope&) = delete;
private:
static void accessorGetterCallback(
......@@ -43,8 +45,6 @@ class V8Console : public v8::debug::ConsoleDelegate {
v8::Local<v8::Object> m_global;
v8::Local<v8::Set> m_installedMethods;
v8::Local<v8::ArrayBuffer> m_thisReference;
DISALLOW_COPY_AND_ASSIGN(CommandLineAPIScope);
};
explicit V8Console(V8InspectorImpl* inspector);
......
......@@ -39,6 +39,8 @@ class V8DebuggerAgentImpl : public protocol::Debugger::Backend {
V8DebuggerAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*,
protocol::DictionaryValue* state);
~V8DebuggerAgentImpl() override;
V8DebuggerAgentImpl(const V8DebuggerAgentImpl&) = delete;
V8DebuggerAgentImpl& operator=(const V8DebuggerAgentImpl&) = delete;
void restore();
// Part of the protocol.
......@@ -244,8 +246,6 @@ class V8DebuggerAgentImpl : public protocol::Debugger::Backend {
std::unordered_map<String16, std::vector<std::pair<int, int>>>
m_blackboxedPositions;
std::unordered_map<String16, std::vector<std::pair<int, int>>> m_skipList;
DISALLOW_COPY_AND_ASSIGN(V8DebuggerAgentImpl);
};
} // namespace v8_inspector
......
......@@ -52,6 +52,8 @@ class V8DebuggerScript {
bool isLiveEdit, V8DebuggerAgentImpl* agent, V8InspectorClient* client);
virtual ~V8DebuggerScript();
V8DebuggerScript(const V8DebuggerScript&) = delete;
V8DebuggerScript& operator=(const V8DebuggerScript&) = delete;
const String16& scriptId() const { return m_id; }
bool hasSourceURLComment() const { return m_hasSourceURLComment; }
......@@ -111,9 +113,6 @@ class V8DebuggerScript {
v8::Isolate* m_isolate;
String16 m_embedderName;
private:
DISALLOW_COPY_AND_ASSIGN(V8DebuggerScript);
};
} // namespace v8_inspector
......
......@@ -66,6 +66,8 @@ class V8Debugger : public v8::debug::DebugDelegate,
public:
V8Debugger(v8::Isolate*, V8InspectorImpl*);
~V8Debugger() override;
V8Debugger(const V8Debugger&) = delete;
V8Debugger& operator=(const V8Debugger&) = delete;
bool enabled() const;
v8::Isolate* isolate() const { return m_isolate; }
......@@ -273,8 +275,6 @@ class V8Debugger : public v8::debug::DebugDelegate,
std::unordered_map<int, V8DebuggerId> m_contextGroupIdToDebuggerId;
std::unique_ptr<TerminateExecutionCallback> m_terminateExecutionCallback;
DISALLOW_COPY_AND_ASSIGN(V8Debugger);
};
} // namespace v8_inspector
......
......@@ -25,6 +25,8 @@ class V8HeapProfilerAgentImpl : public protocol::HeapProfiler::Backend {
V8HeapProfilerAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*,
protocol::DictionaryValue* state);
~V8HeapProfilerAgentImpl() override;
V8HeapProfilerAgentImpl(const V8HeapProfilerAgentImpl&) = delete;
V8HeapProfilerAgentImpl& operator=(const V8HeapProfilerAgentImpl&) = delete;
void restore();
void collectGarbage(
......@@ -70,8 +72,6 @@ class V8HeapProfilerAgentImpl : public protocol::HeapProfiler::Backend {
protocol::DictionaryValue* m_state;
bool m_hasTimer;
std::shared_ptr<AsyncGC> m_async_gc;
DISALLOW_COPY_AND_ASSIGN(V8HeapProfilerAgentImpl);
};
} // namespace v8_inspector
......
......@@ -59,6 +59,8 @@ class V8InspectorImpl : public V8Inspector {
public:
V8InspectorImpl(v8::Isolate*, V8InspectorClient*);
~V8InspectorImpl() override;
V8InspectorImpl(const V8InspectorImpl&) = delete;
V8InspectorImpl& operator=(const V8InspectorImpl&) = delete;
v8::Isolate* isolate() const { return m_isolate; }
V8InspectorClient* client() { return m_client; }
......@@ -179,8 +181,6 @@ class V8InspectorImpl : public V8Inspector {
std::unique_ptr<V8Console> m_console;
Counters* m_counters = nullptr;
DISALLOW_COPY_AND_ASSIGN(V8InspectorImpl);
};
} // namespace v8_inspector
......
......@@ -38,6 +38,8 @@ class V8InspectorSessionImpl : public V8InspectorSession,
V8Inspector::Channel*,
StringView state);
~V8InspectorSessionImpl() override;
V8InspectorSessionImpl(const V8InspectorSessionImpl&) = delete;
V8InspectorSessionImpl& operator=(const V8InspectorSessionImpl&) = delete;
V8InspectorImpl* inspector() const { return m_inspector; }
V8ConsoleAgentImpl* consoleAgent() { return m_consoleAgent.get(); }
......@@ -129,8 +131,6 @@ class V8InspectorSessionImpl : public V8InspectorSession,
std::vector<std::unique_ptr<V8InspectorSession::Inspectable>>
m_inspectedObjects;
bool use_binary_protocol_ = false;
DISALLOW_COPY_AND_ASSIGN(V8InspectorSessionImpl);
};
} // namespace v8_inspector
......
......@@ -29,6 +29,8 @@ class V8ProfilerAgentImpl : public protocol::Profiler::Backend {
V8ProfilerAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*,
protocol::DictionaryValue* state);
~V8ProfilerAgentImpl() override;
V8ProfilerAgentImpl(const V8ProfilerAgentImpl&) = delete;
V8ProfilerAgentImpl& operator=(const V8ProfilerAgentImpl&) = delete;
bool enabled() const { return m_enabled; }
void restore();
......@@ -95,8 +97,6 @@ class V8ProfilerAgentImpl : public protocol::Profiler::Backend {
int m_startedProfilesCount = 0;
std::shared_ptr<V8Inspector::Counters> m_counters;
bool m_runtime_call_stats_enabled = false;
DISALLOW_COPY_AND_ASSIGN(V8ProfilerAgentImpl);
};
} // namespace v8_inspector
......
......@@ -20,6 +20,8 @@ class V8Regex {
public:
V8Regex(V8InspectorImpl*, const String16&, bool caseSensitive,
bool multiline = false);
V8Regex(const V8Regex&) = delete;
V8Regex& operator=(const V8Regex&) = delete;
int match(const String16&, int startFrom = 0,
int* matchLength = nullptr) const;
bool isValid() const { return !m_regex.IsEmpty(); }
......@@ -29,8 +31,6 @@ class V8Regex {
V8InspectorImpl* m_inspector;
v8::Global<v8::RegExp> m_regex;
String16 m_errorMessage;
DISALLOW_COPY_AND_ASSIGN(V8Regex);
};
} // namespace v8_inspector
......
......@@ -57,6 +57,8 @@ class V8RuntimeAgentImpl : public protocol::Runtime::Backend {
V8RuntimeAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*,
protocol::DictionaryValue* state);
~V8RuntimeAgentImpl() override;
V8RuntimeAgentImpl(const V8RuntimeAgentImpl&) = delete;
V8RuntimeAgentImpl& operator=(const V8RuntimeAgentImpl&) = delete;
void restore();
// Part of the protocol.
......@@ -146,8 +148,6 @@ class V8RuntimeAgentImpl : public protocol::Runtime::Backend {
std::unordered_map<String16, std::unique_ptr<v8::Global<v8::Script>>>
m_compiledScripts;
std::set<String16> m_activeBindings;
DISALLOW_COPY_AND_ASSIGN(V8RuntimeAgentImpl);
};
} // namespace v8_inspector
......
......@@ -22,6 +22,8 @@ class V8SchemaAgentImpl : public protocol::Schema::Backend {
V8SchemaAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*,
protocol::DictionaryValue* state);
~V8SchemaAgentImpl() override;
V8SchemaAgentImpl(const V8SchemaAgentImpl&) = delete;
V8SchemaAgentImpl& operator=(const V8SchemaAgentImpl&) = delete;
Response getDomains(
std::unique_ptr<protocol::Array<protocol::Schema::Domain>>*) override;
......@@ -29,8 +31,6 @@ class V8SchemaAgentImpl : public protocol::Schema::Backend {
private:
V8InspectorSessionImpl* m_session;
protocol::Schema::Frontend m_frontend;
DISALLOW_COPY_AND_ASSIGN(V8SchemaAgentImpl);
};
} // namespace v8_inspector
......
......@@ -57,6 +57,8 @@ class V8StackTraceImpl : public V8StackTrace {
int maxStackSize);
~V8StackTraceImpl() override;
V8StackTraceImpl(const V8StackTraceImpl&) = delete;
V8StackTraceImpl& operator=(const V8StackTraceImpl&) = delete;
std::unique_ptr<protocol::Runtime::StackTrace> buildInspectorObjectImpl(
V8Debugger* debugger) const;
......@@ -105,12 +107,12 @@ class V8StackTraceImpl : public V8StackTrace {
int m_maxAsyncDepth;
std::weak_ptr<AsyncStackTrace> m_asyncParent;
V8StackTraceId m_externalParent;
DISALLOW_COPY_AND_ASSIGN(V8StackTraceImpl);
};
class AsyncStackTrace {
public:
AsyncStackTrace(const AsyncStackTrace&) = delete;
AsyncStackTrace& operator=(const AsyncStackTrace&) = delete;
static std::shared_ptr<AsyncStackTrace> capture(V8Debugger*,
int contextGroupId,
const String16& description,
......@@ -155,8 +157,6 @@ class AsyncStackTrace {
std::vector<std::shared_ptr<StackFrame>> m_frames;
std::weak_ptr<AsyncStackTrace> m_asyncParent;
V8StackTraceId m_externalParent;
DISALLOW_COPY_AND_ASSIGN(AsyncStackTrace);
};
} // namespace v8_inspector
......
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