Commit f2e30e88 authored by Kevin McNee's avatar Kevin McNee Committed by Commit Bot

Prevent copying of ContextMenuAllowedScope.

Now that crbug.com/798708 is fixed, ContextMenuAllowedScope can be in a
base::Optional. We delete the copy and assign constructors to prevent
the accidental copying of a ContextMenuAllowedScope into an Optional
instead of the construction being done in place.

Bug: None
Change-Id: Ife88ea31a5aaf31f0c8c55ceb4bc7ca816eef98a
Reviewed-on: https://chromium-review.googlesource.com/850936Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527044}
parent 10abf450
...@@ -13,6 +13,7 @@ ContextMenuAllowedScope::ContextMenuAllowedScope() { ...@@ -13,6 +13,7 @@ ContextMenuAllowedScope::ContextMenuAllowedScope() {
} }
ContextMenuAllowedScope::~ContextMenuAllowedScope() { ContextMenuAllowedScope::~ContextMenuAllowedScope() {
DCHECK_GT(g_context_menu_allowed_count, 0U);
g_context_menu_allowed_count--; g_context_menu_allowed_count--;
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef ContextMenuAllowedScope_h #ifndef ContextMenuAllowedScope_h
#define ContextMenuAllowedScope_h #define ContextMenuAllowedScope_h
#include "base/macros.h"
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "platform/wtf/Allocator.h" #include "platform/wtf/Allocator.h"
...@@ -12,6 +13,7 @@ namespace blink { ...@@ -12,6 +13,7 @@ namespace blink {
class CORE_EXPORT ContextMenuAllowedScope { class CORE_EXPORT ContextMenuAllowedScope {
STACK_ALLOCATED(); STACK_ALLOCATED();
DISALLOW_COPY_AND_ASSIGN(ContextMenuAllowedScope);
public: public:
ContextMenuAllowedScope(); ContextMenuAllowedScope();
......
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