Commit 1ed86c9e authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

[cleanup][debug] Remove DISALLOW_COPY_AND_ASSIGN

Bug: v8:11074
Change-Id: Ifd47a3256ec23d2c62ff7bbaf4de226fdfd3f68d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2546123Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71249}
parent da888fed
......@@ -22,6 +22,8 @@ class WasmFrame;
class FrameInspector {
public:
FrameInspector(CommonFrame* frame, int inlined_frame_index, Isolate* isolate);
FrameInspector(const FrameInspector&) = delete;
FrameInspector& operator=(const FrameInspector&) = delete;
~FrameInspector();
......@@ -60,8 +62,6 @@ class FrameInspector {
bool is_interpreted_ = false;
bool has_adapted_arguments_ = false;
bool is_constructor_ = false;
DISALLOW_COPY_AND_ASSIGN(FrameInspector);
};
class RedirectActiveFunctions : public ThreadVisitor {
......
......@@ -423,6 +423,8 @@ class V8_EXPORT_PRIVATE ScopeIterator {
ScopeIterator() = default;
virtual ~ScopeIterator() = default;
ScopeIterator(const ScopeIterator&) = delete;
ScopeIterator& operator=(const ScopeIterator&) = delete;
enum ScopeType {
ScopeTypeGlobal = 0,
......@@ -449,9 +451,6 @@ class V8_EXPORT_PRIVATE ScopeIterator {
virtual bool SetVariableValue(v8::Local<v8::String> name,
v8::Local<v8::Value> value) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(ScopeIterator);
};
class V8_EXPORT_PRIVATE StackTraceIterator {
......@@ -461,6 +460,8 @@ class V8_EXPORT_PRIVATE StackTraceIterator {
int index = 0);
StackTraceIterator() = default;
virtual ~StackTraceIterator() = default;
StackTraceIterator(const StackTraceIterator&) = delete;
StackTraceIterator& operator=(const StackTraceIterator&) = delete;
virtual bool Done() const = 0;
virtual void Advance() = 0;
......@@ -479,9 +480,6 @@ class V8_EXPORT_PRIVATE StackTraceIterator {
bool throw_on_side_effect) = 0;
virtual v8::MaybeLocal<v8::String> EvaluateWasm(
internal::Vector<const internal::byte> source, int frame_index) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(StackTraceIterator);
};
class QueryObjectPredicate {
......
......@@ -21,6 +21,8 @@ class DebugPropertyIterator final : public debug::PropertyIterator {
public:
DebugPropertyIterator(Isolate* isolate, Handle<JSReceiver> receiver);
~DebugPropertyIterator() override = default;
DebugPropertyIterator(const DebugPropertyIterator&) = delete;
DebugPropertyIterator& operator=(const DebugPropertyIterator&) = delete;
bool Done() const override;
void Advance() override;
......@@ -53,8 +55,6 @@ class DebugPropertyIterator final : public debug::PropertyIterator {
bool calculated_native_accessor_flags_ = false;
int native_accessor_flags_ = 0;
bool is_own_ = true;
DISALLOW_COPY_AND_ASSIGN(DebugPropertyIterator);
};
} // namespace internal
} // namespace v8
......
......@@ -47,6 +47,8 @@ class Debug::TemporaryObjectsTracker : public HeapObjectAllocationTracker {
public:
TemporaryObjectsTracker() = default;
~TemporaryObjectsTracker() override = default;
TemporaryObjectsTracker(const TemporaryObjectsTracker&) = delete;
TemporaryObjectsTracker& operator=(const TemporaryObjectsTracker&) = delete;
void AllocationEvent(Address addr, int) override { objects_.insert(addr); }
......@@ -80,7 +82,6 @@ class Debug::TemporaryObjectsTracker : public HeapObjectAllocationTracker {
private:
std::unordered_set<Address> objects_;
base::Mutex mutex_;
DISALLOW_COPY_AND_ASSIGN(TemporaryObjectsTracker);
};
Debug::Debug(Isolate* isolate)
......
......@@ -129,6 +129,8 @@ class BreakLocation {
class V8_EXPORT_PRIVATE BreakIterator {
public:
explicit BreakIterator(Handle<DebugInfo> debug_info);
BreakIterator(const BreakIterator&) = delete;
BreakIterator& operator=(const BreakIterator&) = delete;
BreakLocation GetBreakLocation();
bool Done() const { return source_position_iterator_.done(); }
......@@ -160,8 +162,6 @@ class V8_EXPORT_PRIVATE BreakIterator {
int statement_position_;
SourcePositionTableIterator source_position_iterator_;
DisallowHeapAllocation no_gc_;
DISALLOW_COPY_AND_ASSIGN(BreakIterator);
};
// Linked list holding debug info objects. The debug info objects are kept as
......@@ -214,6 +214,9 @@ class DebugFeatureTracker {
// DebugInfo.
class V8_EXPORT_PRIVATE Debug {
public:
Debug(const Debug&) = delete;
Debug& operator=(const Debug&) = delete;
// Debug event triggers.
void OnDebugBreak(Handle<FixedArray> break_points_hit, StepAction stepAction);
......@@ -566,8 +569,6 @@ class V8_EXPORT_PRIVATE Debug {
friend Handle<FixedArray> GetDebuggedFunctions(); // In test-debug.cc
friend void CheckDebuggerUnloaded(); // In test-debug.cc
DISALLOW_COPY_AND_ASSIGN(Debug);
};
// This scope is used to load and enter the debug context and create a new
......@@ -614,11 +615,12 @@ class DisableBreak {
~DisableBreak() {
debug_->break_disabled_ = previous_break_disabled_;
}
DisableBreak(const DisableBreak&) = delete;
DisableBreak& operator=(const DisableBreak&) = delete;
private:
Debug* debug_;
bool previous_break_disabled_;
DISALLOW_COPY_AND_ASSIGN(DisableBreak);
};
class SuppressDebug {
......@@ -628,11 +630,12 @@ class SuppressDebug {
debug_->is_suppressed_ = true;
}
~SuppressDebug() { debug_->is_suppressed_ = old_state_; }
SuppressDebug(const SuppressDebug&) = delete;
SuppressDebug& operator=(const SuppressDebug&) = delete;
private:
Debug* debug_;
bool old_state_;
DISALLOW_COPY_AND_ASSIGN(SuppressDebug);
};
// Code generator routines.
......
......@@ -22,6 +22,8 @@ class GdbServer;
class GdbServerThread : public v8::base::Thread {
public:
explicit GdbServerThread(GdbServer* gdb_server);
GdbServerThread(const GdbServerThread&) = delete;
GdbServerThread& operator=(const GdbServerThread&) = delete;
// base::Thread
void Run() override;
......@@ -51,8 +53,6 @@ class GdbServerThread : public v8::base::Thread {
// Protected by {mutex_}:
std::unique_ptr<TransportBase> transport_;
std::unique_ptr<Target> target_;
DISALLOW_COPY_AND_ASSIGN(GdbServerThread);
};
} // namespace gdb_server
......
......@@ -51,6 +51,9 @@ class TaskRunner {
nested_loop_count_(0),
is_terminated_(false) {}
TaskRunner(const TaskRunner&) = delete;
TaskRunner& operator=(const TaskRunner&) = delete;
// Starts the task runner. All tasks posted are run, in order, in the thread
// that calls this function.
void Run() {
......@@ -100,8 +103,6 @@ class TaskRunner {
v8::base::Semaphore process_queue_semaphore_;
int nested_loop_count_;
std::atomic<bool> is_terminated_;
DISALLOW_COPY_AND_ASSIGN(TaskRunner);
};
GdbServer::GdbServer() { task_runner_ = std::make_unique<TaskRunner>(); }
......
......@@ -24,6 +24,9 @@ class TaskRunner;
// the Wasm engine.
class GdbServer {
public:
GdbServer(const GdbServer&) = delete;
GdbServer& operator=(const GdbServer&) = delete;
// Factory method: creates and returns a GdbServer. Spawns a "GDB-remote"
// thread that will be used to communicate with the debugger.
// May return null on failure.
......@@ -189,8 +192,6 @@ class GdbServer {
// End of fields always accessed in the isolate thread.
//////////////////////////////////////////////////////////////////////////////
DISALLOW_COPY_AND_ASSIGN(GdbServer);
};
} // namespace gdb_server
......
......@@ -19,6 +19,8 @@ class TransportBase;
class V8_EXPORT_PRIVATE Session {
public:
explicit Session(TransportBase* transport);
Session(const Session&) = delete;
Session& operator=(const Session&) = delete;
// Attempt to send a packet and optionally wait for an ACK from the receiver.
bool SendPacket(Packet* packet, bool expect_ack = true);
......@@ -61,8 +63,6 @@ class V8_EXPORT_PRIVATE Session {
TransportBase* io_; // Transport object not owned by the Session.
bool connected_; // Is the connection still valid.
bool ack_enabled_; // If true, emit or wait for '+' from RSP stream.
DISALLOW_COPY_AND_ASSIGN(Session);
};
} // namespace gdb_server
......
......@@ -26,6 +26,8 @@ class Target {
public:
// Contruct a Target object.
explicit Target(GdbServer* gdb_server);
Target(const Target&) = delete;
Target& operator=(const Target&) = delete;
// This function spin on a debugging session, until it closes.
void Run(Session* ses);
......@@ -128,8 +130,6 @@ class Target {
// End of fields protected by {mutex_}.
//////////////////////////////////////////////////////////////////////////////
DISALLOW_COPY_AND_ASSIGN(Target);
};
} // namespace gdb_server
......
......@@ -146,6 +146,8 @@ class SocketTransport : public Transport {
public:
explicit SocketTransport(SocketHandle s);
~SocketTransport() override;
SocketTransport(const SocketTransport&) = delete;
SocketTransport& operator=(const SocketTransport&) = delete;
// TransportBase
bool AcceptConnection() override;
......@@ -158,8 +160,6 @@ class SocketTransport : public Transport {
HANDLE socket_event_;
HANDLE faulted_thread_event_;
DISALLOW_COPY_AND_ASSIGN(SocketTransport);
};
#else // _WIN32
......@@ -168,6 +168,8 @@ class SocketTransport : public Transport {
public:
explicit SocketTransport(SocketHandle s);
~SocketTransport() override;
SocketTransport(const SocketTransport&) = delete;
SocketTransport& operator=(const SocketTransport&) = delete;
// TransportBase
bool AcceptConnection() override;
......@@ -179,8 +181,6 @@ class SocketTransport : public Transport {
int faulted_thread_fd_read_;
int faulted_thread_fd_write_;
DISALLOW_COPY_AND_ASSIGN(SocketTransport);
};
#endif // _WIN32
......
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