Commit adfc9541 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[d8][cleanup] Remove uses of DISALLOW_COPY_AND_ASSIGN

Replace by explicitly deleting the copy constructor and copy assignment
operator.

R=zhin@chromium.org

Bug: v8:11074
Change-Id: Ifbfaad91d555649f586f37c251c6f4c378dcba46
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2523317Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71118}
parent ca0613c1
......@@ -23,6 +23,9 @@ class PredictablePlatform final : public Platform {
DCHECK_NOT_NULL(platform_);
}
PredictablePlatform(const PredictablePlatform&) = delete;
PredictablePlatform& operator=(const PredictablePlatform&) = delete;
PageAllocator* GetPageAllocator() override {
return platform_->GetPageAllocator();
}
......@@ -85,8 +88,6 @@ class PredictablePlatform final : public Platform {
private:
double synthetic_time_in_sec_ = 0.0;
std::unique_ptr<Platform> platform_;
DISALLOW_COPY_AND_ASSIGN(PredictablePlatform);
};
std::unique_ptr<Platform> MakePredictablePlatform(
......@@ -107,6 +108,9 @@ class DelayedTasksPlatform final : public Platform {
DCHECK_NOT_NULL(platform_);
}
DelayedTasksPlatform(const DelayedTasksPlatform&) = delete;
DelayedTasksPlatform& operator=(const DelayedTasksPlatform&) = delete;
~DelayedTasksPlatform() override {
// When the platform shuts down, all task runners must be freed.
DCHECK_EQ(0, delayed_task_runners_.size());
......@@ -318,8 +322,6 @@ class DelayedTasksPlatform final : public Platform {
return std::make_unique<DelayedJob>(std::move(task),
GetRandomDelayInMilliseconds());
}
DISALLOW_COPY_AND_ASSIGN(DelayedTasksPlatform);
};
std::unique_ptr<Platform> MakeDelayedTasksPlatform(
......
......@@ -3762,6 +3762,9 @@ class Serializer : public ValueSerializer::Delegate {
serializer_(isolate, this),
current_memory_usage_(0) {}
Serializer(const Serializer&) = delete;
Serializer& operator=(const Serializer&) = delete;
Maybe<bool> WriteValue(Local<Context> context, Local<Value> value,
Local<Value> transfer) {
bool ok;
......@@ -3909,8 +3912,6 @@ class Serializer : public ValueSerializer::Delegate {
std::vector<Global<WasmModuleObject>> wasm_modules_;
std::vector<std::shared_ptr<v8::BackingStore>> backing_stores_;
size_t current_memory_usage_;
DISALLOW_COPY_AND_ASSIGN(Serializer);
};
class Deserializer : public ValueDeserializer::Delegate {
......@@ -3922,6 +3923,9 @@ class Deserializer : public ValueDeserializer::Delegate {
deserializer_.SetSupportsLegacyWireFormat(true);
}
Deserializer(const Deserializer&) = delete;
Deserializer& operator=(const Deserializer&) = delete;
MaybeLocal<Value> ReadValue(Local<Context> context) {
bool read_header;
if (!deserializer_.ReadHeader(context).To(&read_header)) {
......@@ -3960,8 +3964,6 @@ class Deserializer : public ValueDeserializer::Delegate {
Isolate* isolate_;
ValueDeserializer deserializer_;
std::unique_ptr<SerializationData> data_;
DISALLOW_COPY_AND_ASSIGN(Deserializer);
};
class D8Testing {
......
......@@ -119,7 +119,9 @@ class SourceGroup {
class SerializationData {
public:
SerializationData() : size_(0) {}
SerializationData() = default;
SerializationData(const SerializationData&) = delete;
SerializationData& operator=(const SerializationData&) = delete;
uint8_t* data() { return data_.get(); }
size_t size() { return size_; }
......@@ -139,15 +141,13 @@ class SerializationData {
};
std::unique_ptr<uint8_t, DataDeleter> data_;
size_t size_;
size_t size_ = 0;
std::vector<std::shared_ptr<v8::BackingStore>> backing_stores_;
std::vector<std::shared_ptr<v8::BackingStore>> sab_backing_stores_;
std::vector<CompiledWasmModule> compiled_wasm_modules_;
private:
friend class Serializer;
DISALLOW_COPY_AND_ASSIGN(SerializationData);
};
class SerializationDataQueue {
......
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