refactor: replace deprecated DISALLOW_COPY_AND_ASSIGN (#31633)
This commit is contained in:
parent
2a2a1a834c
commit
65a980c673
231 changed files with 918 additions and 576 deletions
|
@ -21,6 +21,10 @@ class AsarFileValidator : public mojo::FilteredDataSource::Filter {
|
|||
AsarFileValidator(IntegrityPayload integrity, base::File file);
|
||||
~AsarFileValidator() override;
|
||||
|
||||
// disable copy
|
||||
AsarFileValidator(const AsarFileValidator&) = delete;
|
||||
AsarFileValidator& operator=(const AsarFileValidator&) = delete;
|
||||
|
||||
void OnRead(base::span<char> buffer,
|
||||
mojo::FileDataSource::ReadResult* result) override;
|
||||
|
||||
|
@ -52,8 +56,6 @@ class AsarFileValidator : public mojo::FilteredDataSource::Filter {
|
|||
uint64_t current_hash_byte_count_ = 0;
|
||||
uint64_t total_hash_byte_count_ = 0;
|
||||
std::unique_ptr<crypto::SecureHash> current_hash_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AsarFileValidator);
|
||||
};
|
||||
|
||||
} // namespace asar
|
||||
|
|
|
@ -85,6 +85,10 @@ class AsarURLLoader : public network::mojom::URLLoader {
|
|||
void PauseReadingBodyFromNet() override {}
|
||||
void ResumeReadingBodyFromNet() override {}
|
||||
|
||||
// disable copy
|
||||
AsarURLLoader(const AsarURLLoader&) = delete;
|
||||
AsarURLLoader& operator=(const AsarURLLoader&) = delete;
|
||||
|
||||
private:
|
||||
AsarURLLoader() = default;
|
||||
~AsarURLLoader() override = default;
|
||||
|
@ -379,8 +383,6 @@ class AsarURLLoader : public network::mojom::URLLoader {
|
|||
// It is used to set some of the URLLoaderCompletionStatus data passed back
|
||||
// to the URLLoaderClients (eg SimpleURLLoader).
|
||||
size_t total_bytes_written_ = 0;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AsarURLLoader);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -64,6 +64,10 @@ class ElectronURLLoaderFactory : public network::SelfDeletingURLLoaderFactory {
|
|||
target_factory_remote);
|
||||
~RedirectedRequest() override;
|
||||
|
||||
// disable copy
|
||||
RedirectedRequest(const RedirectedRequest&) = delete;
|
||||
RedirectedRequest& operator=(const RedirectedRequest&) = delete;
|
||||
|
||||
// network::mojom::URLLoader:
|
||||
void FollowRedirect(
|
||||
const std::vector<std::string>& removed_headers,
|
||||
|
@ -89,8 +93,6 @@ class ElectronURLLoaderFactory : public network::SelfDeletingURLLoaderFactory {
|
|||
net::MutableNetworkTrafficAnnotationTag traffic_annotation_;
|
||||
|
||||
mojo::Remote<network::mojom::URLLoaderFactory> target_factory_remote_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(RedirectedRequest);
|
||||
};
|
||||
|
||||
static mojo::PendingRemote<network::mojom::URLLoaderFactory> Create(
|
||||
|
@ -118,6 +120,10 @@ class ElectronURLLoaderFactory : public network::SelfDeletingURLLoaderFactory {
|
|||
ProtocolType type,
|
||||
gin::Arguments* args);
|
||||
|
||||
// disable copy
|
||||
ElectronURLLoaderFactory(const ElectronURLLoaderFactory&) = delete;
|
||||
ElectronURLLoaderFactory& operator=(const ElectronURLLoaderFactory&) = delete;
|
||||
|
||||
private:
|
||||
ElectronURLLoaderFactory(
|
||||
ProtocolType type,
|
||||
|
@ -167,8 +173,6 @@ class ElectronURLLoaderFactory : public network::SelfDeletingURLLoaderFactory {
|
|||
|
||||
ProtocolType type_;
|
||||
ProtocolHandler handler_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ElectronURLLoaderFactory);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -35,6 +35,10 @@ class NodeStreamLoader : public network::mojom::URLLoader {
|
|||
v8::Isolate* isolate,
|
||||
v8::Local<v8::Object> emitter);
|
||||
|
||||
// disable copy
|
||||
NodeStreamLoader(const NodeStreamLoader&) = delete;
|
||||
NodeStreamLoader& operator=(const NodeStreamLoader&) = delete;
|
||||
|
||||
private:
|
||||
~NodeStreamLoader() override;
|
||||
|
||||
|
@ -95,8 +99,6 @@ class NodeStreamLoader : public network::mojom::URLLoader {
|
|||
std::map<std::string, v8::Global<v8::Value>> handlers_;
|
||||
|
||||
base::WeakPtrFactory<NodeStreamLoader> weak_factory_{this};
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(NodeStreamLoader);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "content/public/browser/content_browser_client.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
|
@ -69,6 +68,10 @@ class ProxyingURLLoaderFactory
|
|||
const network::ResourceRequest& request);
|
||||
~InProgressRequest() override;
|
||||
|
||||
// disable copy
|
||||
InProgressRequest(const InProgressRequest&) = delete;
|
||||
InProgressRequest& operator=(const InProgressRequest&) = delete;
|
||||
|
||||
void Restart();
|
||||
|
||||
// network::mojom::URLLoader:
|
||||
|
@ -175,13 +178,13 @@ class ProxyingURLLoaderFactory
|
|||
net::HttpRequestHeaders modified_cors_exempt_headers;
|
||||
absl::optional<GURL> new_url;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(FollowRedirectParams);
|
||||
// disable copy
|
||||
FollowRedirectParams(const FollowRedirectParams&) = delete;
|
||||
FollowRedirectParams& operator=(const FollowRedirectParams&) = delete;
|
||||
};
|
||||
std::unique_ptr<FollowRedirectParams> pending_follow_redirect_params_;
|
||||
|
||||
base::WeakPtrFactory<InProgressRequest> weak_factory_{this};
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(InProgressRequest);
|
||||
};
|
||||
|
||||
ProxyingURLLoaderFactory(
|
||||
|
@ -202,6 +205,10 @@ class ProxyingURLLoaderFactory
|
|||
|
||||
~ProxyingURLLoaderFactory() override;
|
||||
|
||||
// disable copy
|
||||
ProxyingURLLoaderFactory(const ProxyingURLLoaderFactory&) = delete;
|
||||
ProxyingURLLoaderFactory& operator=(const ProxyingURLLoaderFactory&) = delete;
|
||||
|
||||
// network::mojom::URLLoaderFactory:
|
||||
void CreateLoaderAndStart(
|
||||
mojo::PendingReceiver<network::mojom::URLLoader> loader,
|
||||
|
@ -270,8 +277,6 @@ class ProxyingURLLoaderFactory
|
|||
std::map<int32_t, uint64_t> network_request_id_to_web_request_id_;
|
||||
|
||||
std::vector<std::string> ignore_connections_limit_domains_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ProxyingURLLoaderFactory);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -63,6 +63,10 @@ class ProxyingWebSocket : public network::mojom::WebSocketHandshakeClient,
|
|||
uint64_t* request_id_generator);
|
||||
~ProxyingWebSocket() override;
|
||||
|
||||
// disable copy
|
||||
ProxyingWebSocket(const ProxyingWebSocket&) = delete;
|
||||
ProxyingWebSocket& operator=(const ProxyingWebSocket&) = delete;
|
||||
|
||||
void Start();
|
||||
|
||||
// network::mojom::WebSocketHandshakeClient methods:
|
||||
|
@ -170,7 +174,6 @@ class ProxyingWebSocket : public network::mojom::WebSocketHandshakeClient,
|
|||
extensions::WebRequestInfo info_;
|
||||
|
||||
base::WeakPtrFactory<ProxyingWebSocket> weak_factory_{this};
|
||||
DISALLOW_COPY_AND_ASSIGN(ProxyingWebSocket);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -28,6 +28,10 @@ class ResolveProxyHelper
|
|||
|
||||
void ResolveProxy(const GURL& url, ResolveProxyCallback callback);
|
||||
|
||||
// disable copy
|
||||
ResolveProxyHelper(const ResolveProxyHelper&) = delete;
|
||||
ResolveProxyHelper& operator=(const ResolveProxyHelper&) = delete;
|
||||
|
||||
protected:
|
||||
~ResolveProxyHelper() override;
|
||||
|
||||
|
@ -40,13 +44,14 @@ class ResolveProxyHelper
|
|||
PendingRequest(PendingRequest&& pending_request) noexcept;
|
||||
~PendingRequest();
|
||||
|
||||
// disable copy
|
||||
PendingRequest(const PendingRequest&) = delete;
|
||||
PendingRequest& operator=(const PendingRequest&) = delete;
|
||||
|
||||
PendingRequest& operator=(PendingRequest&& pending_request) noexcept;
|
||||
|
||||
GURL url;
|
||||
ResolveProxyCallback callback;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(PendingRequest);
|
||||
};
|
||||
|
||||
// Starts the first pending request.
|
||||
|
@ -66,8 +71,6 @@ class ResolveProxyHelper
|
|||
|
||||
// Weak Ref
|
||||
ElectronBrowserContext* browser_context_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ResolveProxyHelper);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -92,6 +92,11 @@ class SystemNetworkContextManager::URLLoaderFactoryForSystem
|
|||
DETACH_FROM_SEQUENCE(sequence_checker_);
|
||||
}
|
||||
|
||||
// disable copy
|
||||
URLLoaderFactoryForSystem(const URLLoaderFactoryForSystem&) = delete;
|
||||
URLLoaderFactoryForSystem& operator=(const URLLoaderFactoryForSystem&) =
|
||||
delete;
|
||||
|
||||
// mojom::URLLoaderFactory implementation:
|
||||
void CreateLoaderAndStart(
|
||||
mojo::PendingReceiver<network::mojom::URLLoader> request,
|
||||
|
@ -132,8 +137,6 @@ class SystemNetworkContextManager::URLLoaderFactoryForSystem
|
|||
|
||||
SEQUENCE_CHECKER(sequence_checker_);
|
||||
SystemNetworkContextManager* manager_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryForSystem);
|
||||
};
|
||||
|
||||
network::mojom::NetworkContext* SystemNetworkContextManager::GetContext() {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#ifndef SHELL_BROWSER_NET_SYSTEM_NETWORK_CONTEXT_MANAGER_H_
|
||||
#define SHELL_BROWSER_NET_SYSTEM_NETWORK_CONTEXT_MANAGER_H_
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "chrome/browser/net/proxy_config_monitor.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
|
@ -35,6 +34,11 @@ class SystemNetworkContextManager {
|
|||
public:
|
||||
~SystemNetworkContextManager();
|
||||
|
||||
// disable copy
|
||||
SystemNetworkContextManager(const SystemNetworkContextManager&) = delete;
|
||||
SystemNetworkContextManager& operator=(const SystemNetworkContextManager&) =
|
||||
delete;
|
||||
|
||||
// Creates the global instance of SystemNetworkContextManager. If an
|
||||
// instance already exists, this will cause a DCHECK failure.
|
||||
static SystemNetworkContextManager* CreateInstance(PrefService* pref_service);
|
||||
|
@ -92,8 +96,6 @@ class SystemNetworkContextManager {
|
|||
// consumers don't all need to create their own factory.
|
||||
scoped_refptr<URLLoaderFactoryForSystem> shared_url_loader_factory_;
|
||||
mojo::Remote<network::mojom::URLLoaderFactory> url_loader_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(SystemNetworkContextManager);
|
||||
};
|
||||
|
||||
#endif // SHELL_BROWSER_NET_SYSTEM_NETWORK_CONTEXT_MANAGER_H_
|
||||
|
|
|
@ -41,6 +41,10 @@ class URLPipeLoader : public network::mojom::URLLoader,
|
|||
const net::NetworkTrafficAnnotationTag& annotation,
|
||||
base::DictionaryValue upload_data);
|
||||
|
||||
// disable copy
|
||||
URLPipeLoader(const URLPipeLoader&) = delete;
|
||||
URLPipeLoader& operator=(const URLPipeLoader&) = delete;
|
||||
|
||||
private:
|
||||
~URLPipeLoader() override;
|
||||
|
||||
|
@ -77,8 +81,6 @@ class URLPipeLoader : public network::mojom::URLLoader,
|
|||
std::unique_ptr<network::SimpleURLLoader> loader_;
|
||||
|
||||
base::WeakPtrFactory<URLPipeLoader> weak_factory_{this};
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(URLPipeLoader);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue