Commit 88cc1869 authored by Stuart Langley's avatar Stuart Langley Committed by Commit Bot

Replace WTF_MAKE_NONCOPYABLE with DISALLOW_COPY_AND_ASSIGN in Source/core/loader.

This changes is for files in the path //t_p/WebKit/Source/core/loader/.

Added the include for base/macros.h where needed and moved the macro to the
end of the class as per the code guidelines enforced by lint.

This CL introduces no logic changes.

Bug: 565932
Change-Id: Ia142fe6223698056e1c2d74219ace9865ae4b419
Reviewed-on: https://chromium-review.googlesource.com/805014
Commit-Queue: Stuart Langley <slangley@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521215}
parent 0f585a08
......@@ -31,6 +31,7 @@
#ifndef DocumentThreadableLoaderClient_h
#define DocumentThreadableLoaderClient_h
#include "base/macros.h"
#include "core/loader/ThreadableLoaderClient.h"
namespace blink {
......@@ -39,7 +40,6 @@ class KURL;
class ResourceResponse;
class DocumentThreadableLoaderClient : public ThreadableLoaderClient {
WTF_MAKE_NONCOPYABLE(DocumentThreadableLoaderClient);
USING_FAST_MALLOC(DocumentThreadableLoaderClient);
public:
......@@ -51,7 +51,9 @@ class DocumentThreadableLoaderClient : public ThreadableLoaderClient {
}
protected:
DocumentThreadableLoaderClient() {}
DocumentThreadableLoaderClient() = default;
DISALLOW_COPY_AND_ASSIGN(DocumentThreadableLoaderClient);
};
} // namespace blink
......
......@@ -31,6 +31,7 @@
#include <memory>
#include "base/macros.h"
#include "core/CoreExport.h"
#include "core/frame/ContentSettingsClient.h"
#include "core/frame/LocalFrameClient.h"
......@@ -229,11 +230,9 @@ class CORE_EXPORT EmptyChromeClient : public ChromeClient {
};
class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
WTF_MAKE_NONCOPYABLE(EmptyLocalFrameClient);
public:
static EmptyLocalFrameClient* Create() { return new EmptyLocalFrameClient; }
~EmptyLocalFrameClient() override {}
~EmptyLocalFrameClient() override = default;
bool HasWebView() const override { return true; } // mainly for assertions
......@@ -373,14 +372,15 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
String GetInstrumentationToken() override { return g_empty_string; };
protected:
EmptyLocalFrameClient() {}
EmptyLocalFrameClient() = default;
ContentSettingsClient content_settings_client_;
service_manager::InterfaceProvider interface_provider_;
DISALLOW_COPY_AND_ASSIGN(EmptyLocalFrameClient);
};
class EmptySpellCheckPanelHostClient : public WebSpellCheckPanelHostClient {
WTF_MAKE_NONCOPYABLE(EmptySpellCheckPanelHostClient);
USING_FAST_MALLOC(EmptySpellCheckPanelHostClient);
public:
......@@ -389,10 +389,11 @@ class EmptySpellCheckPanelHostClient : public WebSpellCheckPanelHostClient {
void ShowSpellingUI(bool) override {}
bool IsShowingSpellingUI() override { return false; }
void UpdateSpellingUIWithMisspelledWord(const WebString&) override {}
DISALLOW_COPY_AND_ASSIGN(EmptySpellCheckPanelHostClient);
};
class EmptyEditorClient final : public EditorClient {
WTF_MAKE_NONCOPYABLE(EmptyEditorClient);
USING_FAST_MALLOC(EmptyEditorClient);
public:
......@@ -410,10 +411,11 @@ class EmptyEditorClient final : public EditorClient {
}
bool HandleKeyboardEvent(LocalFrame*) override { return false; }
DISALLOW_COPY_AND_ASSIGN(EmptyEditorClient);
};
class EmptyContextMenuClient final : public ContextMenuClient {
WTF_MAKE_NONCOPYABLE(EmptyContextMenuClient);
USING_FAST_MALLOC(EmptyContextMenuClient);
public:
......@@ -421,11 +423,11 @@ class EmptyContextMenuClient final : public ContextMenuClient {
~EmptyContextMenuClient() override {}
bool ShowContextMenu(const ContextMenu*, WebMenuSourceType) override;
void ClearContextMenu() override {}
DISALLOW_COPY_AND_ASSIGN(EmptyContextMenuClient);
};
class CORE_EXPORT EmptyRemoteFrameClient : public RemoteFrameClient {
WTF_MAKE_NONCOPYABLE(EmptyRemoteFrameClient);
public:
EmptyRemoteFrameClient();
......@@ -457,6 +459,8 @@ class CORE_EXPORT EmptyRemoteFrameClient : public RemoteFrameClient {
Frame* NextSibling() const override { return nullptr; }
Frame* FirstChild() const override { return nullptr; }
void FrameFocused() const override {}
DISALLOW_COPY_AND_ASSIGN(EmptyRemoteFrameClient);
};
CORE_EXPORT void FillWithEmptyClients(Page::PageClients&);
......
......@@ -31,6 +31,7 @@
#ifndef FormSubmission_h
#define FormSubmission_h
#include "base/macros.h"
#include "core/loader/FrameLoadRequest.h"
#include "platform/heap/Handle.h"
#include "platform/weborigin/KURL.h"
......@@ -51,7 +52,6 @@ class FormSubmission : public GarbageCollectedFinalized<FormSubmission> {
class Attributes {
DISALLOW_NEW();
WTF_MAKE_NONCOPYABLE(Attributes);
public:
Attributes()
......@@ -88,6 +88,8 @@ class FormSubmission : public GarbageCollectedFinalized<FormSubmission> {
AtomicString target_;
AtomicString encoding_type_;
String accept_charset_;
DISALLOW_COPY_AND_ASSIGN(Attributes);
};
static FormSubmission* Create(HTMLFormElement*,
......
......@@ -33,6 +33,7 @@
#ifndef FrameLoader_h
#define FrameLoader_h
#include "base/macros.h"
#include "core/CoreExport.h"
#include "core/dom/IconURL.h"
#include "core/dom/SandboxFlags.h"
......@@ -71,7 +72,6 @@ CORE_EXPORT bool IsBackForwardLoadType(FrameLoadType);
CORE_EXPORT bool IsReloadLoadType(FrameLoadType);
class CORE_EXPORT FrameLoader final {
WTF_MAKE_NONCOPYABLE(FrameLoader);
DISALLOW_NEW();
public:
......@@ -299,6 +299,8 @@ class CORE_EXPORT FrameLoader final {
bool dispatching_did_clear_window_object_in_main_world_;
bool protect_provisional_loader_;
bool detached_;
DISALLOW_COPY_AND_ASSIGN(FrameLoader);
};
} // namespace blink
......
......@@ -30,9 +30,9 @@
#ifndef FrameLoaderStateMachine_h
#define FrameLoaderStateMachine_h
#include "base/macros.h"
#include "core/CoreExport.h"
#include "platform/wtf/Allocator.h"
#include "platform/wtf/Noncopyable.h"
#include "platform/wtf/text/WTFString.h"
namespace blink {
......@@ -42,7 +42,6 @@ namespace blink {
// is executing.
class CORE_EXPORT FrameLoaderStateMachine {
DISALLOW_NEW();
WTF_MAKE_NONCOPYABLE(FrameLoaderStateMachine);
public:
FrameLoaderStateMachine();
......@@ -67,6 +66,8 @@ class CORE_EXPORT FrameLoaderStateMachine {
private:
State state_;
DISALLOW_COPY_AND_ASSIGN(FrameLoaderStateMachine);
};
} // namespace blink
......
......@@ -5,11 +5,11 @@
#ifndef IdlenessDetector_h
#define IdlenessDetector_h
#include "base/macros.h"
#include "core/CoreExport.h"
#include "platform/Timer.h"
#include "platform/heap/Handle.h"
#include "platform/scheduler/base/task_time_observer.h"
#include "platform/wtf/Noncopyable.h"
namespace blink {
......@@ -24,8 +24,6 @@ class ResourceFetcher;
class CORE_EXPORT IdlenessDetector
: public GarbageCollectedFinalized<IdlenessDetector>,
public scheduler::TaskTimeObserver {
WTF_MAKE_NONCOPYABLE(IdlenessDetector);
public:
explicit IdlenessDetector(LocalFrame*);
......@@ -67,6 +65,8 @@ class CORE_EXPORT IdlenessDetector
double network_0_quiet_start_time_ = 0;
double network_2_quiet_start_time_ = 0;
TaskRunnerTimer<IdlenessDetector> network_quiet_timer_;
DISALLOW_COPY_AND_ASSIGN(IdlenessDetector);
};
} // namespace blink
......
......@@ -5,13 +5,13 @@
#ifndef InteractiveDetector_h
#define InteractiveDetector_h
#include "base/macros.h"
#include "core/CoreExport.h"
#include "platform/LongTaskDetector.h"
#include "platform/PODInterval.h"
#include "platform/Supplementable.h"
#include "platform/Timer.h"
#include "platform/heap/Handle.h"
#include "platform/wtf/Noncopyable.h"
#include "platform/wtf/Optional.h"
namespace blink {
......@@ -27,15 +27,12 @@ class CORE_EXPORT InteractiveDetector
: public GarbageCollectedFinalized<InteractiveDetector>,
public Supplement<Document>,
public LongTaskObserver {
WTF_MAKE_NONCOPYABLE(InteractiveDetector);
USING_GARBAGE_COLLECTED_MIXIN(InteractiveDetector);
public:
// This class can be easily switched out to allow better testing of
// InteractiveDetector.
class CORE_EXPORT NetworkActivityChecker {
WTF_MAKE_NONCOPYABLE(NetworkActivityChecker);
public:
NetworkActivityChecker(Document* document) : document_(document) {}
......@@ -44,6 +41,8 @@ class CORE_EXPORT InteractiveDetector
private:
WeakPersistent<Document> document_;
DISALLOW_COPY_AND_ASSIGN(NetworkActivityChecker);
};
static InteractiveDetector* From(Document&);
......@@ -139,6 +138,8 @@ class CORE_EXPORT InteractiveDetector
// LongTaskObserver implementation
void OnLongTaskDetected(double start_time, double end_time) override;
DISALLOW_COPY_AND_ASSIGN(InteractiveDetector);
};
} // namespace blink
......
......@@ -32,6 +32,7 @@
#define MixedContentChecker_h
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
#include "platform/loader/fetch/ResourceRequest.h"
......@@ -61,7 +62,6 @@ class WebWorkerFetchContext;
// Current mixed content W3C draft that drives this implementation:
// https://w3c.github.io/webappsec-mixed-content/
class CORE_EXPORT MixedContentChecker final {
WTF_MAKE_NONCOPYABLE(MixedContentChecker);
DISALLOW_NEW();
public:
......@@ -138,6 +138,8 @@ class CORE_EXPORT MixedContentChecker final {
const KURL&,
bool allowed);
static void Count(Frame*, WebURLRequest::RequestContext, const LocalFrame*);
DISALLOW_COPY_AND_ASSIGN(MixedContentChecker);
};
} // namespace blink
......
......@@ -33,6 +33,8 @@
#define NavigationScheduler_h
#include <memory>
#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
#include "core/CoreExport.h"
#include "core/dom/Document.h"
......@@ -41,7 +43,6 @@
#include "platform/weborigin/KURL.h"
#include "platform/wtf/Forward.h"
#include "platform/wtf/HashMap.h"
#include "platform/wtf/Noncopyable.h"
#include "platform/wtf/text/WTFString.h"
#include "public/platform/scheduler/renderer/renderer_scheduler.h"
......@@ -53,8 +54,6 @@ class ScheduledNavigation;
class CORE_EXPORT NavigationScheduler final
: public GarbageCollectedFinalized<NavigationScheduler> {
WTF_MAKE_NONCOPYABLE(NavigationScheduler);
public:
static NavigationScheduler* Create(LocalFrame* frame) {
return new NavigationScheduler(frame);
......@@ -95,10 +94,12 @@ class CORE_EXPORT NavigationScheduler final
// Exists because we can't deref m_frame in destructor.
scheduler::RendererScheduler::NavigatingFrameType frame_type_;
DISALLOW_COPY_AND_ASSIGN(NavigationScheduler);
};
class NavigationDisablerForBeforeUnload {
WTF_MAKE_NONCOPYABLE(NavigationDisablerForBeforeUnload);
DISALLOW_COPY_AND_ASSIGN(NavigationDisablerForBeforeUnload);
STACK_ALLOCATED();
public:
......
......@@ -33,12 +33,12 @@
#define PingLoader_h
#include <memory>
#include "core/CoreExport.h"
#include "platform/Timer.h"
#include "platform/heap/Handle.h"
#include "platform/heap/SelfKeepAlive.h"
#include "platform/wtf/Forward.h"
#include "platform/wtf/Noncopyable.h"
#include "public/platform/WebURLLoaderClient.h"
namespace blink {
......
......@@ -32,6 +32,7 @@
#ifndef PrerendererClient_h
#define PrerendererClient_h
#include "base/macros.h"
#include "core/CoreExport.h"
#include "core/page/Page.h"
#include "platform/Supplementable.h"
......@@ -46,7 +47,6 @@ class CORE_EXPORT PrerendererClient
: public GarbageCollected<PrerendererClient>,
public Supplement<Page> {
USING_GARBAGE_COLLECTED_MIXIN(PrerendererClient);
WTF_MAKE_NONCOPYABLE(PrerendererClient);
public:
PrerendererClient(Page&, WebPrerendererClient*);
......@@ -59,6 +59,8 @@ class CORE_EXPORT PrerendererClient
private:
WebPrerendererClient* client_;
DISALLOW_COPY_AND_ASSIGN(PrerendererClient);
};
CORE_EXPORT void ProvidePrerendererClientTo(Page&, PrerendererClient*);
......
......@@ -54,7 +54,6 @@ static const double kProgressNotificationInterval = 0.02;
static const double kProgressNotificationTimeInterval = 0.1;
struct ProgressItem {
WTF_MAKE_NONCOPYABLE(ProgressItem);
USING_FAST_MALLOC(ProgressItem);
public:
......@@ -63,6 +62,8 @@ struct ProgressItem {
long long bytes_received;
long long estimated_length;
DISALLOW_COPY_AND_ASSIGN(ProgressItem);
};
ProgressTracker* ProgressTracker::Create(LocalFrame* frame) {
......
......@@ -27,6 +27,8 @@
#define ProgressTracker_h
#include <memory>
#include "base/macros.h"
#include "core/CoreExport.h"
#include "core/loader/FrameLoaderTypes.h"
#include "platform/heap/Handle.h"
......@@ -34,7 +36,6 @@
#include "platform/wtf/Allocator.h"
#include "platform/wtf/Forward.h"
#include "platform/wtf/HashMap.h"
#include "platform/wtf/Noncopyable.h"
namespace blink {
......@@ -48,8 +49,6 @@ struct ProgressItem;
// We should find a better way for Android to get this data and remove this!
class CORE_EXPORT ProgressTracker final
: public GarbageCollectedFinalized<ProgressTracker> {
WTF_MAKE_NONCOPYABLE(ProgressTracker);
public:
static ProgressTracker* Create(LocalFrame*);
......@@ -89,6 +88,8 @@ class CORE_EXPORT ProgressTracker final
double progress_value_;
HashMap<unsigned long, std::unique_ptr<ProgressItem>> progress_items_;
DISALLOW_COPY_AND_ASSIGN(ProgressTracker);
};
} // namespace blink
......
......@@ -32,12 +32,13 @@
#define ThreadableLoader_h
#include <memory>
#include "base/macros.h"
#include "core/CoreExport.h"
#include "platform/CrossThreadCopier.h"
#include "platform/heap/Handle.h"
#include "platform/loader/fetch/ResourceLoaderOptions.h"
#include "platform/wtf/Allocator.h"
#include "platform/wtf/Noncopyable.h"
namespace blink {
......@@ -92,8 +93,6 @@ struct CrossThreadCopier<ThreadableLoaderOptions> {
// redirect happens.
class CORE_EXPORT ThreadableLoader
: public GarbageCollectedFinalized<ThreadableLoader> {
WTF_MAKE_NONCOPYABLE(ThreadableLoader);
public:
static void LoadResourceSynchronously(ExecutionContext&,
const ResourceRequest&,
......@@ -157,12 +156,14 @@ class CORE_EXPORT ThreadableLoader
// will be processed.
virtual void Detach() = 0;
virtual ~ThreadableLoader() {}
virtual ~ThreadableLoader() = default;
virtual void Trace(blink::Visitor* visitor) {}
protected:
ThreadableLoader() {}
ThreadableLoader() = default;
DISALLOW_COPY_AND_ASSIGN(ThreadableLoader);
};
} // namespace blink
......
......@@ -32,9 +32,10 @@
#define ThreadableLoaderClient_h
#include <memory>
#include "base/macros.h"
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
#include "platform/wtf/Noncopyable.h"
#include "public/platform/WebDataConsumerHandle.h"
namespace blink {
......@@ -45,8 +46,6 @@ class ResourceResponse;
class ResourceTimingInfo;
class CORE_EXPORT ThreadableLoaderClient {
WTF_MAKE_NONCOPYABLE(ThreadableLoaderClient);
public:
virtual void DidSendData(unsigned long long /*bytesSent*/,
unsigned long long /*totalBytesToBeSent*/) {}
......@@ -69,7 +68,9 @@ class CORE_EXPORT ThreadableLoaderClient {
virtual ~ThreadableLoaderClient() {}
protected:
ThreadableLoaderClient() {}
ThreadableLoaderClient() = default;
DISALLOW_COPY_AND_ASSIGN(ThreadableLoaderClient);
};
} // namespace blink
......
......@@ -5,10 +5,10 @@
#ifndef ThreadableLoadingContext_h
#define ThreadableLoadingContext_h
#include "base/macros.h"
#include "core/CoreExport.h"
#include "platform/heap/Heap.h"
#include "platform/wtf/Forward.h"
#include "platform/wtf/Noncopyable.h"
namespace blink {
......@@ -23,8 +23,6 @@ class WorkerGlobalScope;
// context is bound to (e.g. on the main thread).
class CORE_EXPORT ThreadableLoadingContext
: public GarbageCollected<ThreadableLoadingContext> {
WTF_MAKE_NONCOPYABLE(ThreadableLoadingContext);
public:
static ThreadableLoadingContext* Create(Document&);
static ThreadableLoadingContext* Create(WorkerGlobalScope&);
......@@ -37,6 +35,8 @@ class CORE_EXPORT ThreadableLoadingContext
BaseFetchContext* GetFetchContext();
virtual void Trace(blink::Visitor* visitor) {}
DISALLOW_COPY_AND_ASSIGN(ThreadableLoadingContext);
};
} // namespace blink
......
......@@ -5,6 +5,7 @@
#ifndef ModuleScriptLoader_h
#define ModuleScriptLoader_h
#include "base/macros.h"
#include "core/CoreExport.h"
#include "core/loader/modulescript/ModuleScriptCreationParams.h"
#include "core/loader/modulescript/ModuleScriptFetchRequest.h"
......@@ -32,7 +33,6 @@ class CORE_EXPORT ModuleScriptLoader final
: public GarbageCollectedFinalized<ModuleScriptLoader>,
public ModuleScriptFetcher::Client {
USING_GARBAGE_COLLECTED_MIXIN(ModuleScriptLoader);
WTF_MAKE_NONCOPYABLE(ModuleScriptLoader);
enum class State {
kInitial,
......@@ -87,6 +87,8 @@ class CORE_EXPORT ModuleScriptLoader final
#if DCHECK_IS_ON()
KURL url_;
#endif
DISALLOW_COPY_AND_ASSIGN(ModuleScriptLoader);
};
} // namespace blink
......
......@@ -31,11 +31,11 @@
#ifndef PrerenderHandle_h
#define PrerenderHandle_h
#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
#include "core/dom/ContextLifecycleObserver.h"
#include "platform/heap/Handle.h"
#include "platform/weborigin/KURL.h"
#include "platform/wtf/Noncopyable.h"
namespace blink {
......@@ -46,7 +46,6 @@ class PrerenderClient;
class PrerenderHandle final : public GarbageCollectedFinalized<PrerenderHandle>,
public ContextLifecycleObserver {
USING_GARBAGE_COLLECTED_MIXIN(PrerenderHandle);
WTF_MAKE_NONCOPYABLE(PrerenderHandle);
public:
static PrerenderHandle* Create(Document&,
......@@ -71,6 +70,8 @@ class PrerenderHandle final : public GarbageCollectedFinalized<PrerenderHandle>,
void Detach();
Member<Prerender> prerender_;
DISALLOW_COPY_AND_ASSIGN(PrerenderHandle);
};
} // namespace blink
......
......@@ -41,6 +41,7 @@
#ifndef MultipartImageResourceParser_h
#define MultipartImageResourceParser_h
#include "base/macros.h"
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
#include "platform/loader/fetch/ResourceResponse.h"
......@@ -51,8 +52,6 @@ namespace blink {
// A parser parsing mlutipart/x-mixed-replace resource.
class CORE_EXPORT MultipartImageResourceParser final
: public GarbageCollectedFinalized<MultipartImageResourceParser> {
WTF_MAKE_NONCOPYABLE(MultipartImageResourceParser);
public:
class CORE_EXPORT Client : public GarbageCollectedMixin {
public:
......@@ -95,6 +94,8 @@ class CORE_EXPORT MultipartImageResourceParser final
bool is_parsing_headers_ = false;
bool saw_last_boundary_ = false;
bool is_cancelled_ = false;
DISALLOW_COPY_AND_ASSIGN(MultipartImageResourceParser);
};
} // namespace blink
......
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