Commit 054b56e5 authored by Stuart Langley's avatar Stuart Langley Committed by Commit Bot

Remove WebNonCopyable and replace any usage with explicit "= delete".

In the few use cases that were using WebNonCopyable I followed the Google
C++ style guide, which explicitly states that to remove copy
operations "explicitly disable them using = delete in the public: section".
https://google.github.io/styleguide/cppguide.html#Copyable_Movable_Types

Most places were just including the header file without actually using
the type.

This CL contains no logic changes.

Bug: 788846
Change-Id: I991e4b9b548f67a41d79882723525a97f3625432
Reviewed-on: https://chromium-review.googlesource.com/792190Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Stuart Langley <slangley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519522}
parent fe20f163
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "content/shell/test_runner/mock_web_theme_engine.h" #include "content/shell/test_runner/mock_web_theme_engine.h"
#include "third_party/WebKit/public/platform/WebNonCopyable.h"
namespace blink { namespace blink {
class WebLocalFrame; class WebLocalFrame;
......
...@@ -271,7 +271,6 @@ source_set("blink_headers") { ...@@ -271,7 +271,6 @@ source_set("blink_headers") {
"platform/WebMouseWheelEvent.h", "platform/WebMouseWheelEvent.h",
"platform/WebNativeScrollBehavior.h", "platform/WebNativeScrollBehavior.h",
"platform/WebNetworkStateNotifier.h", "platform/WebNetworkStateNotifier.h",
"platform/WebNonCopyable.h",
"platform/WebPasswordCredential.h", "platform/WebPasswordCredential.h",
"platform/WebPlatformEventListener.h", "platform/WebPlatformEventListener.h",
"platform/WebPlatformEventType.h", "platform/WebPlatformEventType.h",
......
...@@ -5,14 +5,15 @@ ...@@ -5,14 +5,15 @@
#ifndef UserMetricsAction_h #ifndef UserMetricsAction_h
#define UserMetricsAction_h #define UserMetricsAction_h
#include "WebNonCopyable.h"
namespace blink { namespace blink {
// WebKit equivalent to base::UserMetricsAction. Included here so that it's // WebKit equivalent to base::UserMetricsAction. Included here so that it's
// self-contained within WebKit. // self-contained within WebKit.
class UserMetricsAction : public WebNonCopyable { class UserMetricsAction {
public: public:
UserMetricsAction(const UserMetricsAction&) = delete;
UserMetricsAction& operator=(const UserMetricsAction&) = delete;
explicit UserMetricsAction(const char* action) : action_(action) {} explicit UserMetricsAction(const char* action) : action_(action) {}
const char* Action() const { return action_; } const char* Action() const { return action_; }
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#ifndef WebBlobData_h #ifndef WebBlobData_h
#define WebBlobData_h #define WebBlobData_h
#include "WebNonCopyable.h"
#include "WebString.h" #include "WebString.h"
#include "WebThreadSafeData.h" #include "WebThreadSafeData.h"
#include "WebURL.h" #include "WebURL.h"
...@@ -44,7 +43,7 @@ namespace blink { ...@@ -44,7 +43,7 @@ namespace blink {
class BlobData; class BlobData;
class WebBlobData : public WebNonCopyable { class WebBlobData {
public: public:
struct Item { struct Item {
enum { kTypeData, kTypeFile, kTypeBlob, kTypeFileSystemURL } type; enum { kTypeData, kTypeFile, kTypeBlob, kTypeFileSystemURL } type;
...@@ -59,6 +58,8 @@ class WebBlobData : public WebNonCopyable { ...@@ -59,6 +58,8 @@ class WebBlobData : public WebNonCopyable {
BLINK_PLATFORM_EXPORT WebBlobData(); BLINK_PLATFORM_EXPORT WebBlobData();
BLINK_PLATFORM_EXPORT ~WebBlobData(); BLINK_PLATFORM_EXPORT ~WebBlobData();
WebBlobData(const WebBlobData&) = delete;
WebBlobData& operator=(const WebBlobData&) = delete;
bool IsNull() const { return !private_.get(); } bool IsNull() const { return !private_.get(); }
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/loader/fetch/ResourceLoaderOptions.h"
#include "public/platform/WebHTTPHeaderMap.h" #include "public/platform/WebHTTPHeaderMap.h"
#include "public/platform/WebHTTPHeaderSet.h" #include "public/platform/WebHTTPHeaderSet.h"
#include "public/platform/WebNonCopyable.h"
#include "public/platform/WebString.h" #include "public/platform/WebString.h"
#include "public/platform/WebURL.h" #include "public/platform/WebURL.h"
#include "public/platform/WebURLRequest.h" #include "public/platform/WebURLRequest.h"
...@@ -43,9 +42,13 @@ namespace blink { ...@@ -43,9 +42,13 @@ namespace blink {
// Represents an entry of the CORS-preflight cache. // Represents an entry of the CORS-preflight cache.
// See https://fetch.spec.whatwg.org/#concept-cache. // See https://fetch.spec.whatwg.org/#concept-cache.
class BLINK_PLATFORM_EXPORT WebCORSPreflightResultCacheItem class BLINK_PLATFORM_EXPORT WebCORSPreflightResultCacheItem {
: public WebNonCopyable {
public: public:
WebCORSPreflightResultCacheItem(const WebCORSPreflightResultCacheItem&) =
delete;
WebCORSPreflightResultCacheItem& operator=(
const WebCORSPreflightResultCacheItem&) = delete;
static std::unique_ptr<WebCORSPreflightResultCacheItem> Create( static std::unique_ptr<WebCORSPreflightResultCacheItem> Create(
const network::mojom::FetchCredentialsMode, const network::mojom::FetchCredentialsMode,
const WebHTTPHeaderMap&, const WebHTTPHeaderMap&,
...@@ -77,9 +80,12 @@ class BLINK_PLATFORM_EXPORT WebCORSPreflightResultCacheItem ...@@ -77,9 +80,12 @@ class BLINK_PLATFORM_EXPORT WebCORSPreflightResultCacheItem
WebHTTPHeaderSet headers_; WebHTTPHeaderSet headers_;
}; };
class BLINK_PLATFORM_EXPORT WebCORSPreflightResultCache class BLINK_PLATFORM_EXPORT WebCORSPreflightResultCache {
: public WebNonCopyable {
public: public:
WebCORSPreflightResultCache(const WebCORSPreflightResultCache&) = delete;
WebCORSPreflightResultCache& operator=(const WebCORSPreflightResultCache&) =
delete;
// Returns a WebCORSPreflightResultCache which is shared in the same thread. // Returns a WebCORSPreflightResultCache which is shared in the same thread.
static WebCORSPreflightResultCache& Shared(); static WebCORSPreflightResultCache& Shared();
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "WebBlobData.h" #include "WebBlobData.h"
#include "WebData.h" #include "WebData.h"
#include "WebNonCopyable.h"
#include "WebString.h" #include "WebString.h"
#include "WebURL.h" #include "WebURL.h"
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include <vector> #include <vector>
#include "WebCommon.h" #include "WebCommon.h"
#include "WebNonCopyable.h"
#include "WebPrivatePtr.h" #include "WebPrivatePtr.h"
#include "WebString.h" #include "WebString.h"
#include "WebVector.h" #include "WebVector.h"
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#define WebMediaDeviceInfo_h #define WebMediaDeviceInfo_h
#include "WebCommon.h" #include "WebCommon.h"
#include "WebNonCopyable.h"
#include "WebPrivatePtr.h" #include "WebPrivatePtr.h"
#include "WebString.h" #include "WebString.h"
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#define WebMediaStream_h #define WebMediaStream_h
#include "WebCommon.h" #include "WebCommon.h"
#include "WebNonCopyable.h"
#include "WebPrivatePtr.h" #include "WebPrivatePtr.h"
#include "WebVector.h" #include "WebVector.h"
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "WebCommon.h" #include "WebCommon.h"
#include "WebMediaStreamTrack.h" #include "WebMediaStreamTrack.h"
#include "WebNonCopyable.h"
#include "WebPrivatePtr.h" #include "WebPrivatePtr.h"
#if INSIDE_BLINK #if INSIDE_BLINK
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#define WebMediaStreamTrack_h #define WebMediaStreamTrack_h
#include "WebCommon.h" #include "WebCommon.h"
#include "WebNonCopyable.h"
#include "WebPrivatePtr.h" #include "WebPrivatePtr.h"
#include "WebString.h" #include "WebString.h"
......
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebNonCopyable_h
#define WebNonCopyable_h
namespace blink {
// A base class to extend from if you do not support copying.
class WebNonCopyable {
protected:
WebNonCopyable() {}
~WebNonCopyable() {}
private:
WebNonCopyable(const WebNonCopyable&);
WebNonCopyable& operator=(const WebNonCopyable&);
};
} // namespace blink
#endif
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#define WebRTCSessionDescription_h #define WebRTCSessionDescription_h
#include "WebCommon.h" #include "WebCommon.h"
#include "WebNonCopyable.h"
#include "WebPrivatePtr.h" #include "WebPrivatePtr.h"
#include "WebString.h" #include "WebString.h"
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#define WebRTCSessionDescriptionRequest_h #define WebRTCSessionDescriptionRequest_h
#include "WebCommon.h" #include "WebCommon.h"
#include "WebNonCopyable.h"
#include "WebPrivatePtr.h" #include "WebPrivatePtr.h"
#include "WebString.h" #include "WebString.h"
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#define WebRTCVoidRequest_h #define WebRTCVoidRequest_h
#include "WebCommon.h" #include "WebCommon.h"
#include "WebNonCopyable.h"
#include "WebPrivatePtr.h" #include "WebPrivatePtr.h"
#include "WebString.h" #include "WebString.h"
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "public/platform/WebCommon.h" #include "public/platform/WebCommon.h"
#include "public/platform/WebImage.h" #include "public/platform/WebImage.h"
#include "public/platform/WebNonCopyable.h"
namespace blink { namespace blink {
...@@ -41,13 +40,15 @@ class ImageDecoder; ...@@ -41,13 +40,15 @@ class ImageDecoder;
class WebData; class WebData;
typedef ImageDecoder WebImageDecoderPrivate; typedef ImageDecoder WebImageDecoderPrivate;
class WebImageDecoder : public WebNonCopyable { class WebImageDecoder {
public: public:
enum Type { kTypeBMP, kTypeICO }; enum Type { kTypeBMP, kTypeICO };
~WebImageDecoder() { Reset(); } ~WebImageDecoder() { Reset(); }
explicit WebImageDecoder(Type type) { Init(type); } explicit WebImageDecoder(Type type) { Init(type); }
WebImageDecoder(const WebImageDecoder&) = delete;
WebImageDecoder& operator=(const WebImageDecoder&) = delete;
// Sets data contents for underlying decoder. All the API methods // Sets data contents for underlying decoder. All the API methods
// require that setData() is called prior to their use. // require that setData() is called prior to their use.
......
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