Commit 9c702f4d authored by Florian Sattler's avatar Florian Sattler Committed by Commit Bot

[cleanup] Refactor inspector to use default members.

Fixing clang-tidy warning.

Bug: v8:8015
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I78bdf30b54a75fd96de0ca3d9243e1b55e9988ef
Reviewed-on: https://chromium-review.googlesource.com/1224090
Commit-Queue: Florian Sattler <sattlerf@google.com>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55984}
parent 1210d0c1
......@@ -62,7 +62,7 @@ class V8_EXPORT StringView {
class V8_EXPORT StringBuffer {
public:
virtual ~StringBuffer() {}
virtual ~StringBuffer() = default;
virtual const StringView& string() = 0;
// This method copies contents.
static std::unique_ptr<StringBuffer> create(const StringView&);
......@@ -107,7 +107,7 @@ class V8_EXPORT V8StackTrace {
virtual StringView topScriptId() const = 0;
virtual StringView topFunctionName() const = 0;
virtual ~V8StackTrace() {}
virtual ~V8StackTrace() = default;
virtual std::unique_ptr<protocol::Runtime::API::StackTrace>
buildInspectorObject() const = 0;
virtual std::unique_ptr<StringBuffer> toString() const = 0;
......@@ -118,13 +118,13 @@ class V8_EXPORT V8StackTrace {
class V8_EXPORT V8InspectorSession {
public:
virtual ~V8InspectorSession() {}
virtual ~V8InspectorSession() = default;
// Cross-context inspectable values (DOM nodes in different worlds, etc.).
class V8_EXPORT Inspectable {
public:
virtual v8::Local<v8::Value> get(v8::Local<v8::Context>) = 0;
virtual ~Inspectable() {}
virtual ~Inspectable() = default;
};
virtual void addInspectedObject(std::unique_ptr<Inspectable>) = 0;
......@@ -162,7 +162,7 @@ class V8_EXPORT V8InspectorSession {
class V8_EXPORT V8InspectorClient {
public:
virtual ~V8InspectorClient() {}
virtual ~V8InspectorClient() = default;
virtual void runMessageLoopOnPause(int contextGroupId) {}
virtual void quitMessageLoopOnPause() {}
......@@ -239,7 +239,7 @@ struct V8_EXPORT V8StackTraceId {
class V8_EXPORT V8Inspector {
public:
static std::unique_ptr<V8Inspector> create(v8::Isolate*, V8InspectorClient*);
virtual ~V8Inspector() {}
virtual ~V8Inspector() = default;
// Contexts instrumentation.
virtual void contextCreated(const V8ContextInfo&) = 0;
......@@ -277,7 +277,7 @@ class V8_EXPORT V8Inspector {
// Connection.
class V8_EXPORT Channel {
public:
virtual ~Channel() {}
virtual ~Channel() = default;
virtual void sendResponse(int callId,
std::unique_ptr<StringBuffer> message) = 0;
virtual void sendNotification(std::unique_ptr<StringBuffer> message) = 0;
......
......@@ -738,7 +738,7 @@ InjectedScript::ContextScope::ContextScope(V8InspectorSessionImpl* session,
: InjectedScript::Scope(session),
m_executionContextId(executionContextId) {}
InjectedScript::ContextScope::~ContextScope() {}
InjectedScript::ContextScope::~ContextScope() = default;
Response InjectedScript::ContextScope::findInjectedScript(
V8InspectorSessionImpl* session) {
......@@ -749,7 +749,7 @@ InjectedScript::ObjectScope::ObjectScope(V8InspectorSessionImpl* session,
const String16& remoteObjectId)
: InjectedScript::Scope(session), m_remoteObjectId(remoteObjectId) {}
InjectedScript::ObjectScope::~ObjectScope() {}
InjectedScript::ObjectScope::~ObjectScope() = default;
Response InjectedScript::ObjectScope::findInjectedScript(
V8InspectorSessionImpl* session) {
......@@ -770,7 +770,7 @@ InjectedScript::CallFrameScope::CallFrameScope(V8InspectorSessionImpl* session,
const String16& remoteObjectId)
: InjectedScript::Scope(session), m_remoteCallFrameId(remoteObjectId) {}
InjectedScript::CallFrameScope::~CallFrameScope() {}
InjectedScript::CallFrameScope::~CallFrameScope() = default;
Response InjectedScript::CallFrameScope::findInjectedScript(
V8InspectorSessionImpl* session) {
......
......@@ -60,7 +60,7 @@ class EvaluateCallback {
protocol::Maybe<protocol::Runtime::ExceptionDetails>
exceptionDetails) = 0;
virtual void sendFailure(const protocol::DispatchResponse& response) = 0;
virtual ~EvaluateCallback() {}
virtual ~EvaluateCallback() = default;
};
class InjectedScript final {
......
......@@ -17,7 +17,7 @@ class RemoteObjectIdBase {
protected:
RemoteObjectIdBase();
~RemoteObjectIdBase() {}
~RemoteObjectIdBase() = default;
std::unique_ptr<protocol::DictionaryValue> parseInjectedScriptId(
const String16&);
......@@ -28,7 +28,7 @@ class RemoteObjectIdBase {
class RemoteObjectId final : public RemoteObjectIdBase {
public:
static Response parse(const String16&, std::unique_ptr<RemoteObjectId>*);
~RemoteObjectId() {}
~RemoteObjectId() = default;
int id() const { return m_id; }
private:
......@@ -40,7 +40,7 @@ class RemoteObjectId final : public RemoteObjectIdBase {
class RemoteCallFrameId final : public RemoteObjectIdBase {
public:
static Response parse(const String16&, std::unique_ptr<RemoteCallFrameId>*);
~RemoteCallFrameId() {}
~RemoteCallFrameId() = default;
int frameOrdinal() const { return m_frameOrdinal; }
......
......@@ -370,10 +370,9 @@ static inline void putUTF8Triple(char*& buffer, UChar ch) {
} // namespace
String16::String16() {}
String16::String16() = default;
String16::String16(const String16& other)
: m_impl(other.m_impl), hash_code(other.hash_code) {}
String16::String16(const String16& other) = default;
String16::String16(String16&& other) V8_NOEXCEPT
: m_impl(std::move(other.m_impl)),
......@@ -394,11 +393,7 @@ String16::String16(const char* characters, size_t size) {
String16::String16(const std::basic_string<UChar>& impl) : m_impl(impl) {}
String16& String16::operator=(const String16& other) {
m_impl = other.m_impl;
hash_code = other.hash_code;
return *this;
}
String16& String16::operator=(const String16& other) = default;
String16& String16::operator=(String16&& other) V8_NOEXCEPT {
m_impl = std::move(other.m_impl);
......@@ -471,7 +466,7 @@ String16 String16::stripWhiteSpace() const {
return String16(characters16() + start, end + 1 - start);
}
String16Builder::String16Builder() {}
String16Builder::String16Builder() = default;
void String16Builder::append(const String16& s) {
m_buffer.insert(m_buffer.end(), s.characters16(),
......
......@@ -24,7 +24,7 @@ V8ConsoleAgentImpl::V8ConsoleAgentImpl(
m_frontend(frontendChannel),
m_enabled(false) {}
V8ConsoleAgentImpl::~V8ConsoleAgentImpl() {}
V8ConsoleAgentImpl::~V8ConsoleAgentImpl() = default;
Response V8ConsoleAgentImpl::enable() {
if (m_enabled) return Response::OK();
......
......@@ -203,7 +203,7 @@ V8ConsoleMessage::V8ConsoleMessage(V8MessageOrigin origin, double timestamp,
m_exceptionId(0),
m_revokedExceptionId(0) {}
V8ConsoleMessage::~V8ConsoleMessage() {}
V8ConsoleMessage::~V8ConsoleMessage() = default;
void V8ConsoleMessage::setLocation(const String16& url, unsigned lineNumber,
unsigned columnNumber,
......
......@@ -316,7 +316,7 @@ V8DebuggerAgentImpl::V8DebuggerAgentImpl(
m_frontend(frontendChannel),
m_isolate(m_inspector->isolate()) {}
V8DebuggerAgentImpl::~V8DebuggerAgentImpl() {}
V8DebuggerAgentImpl::~V8DebuggerAgentImpl() = default;
void V8DebuggerAgentImpl::enableImpl() {
m_enabled = true;
......
......@@ -454,7 +454,7 @@ V8DebuggerScript::V8DebuggerScript(v8::Isolate* isolate, String16 id,
String16 url)
: m_id(std::move(id)), m_url(std::move(url)), m_isolate(isolate) {}
V8DebuggerScript::~V8DebuggerScript() {}
V8DebuggerScript::~V8DebuggerScript() = default;
void V8DebuggerScript::setSourceURL(const String16& sourceURL) {
if (sourceURL.length() > 0) {
......
......@@ -153,7 +153,7 @@ V8HeapProfilerAgentImpl::V8HeapProfilerAgentImpl(
m_state(state),
m_hasTimer(false) {}
V8HeapProfilerAgentImpl::~V8HeapProfilerAgentImpl() {}
V8HeapProfilerAgentImpl::~V8HeapProfilerAgentImpl() = default;
void V8HeapProfilerAgentImpl::restore() {
if (m_state->booleanProperty(HeapProfilerAgentState::heapProfilerEnabled,
......
......@@ -226,7 +226,7 @@ V8RuntimeAgentImpl::V8RuntimeAgentImpl(
m_inspector(session->inspector()),
m_enabled(false) {}
V8RuntimeAgentImpl::~V8RuntimeAgentImpl() {}
V8RuntimeAgentImpl::~V8RuntimeAgentImpl() = default;
void V8RuntimeAgentImpl::evaluate(
const String16& expression, Maybe<String16> objectGroup,
......
......@@ -14,7 +14,7 @@ V8SchemaAgentImpl::V8SchemaAgentImpl(V8InspectorSessionImpl* session,
protocol::DictionaryValue* state)
: m_session(session), m_frontend(frontendChannel) {}
V8SchemaAgentImpl::~V8SchemaAgentImpl() {}
V8SchemaAgentImpl::~V8SchemaAgentImpl() = default;
Response V8SchemaAgentImpl::getDomains(
std::unique_ptr<protocol::Array<protocol::Schema::Domain>>* result) {
......
......@@ -226,7 +226,7 @@ V8StackTraceImpl::V8StackTraceImpl(
m_asyncParent(std::move(asyncParent)),
m_externalParent(externalParent) {}
V8StackTraceImpl::~V8StackTraceImpl() {}
V8StackTraceImpl::~V8StackTraceImpl() = default;
std::unique_ptr<V8StackTrace> V8StackTraceImpl::clone() {
return std::unique_ptr<V8StackTrace>(new V8StackTraceImpl(
......
......@@ -74,7 +74,7 @@ class WasmTranslation::TranslatorImpl {
int index) = 0;
virtual const String16 GetHash(v8::Isolate*, int index) = 0;
virtual ~TranslatorImpl() {}
virtual ~TranslatorImpl() = default;
class RawTranslator;
class DisassemblingTranslator;
......
......@@ -20,7 +20,7 @@ namespace {
class NoopChannel : public V8Inspector::Channel {
public:
~NoopChannel() override {}
~NoopChannel() override = default;
void sendResponse(int callId,
std::unique_ptr<StringBuffer> message) override {}
void sendNotification(std::unique_ptr<StringBuffer> message) override {}
......
......@@ -109,7 +109,7 @@ class FrontendChannelImpl : public v8_inspector::V8Inspector::Channel {
SendMessageTask(FrontendChannelImpl* channel,
const std::vector<uint16_t>& message)
: channel_(channel), message_(message) {}
~SendMessageTask() override {}
~SendMessageTask() override = default;
bool is_priority_task() final { return false; }
private:
......@@ -216,7 +216,7 @@ class ExecuteStringTask : public TaskRunner::Task {
ExecuteStringTask(const std::string& expression, int context_group_id)
: expression_utf8_(expression), context_group_id_(context_group_id) {}
~ExecuteStringTask() override {}
~ExecuteStringTask() override = default;
bool is_priority_task() override { return false; }
void Run(IsolateData* data) override {
v8::MicrotasksScope microtasks_scope(data->isolate(),
......@@ -594,7 +594,7 @@ class SetTimeoutTask : public TaskRunner::Task {
SetTimeoutTask(int context_group_id, v8::Isolate* isolate,
v8::Local<v8::Function> function)
: function_(isolate, function), context_group_id_(context_group_id) {}
~SetTimeoutTask() override {}
~SetTimeoutTask() override = default;
bool is_priority_task() final { return false; }
private:
......
......@@ -44,7 +44,7 @@ class Inspectable : public v8_inspector::V8InspectorSession::Inspectable {
public:
Inspectable(v8::Isolate* isolate, v8::Local<v8::Value> object)
: object_(isolate, object) {}
~Inspectable() override {}
~Inspectable() override = default;
v8::Local<v8::Value> get(v8::Local<v8::Context> context) override {
return object_.Get(context->GetIsolate());
}
......
......@@ -20,7 +20,7 @@ class TaskRunner : public v8::base::Thread {
public:
class Task {
public:
virtual ~Task() {}
virtual ~Task() = default;
virtual bool is_priority_task() = 0;
virtual void Run(IsolateData* data) = 0;
};
......
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