File: disable-privacy-sandbox.patch

package info (click to toggle)
chromium 134.0.6998.117-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 5,929,832 kB
  • sloc: cpp: 34,190,898; ansic: 7,041,458; javascript: 4,034,221; python: 1,459,275; asm: 846,276; xml: 726,586; pascal: 178,372; sh: 104,683; objc: 91,089; perl: 88,388; sql: 48,244; cs: 43,980; makefile: 28,768; fortran: 24,137; php: 20,829; ruby: 17,806; tcl: 10,142; yacc: 8,631; lisp: 3,097; lex: 1,327; ada: 727; awk: 329; jsp: 228; sed: 36
file content (299 lines) | stat: -rw-r--r-- 11,874 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
description: disable Privacy Sandbox completely

https://github.com/ungoogled-software/ungoogled-chromium/blob/master/patches/core/ungoogled-chromium/disable-privacy-sandbox.patch

--- a/components/browsing_data/content/browsing_data_model.cc
+++ b/components/browsing_data/content/browsing_data_model.cc
@@ -1002,12 +1002,6 @@ void BrowsingDataModel::PopulateFromDisk
       base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI);
   bool is_shared_dictionary_enabled = base::FeatureList::IsEnabled(
       network::features::kCompressionDictionaryTransportBackend);
-  bool is_interest_group_enabled =
-      base::FeatureList::IsEnabled(blink::features::kInterestGroupStorage);
-  bool is_attribution_reporting_enabled = base::FeatureList::IsEnabled(
-      attribution_reporting::features::kConversionMeasurement);
-  bool is_private_aggregation_enabled =
-      base::FeatureList::IsEnabled(blink::features::kPrivateAggregationApi);
 
   base::RepeatingClosure completion =
       base::BindRepeating([](const base::OnceClosure&) {},
@@ -1044,27 +1038,7 @@ void BrowsingDataModel::PopulateFromDisk
         base::BindOnce(&OnSharedDictionaryUsageLoaded, this, completion));
   }
 
-  // Interest Groups
-  if (is_interest_group_enabled) {
-    content::InterestGroupManager* manager =
-        storage_partition_->GetInterestGroupManager();
-    if (manager) {
-      manager->GetAllInterestGroupDataKeys(
-          base::BindOnce(&OnInterestGroupsLoaded, this, completion));
-    }
-  }
-
-  // Attribution Reporting
-  if (is_attribution_reporting_enabled) {
-    storage_partition_->GetAttributionDataModel()->GetAllDataKeys(
-        base::BindOnce(&OnAttributionReportingLoaded, this, completion));
-  }
 
-  // Private Aggregation
-  if (is_private_aggregation_enabled) {
-    storage_partition_->GetPrivateAggregationDataModel()->GetAllDataKeys(
-        base::BindOnce(&OnPrivateAggregationLoaded, this, completion));
-  }
 
 #if BUILDFLAG(ENABLE_LIBRARY_CDMS)
   storage_partition_->GetCdmStorageDataModel()->GetUsagePerAllStorageKeys(
--- a/components/privacy_sandbox/privacy_sandbox_settings_impl.cc
+++ b/components/privacy_sandbox/privacy_sandbox_settings_impl.cc
@@ -131,7 +131,7 @@ std::set<browsing_topics::Topic> GetTopi
 
 // static
 bool PrivacySandboxSettingsImpl::IsAllowed(Status status) {
-  return status == Status::kAllowed;
+  return false;
 }
 
 // static
@@ -850,7 +850,7 @@ void PrivacySandboxSettingsImpl::SetTopi
 }
 
 bool PrivacySandboxSettingsImpl::IsPrivacySandboxRestricted() const {
-  return delegate_->IsPrivacySandboxRestricted();
+  return true;
 }
 
 bool PrivacySandboxSettingsImpl::IsPrivacySandboxCurrentlyUnrestricted() const {
@@ -936,11 +936,7 @@ PrivacySandboxSettingsImpl::GetPrivacySa
     return Status::kIncognitoProfile;
   }
 
-  if (IsPrivacySandboxRestricted() && !should_ignore_restriction) {
     return Status::kRestricted;
-  }
-
-  return Status::kAllowed;
 }
 
 PrivacySandboxSettingsImpl::Status
--- a/content/browser/attribution_reporting/attribution_suitable_context.cc
+++ b/content/browser/attribution_reporting/attribution_suitable_context.cc
@@ -44,67 +44,7 @@ std::optional<AttributionSuitableContext
 // static
 std::optional<AttributionSuitableContext> AttributionSuitableContext::Create(
     RenderFrameHostImpl* initiator_frame) {
-  if (!initiator_frame) {
     return std::nullopt;
-  }
-
-  if (!base::FeatureList::IsEnabled(
-          attribution_reporting::features::kConversionMeasurement)) {
-    return std::nullopt;
-  }
-
-  if (!initiator_frame->IsFeatureEnabled(
-          network::mojom::PermissionsPolicyFeature::kAttributionReporting)) {
-    return std::nullopt;
-  }
-  RenderFrameHostImpl* initiator_root_frame =
-      initiator_frame->GetOutermostMainFrame();
-  CHECK(initiator_root_frame);
-
-  // We need a suitable origin here because we need to be able to eventually
-  // store it as either the source or destination origin. Using
-  // `is_web_secure_context` only would allow opaque origins to pass through,
-  // but they cannot be handled by the storage layer.
-  std::optional<attribution_reporting::SuitableOrigin>
-      initiator_root_frame_origin = SuitableOrigin::Create(
-          initiator_root_frame->GetLastCommittedOrigin());
-  if (!initiator_root_frame_origin.has_value()) {
-    return std::nullopt;
-  }
-  // If the `initiator_frame` is a subframe, it's origin's security isn't
-  // covered by the SuitableOrigin check above, we therefore validate that it's
-  // origin is secure using `is_web_secure_context`.
-  if (initiator_frame != initiator_root_frame &&
-      !initiator_frame->policy_container_host()
-           ->policies()
-           .is_web_secure_context) {
-    return std::nullopt;
-  }
-
-  auto* web_contents = WebContents::FromRenderFrameHost(initiator_frame);
-  if (!web_contents) {
-    return std::nullopt;
-  }
-  auto* manager = AttributionManager::FromWebContents(web_contents);
-  CHECK(manager);
-
-  auto* attribution_host = AttributionHost::FromWebContents(web_contents);
-  CHECK(attribution_host);
-
-  AttributionDataHostManager* data_host_manager = manager->GetDataHostManager();
-  CHECK(data_host_manager);
-
-  return AttributionSuitableContext(
-      /*context_origin=*/std::move(initiator_root_frame_origin.value()),
-      initiator_frame->IsNestedWithinFencedFrame(),
-      initiator_root_frame->GetGlobalId(), initiator_frame->navigation_id(),
-      attribution_host->GetMostRecentNavigationInputEvent(),
-      AttributionOsLevelManager::GetAttributionReportingOsRegistrars(
-          web_contents),
-      !url_matcher::util::GetGoogleAmpViewerEmbeddedURL(
-           initiator_root_frame->GetLastCommittedURL())
-           .is_empty(),
-      data_host_manager->AsWeakPtr());
 }
 
 // static
--- a/content/browser/interest_group/ad_auction_service_impl.cc
+++ b/content/browser/interest_group/ad_auction_service_impl.cc
@@ -217,11 +217,6 @@ AdAuctionServiceImpl::BiddingAndAuctionD
 void AdAuctionServiceImpl::CreateMojoService(
     RenderFrameHost* render_frame_host,
     mojo::PendingReceiver<blink::mojom::AdAuctionService> receiver) {
-  CHECK(render_frame_host);
-
-  // The object is bound to the lifetime of `render_frame_host` and the mojo
-  // connection. See DocumentService for details.
-  new AdAuctionServiceImpl(*render_frame_host, std::move(receiver));
 }
 
 void AdAuctionServiceImpl::JoinInterestGroup(
--- a/content/browser/storage_partition_impl.cc
+++ b/content/browser/storage_partition_impl.cc
@@ -1482,38 +1482,7 @@ void StoragePartitionImpl::Initialize(
 
   bucket_manager_ = std::make_unique<BucketManager>(this);
 
-  if (base::FeatureList::IsEnabled(
-          attribution_reporting::features::kConversionMeasurement)) {
-    // The Conversion Measurement API is not available in Incognito mode, but
-    // this is enforced by the `AttributionManagerImpl` itself for better error
-    // reporting and metrics.
-    attribution_manager_ = std::make_unique<AttributionManagerImpl>(
-        this, path, special_storage_policy_);
-  }
 
-  if (base::FeatureList::IsEnabled(blink::features::kInterestGroupStorage)) {
-    // Auction worklets on non-Android use dedicated processes; on Android due
-    // to high cost of process launch they try to reuse renderers.
-    interest_group_manager_ = std::make_unique<InterestGroupManagerImpl>(
-        path, is_in_memory(),
-#if BUILDFLAG(IS_ANDROID)
-        InterestGroupManagerImpl::ProcessMode::kInRenderer,
-#else
-        InterestGroupManagerImpl::ProcessMode::kDedicated,
-#endif
-        GetURLLoaderFactoryForBrowserProcess(),
-        base::BindRepeating(&BrowserContext::GetKAnonymityServiceDelegate,
-                            // This use of Unretained is safe since the browser
-                            // context owns this storage partition.
-                            base::Unretained(browser_context_)));
-  }
-
-  // The Topics API is not available in Incognito mode.
-  if (!is_in_memory() &&
-      base::FeatureList::IsEnabled(blink::features::kBrowsingTopics)) {
-    browsing_topics_site_data_manager_ =
-        std::make_unique<BrowsingTopicsSiteDataManagerImpl>(path);
-  }
 
   GeneratedCodeCacheSettings settings =
       GetContentClient()->browser()->GetGeneratedCodeCacheSettings(
@@ -1542,8 +1511,6 @@ void StoragePartitionImpl::Initialize(
 
   font_access_manager_ = FontAccessManager::Create();
 
-  aggregation_service_ =
-      std::make_unique<AggregationServiceImpl>(is_in_memory(), path, this);
 
 #if BUILDFLAG(ENABLE_LIBRARY_CDMS)
   if (is_in_memory()) {
@@ -1567,11 +1534,6 @@ void StoragePartitionImpl::Initialize(
         std::make_unique<SharedStorageHeaderObserver>(this);
   }
 
-  if (base::FeatureList::IsEnabled(blink::features::kPrivateAggregationApi)) {
-    private_aggregation_manager_ =
-        std::make_unique<PrivateAggregationManagerImpl>(is_in_memory(), path,
-                                                        this);
-  }
 }
 
 void StoragePartitionImpl::OnStorageServiceDisconnected() {
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3857,12 +3857,6 @@ void WebContentsImpl::Init(const WebCont
   DateTimeChooser::CreateDateTimeChooser(this);
 #endif
 
-  // AttributionHost must be created after `view_->CreateView()` is called as it
-  // may invoke `WebContentsAndroid::AddObserver()`.
-  if (base::FeatureList::IsEnabled(
-          attribution_reporting::features::kConversionMeasurement)) {
-    AttributionHost::CreateForWebContents(this);
-  }
 
   RedirectChainDetector::CreateForWebContents(this);
   BtmWebContentsObserver::MaybeCreateForWebContents(this);
--- a/content/services/auction_worklet/private_aggregation_bindings.cc
+++ b/content/services/auction_worklet/private_aggregation_bindings.cc
@@ -402,56 +402,6 @@ PrivateAggregationBindings::~PrivateAggr
 
 void PrivateAggregationBindings::AttachToContext(
     v8::Local<v8::Context> context) {
-  if (!base::FeatureList::IsEnabled(blink::features::kPrivateAggregationApi) ||
-      !blink::features::kPrivateAggregationApiEnabledInProtectedAudience
-           .Get()) {
-    return;
-  }
-
-  v8::Local<v8::External> v8_this =
-      v8::External::New(v8_helper_->isolate(), this);
-
-  v8::Local<v8::Object> private_aggregation =
-      v8::Object::New(v8_helper_->isolate());
-
-  v8::Local<v8::Function> send_histogram_report_function =
-      v8::Function::New(
-          context, &PrivateAggregationBindings::ContributeToHistogram, v8_this)
-          .ToLocalChecked();
-  private_aggregation
-      ->Set(context,
-            v8_helper_->CreateStringFromLiteral("contributeToHistogram"),
-            send_histogram_report_function)
-      .Check();
-
-  if (blink::features::kPrivateAggregationApiProtectedAudienceExtensionsEnabled
-          .Get()) {
-    v8::Local<v8::Function> report_contribution_for_event_function =
-        v8::Function::New(
-            context, &PrivateAggregationBindings::ContributeToHistogramOnEvent,
-            v8_this)
-            .ToLocalChecked();
-    private_aggregation
-        ->Set(
-            context,
-            v8_helper_->CreateStringFromLiteral("contributeToHistogramOnEvent"),
-            report_contribution_for_event_function)
-        .Check();
-  }
-
-  v8::Local<v8::Function> enable_debug_mode_function =
-      v8::Function::New(context, &PrivateAggregationBindings::EnableDebugMode,
-                        v8_this)
-          .ToLocalChecked();
-  private_aggregation
-      ->Set(context, v8_helper_->CreateStringFromLiteral("enableDebugMode"),
-            enable_debug_mode_function)
-      .Check();
-
-  context->Global()
-      ->Set(context, v8_helper_->CreateStringFromLiteral("privateAggregation"),
-            private_aggregation)
-      .Check();
 }
 
 void PrivateAggregationBindings::Reset() {