Macros such as DISALLOW_COPY_AND_ASSIGN() are deprecated since r711900 per style arbitration [1]. This commit replaces the macros with deleted constructors and methods, which is preferred by the Google C++ Style Guide [2][3]. Also remove unneeded "base/macros.h" #includes when possible. This CL is created semi-mechanically with remove_disallow and remove_base_macros [4]. [1]: https://groups.google.com/a/chromium.org/g/cxx/c/qwH2hxaEjac/m/TUKq6eqfCwAJ [2]: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-dos-and-donts.md#explicitly-declare-class-copyability_movability [3]: https://google.github.io/styleguide/cppguide.html#Copyable_Movable_Types [4]: https://pkg.go.dev/go.timothygu.me/tools/cr/cmd Chromium change: https://chromium.googlesource.com/chromium/src.git/+/d002a3bee7ae75780b604d17df19291a3dd303fb commit d002a3bee7ae75780b604d17df19291a3dd303fb Author: Peter Boström <pbos@chromium.org> Date: Fri Nov 5 17:17:19 2021 +0000 Remove DISALLOW_ macros from base/macros.h This removes DISALLOW_COPY(), DISALLOW_ASSIGN() and DISALLOW_COPY_AND_ASSIGN() from base/macros.h. PRESUBMITs are also updated to no longer check for these macros. IWYU removal is left as a separate change just in case this needs to be reverted. Bug: 1010217
53 lines
1.9 KiB
C++
53 lines
1.9 KiB
C++
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef BRAVE_RENDERER_BRAVE_CONTENT_RENDERER_CLIENT_H_
|
|
#define BRAVE_RENDERER_BRAVE_CONTENT_RENDERER_CLIENT_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "brave/components/brave_search/renderer/brave_search_service_worker_holder.h"
|
|
#include "chrome/renderer/chrome_content_renderer_client.h"
|
|
#include "v8/include/v8.h"
|
|
|
|
class BraveRenderThreadObserver;
|
|
class GURL;
|
|
|
|
namespace blink {
|
|
class WebServiceWorkerContextProxy;
|
|
}
|
|
|
|
class BraveContentRendererClient : public ChromeContentRendererClient {
|
|
public:
|
|
BraveContentRendererClient();
|
|
BraveContentRendererClient(const BraveContentRendererClient&) = delete;
|
|
BraveContentRendererClient& operator=(const BraveContentRendererClient&) =
|
|
delete;
|
|
~BraveContentRendererClient() override;
|
|
|
|
void RenderThreadStarted() override;
|
|
void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() override;
|
|
void RenderFrameCreated(content::RenderFrame* render_frame) override;
|
|
void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override;
|
|
void WillEvaluateServiceWorkerOnWorkerThread(
|
|
blink::WebServiceWorkerContextProxy* context_proxy,
|
|
v8::Local<v8::Context> v8_context,
|
|
int64_t service_worker_version_id,
|
|
const GURL& service_worker_scope,
|
|
const GURL& script_url) override;
|
|
void WillDestroyServiceWorkerContextOnWorkerThread(
|
|
v8::Local<v8::Context> v8_context,
|
|
int64_t service_worker_version_id,
|
|
const GURL& service_worker_scope,
|
|
const GURL& script_url) override;
|
|
|
|
private:
|
|
std::unique_ptr<BraveRenderThreadObserver> brave_observer_;
|
|
brave_search::BraveSearchServiceWorkerHolder
|
|
brave_search_service_worker_holder_;
|
|
};
|
|
|
|
#endif // BRAVE_RENDERER_BRAVE_CONTENT_RENDERER_CLIENT_H_
|