This PR migrates `CookieMonster` from macro replacements to be handled by `plaster`. This is going to be specially useful in `cr149` where a recent landed changed (https://crrev.com/c/7727488) would force the introduction of patch files, and become very disruptive for how these replacement macros work right now in general. This PR attemps a novel approach to replicate the common pattern where in Brave we want to replace a Chromium class with a derived Brave class: the Chromium class is moved into a nested namespace called `chromium_impl`, and the brave implementation is declared in its place in a shadow file. This has required additional plaster for types that absolutely have to refer to the chromium implementation, but the outcome is much simpler than the previous invisible replacements. This change leaves no `#define` uses for replacement in the shadow files. Resolve https://github.com/brave/brave-browser/issues/54496
35 lines
1.4 KiB
Diff
35 lines
1.4 KiB
Diff
diff --git a/net/cookies/cookie_monster_change_dispatcher.h b/net/cookies/cookie_monster_change_dispatcher.h
|
|
index 03a9b7458ce56ae45a5e9ef0d7f715d22e8e41b0..5a8910ae8ca5954444295551ec53da5dad1481f4 100644
|
|
--- a/net/cookies/cookie_monster_change_dispatcher.h
|
|
+++ b/net/cookies/cookie_monster_change_dispatcher.h
|
|
@@ -24,16 +24,18 @@
|
|
namespace net {
|
|
|
|
class CookieAccessDelegate;
|
|
+namespace chromium_impl {
|
|
class CookieMonster;
|
|
+}
|
|
|
|
-// CookieChangeDispatcher implementation used by CookieMonster.
|
|
+// CookieChangeDispatcher implementation used by chromium_impl::CookieMonster.
|
|
class CookieMonsterChangeDispatcher : public CookieChangeDispatcher {
|
|
public:
|
|
using CookieChangeCallbackList =
|
|
base::RepeatingCallbackList<void(const CookieChangeInfo&)>;
|
|
|
|
// Expects |cookie_monster| to outlive this.
|
|
- explicit CookieMonsterChangeDispatcher(const CookieMonster* cookie_monster);
|
|
+ explicit CookieMonsterChangeDispatcher(const chromium_impl::CookieMonster* cookie_monster);
|
|
|
|
CookieMonsterChangeDispatcher(const CookieMonsterChangeDispatcher&) = delete;
|
|
CookieMonsterChangeDispatcher& operator=(
|
|
@@ -150,7 +152,7 @@ class CookieMonsterChangeDispatcher : public CookieChangeDispatcher {
|
|
// Called by the Subscription destructor.
|
|
void UnlinkSubscription(Subscription* subscription);
|
|
|
|
- raw_ptr<const CookieMonster> cookie_monster_;
|
|
+ raw_ptr<const chromium_impl::CookieMonster> cookie_monster_;
|
|
|
|
CookieDomainMap cookie_domain_map_;
|
|
|