Commit 8ce60a19 authored by franzih's avatar franzih Committed by Commit bot

[api] Disable new and delete using = delete.

According to our style guide on Copyable and Movable Types,
copy/move operators should be disabled using = delete in the public: section.
Use consistent style for disabling new and delete.

BUG=

Review-Url: https://codereview.chromium.org/2276063002
Cr-Commit-Position: refs/heads/master@{#38880}
parent 6effe72f
......@@ -882,6 +882,8 @@ class V8_EXPORT HandleScope {
HandleScope(const HandleScope&) = delete;
void operator=(const HandleScope&) = delete;
void* operator new(size_t size) = delete;
void operator delete(void*, size_t) = delete;
protected:
V8_INLINE HandleScope() {}
......@@ -896,11 +898,6 @@ class V8_EXPORT HandleScope {
static internal::Object** CreateHandle(internal::HeapObject* heap_object,
internal::Object* value);
// Make it hard to create heap-allocated or illegal handle scopes by
// disallowing certain operations.
void* operator new(size_t size);
void operator delete(void*, size_t);
internal::Isolate* isolate_;
internal::Object** prev_next_;
internal::Object** prev_limit_;
......@@ -937,15 +934,11 @@ class V8_EXPORT EscapableHandleScope : public HandleScope {
EscapableHandleScope(const EscapableHandleScope&) = delete;
void operator=(const EscapableHandleScope&) = delete;
void* operator new(size_t size) = delete;
void operator delete(void*, size_t) = delete;
private:
internal::Object** Escape(internal::Object** escape_value);
// Make it hard to create heap-allocated or illegal handle scopes by
// disallowing certain operations.
void* operator new(size_t size);
void operator delete(void*, size_t);
internal::Object** escape_slot_;
};
......@@ -956,13 +949,10 @@ class V8_EXPORT SealHandleScope {
SealHandleScope(const SealHandleScope&) = delete;
void operator=(const SealHandleScope&) = delete;
void* operator new(size_t size) = delete;
void operator delete(void*, size_t) = delete;
private:
// Make it hard to create heap-allocated or illegal handle scopes by
// disallowing certain operations.
void* operator new(size_t size);
void operator delete(void*, size_t);
internal::Isolate* const isolate_;
internal::Object** prev_limit_;
int prev_sealed_level_;
......@@ -6470,18 +6460,17 @@ class V8_EXPORT Isolate {
*/
bool IsInUse();
Isolate() = delete;
~Isolate() = delete;
Isolate(const Isolate&) = delete;
Isolate& operator=(const Isolate&) = delete;
void* operator new(size_t size) = delete;
void operator delete(void*, size_t) = delete;
private:
template <class K, class V, class Traits>
friend class PersistentValueMapBase;
Isolate();
~Isolate();
void* operator new(size_t size);
void operator delete(void*, size_t);
void SetObjectGroupId(internal::Object** object, UniqueId id);
void SetReferenceFromGroup(UniqueId id, internal::Object** object);
void SetReference(internal::Object** parent, internal::Object** child);
......@@ -7147,14 +7136,12 @@ class V8_EXPORT TryCatch {
TryCatch(const TryCatch&) = delete;
void operator=(const TryCatch&) = delete;
void* operator new(size_t size) = delete;
void operator delete(void*, size_t) = delete;
private:
void ResetInternal();
// Make it hard to create heap-allocated TryCatch blocks.
void* operator new(size_t size);
void operator delete(void*, size_t);
v8::internal::Isolate* isolate_;
v8::TryCatch* next_;
void* exception_;
......
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