Skip to content

Commit 9063693

Browse files
Allan Sandfeld Jensenpatricia-gallardo
authored andcommitted
Adaptations for Chromium 85
Change-Id: I33c1af7c431055d95e0fb540246765cce684de15 Reviewed-by: Peter Varga <[email protected]>
1 parent 1ce0ce1 commit 9063693

38 files changed

+172
-142
lines changed

src/buildtools/config/linux.pri

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ gn_args += \
1717
enable_session_service=false \
1818
is_cfi=false \
1919
use_ozone=true \
20+
use_x11=false \
2021
ozone_auto_platforms=false \
2122
ozone_platform_headless=false \
2223
ozone_platform_external=true \

src/core/browser_main_parts_qt.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141

4242
#include "api/qwebenginemessagepumpscheduler_p.h"
4343

44-
#include "base/message_loop/message_loop.h"
4544
#include "base/message_loop/message_loop_current.h"
4645
#include "base/message_loop/message_pump_for_ui.h"
4746
#include "base/process/process.h"

src/core/browsing_data_remover_delegate_qt.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
namespace QtWebEngineCore {
5050

51-
bool DoesOriginMatchEmbedderMask(int origin_type_mask,
51+
bool DoesOriginMatchEmbedderMask(uint64_t origin_type_mask,
5252
const url::Origin &origin,
5353
storage::SpecialStoragePolicy *policy)
5454
{
@@ -70,9 +70,9 @@ bool BrowsingDataRemoverDelegateQt::MayRemoveDownloadHistory()
7070

7171
void BrowsingDataRemoverDelegateQt::RemoveEmbedderData(const base::Time &delete_begin,
7272
const base::Time &delete_end,
73-
int remove_mask,
73+
uint64_t remove_mask,
7474
content::BrowsingDataFilterBuilder *filter_builder,
75-
int origin_type_mask,
75+
uint64_t origin_type_mask,
7676
base::OnceClosure callback)
7777
{
7878
Q_UNUSED(delete_begin);
@@ -86,4 +86,9 @@ void BrowsingDataRemoverDelegateQt::RemoveEmbedderData(const base::Time &delete_
8686
std::move(callback).Run();
8787
}
8888

89+
std::vector<std::string> BrowsingDataRemoverDelegateQt::GetDomainsForDeferredCookieDeletion(uint64_t)
90+
{
91+
return {};
92+
}
93+
8994
} // namespace QtWebEngineCore

src/core/browsing_data_remover_delegate_qt.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ class BrowsingDataRemoverDelegateQt : public content::BrowsingDataRemoverDelegat
5555
void RemoveEmbedderData(
5656
const base::Time &delete_begin,
5757
const base::Time &delete_end,
58-
int remove_mask,
58+
uint64_t remove_mask,
5959
content::BrowsingDataFilterBuilder *filter_builder,
60-
int origin_type_mask,
60+
uint64_t origin_type_mask,
6161
base::OnceClosure callback) override;
62+
std::vector<std::string> GetDomainsForDeferredCookieDeletion(uint64_t) override;
6263
};
6364

6465
} // namespace QtWebEngineCore

src/core/content_browser_client_qt.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include "base/optional.h"
4444
#include "base/path_service.h"
4545
#include "base/strings/utf_string_conversions.h"
46-
#include "base/message_loop/message_loop.h"
4746
#include "base/task/post_task.h"
4847
#include "base/threading/thread_restrictions.h"
4948
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
@@ -366,7 +365,7 @@ void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost
366365
#endif //ENABLE_EXTENSIONS
367366

368367
bool is_incognito_process = profile->IsOffTheRecord();
369-
qtwebengine::mojom::RendererConfigurationAssociatedPtr renderer_configuration;
368+
mojo::AssociatedRemote<qtwebengine::mojom::RendererConfiguration> renderer_configuration;
370369
host->GetChannel()->GetRemoteAssociatedInterface(&renderer_configuration);
371370
renderer_configuration->SetInitialConfiguration(is_incognito_process);
372371
}

src/core/download_manager_delegate_qt.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ void DownloadManagerDelegateQt::cancelDownload(content::DownloadTargetCallback c
9595
download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT,
9696
download::DownloadItem::UNKNOWN,
9797
base::FilePath(),
98+
base::nullopt,
9899
download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED);
99100
}
100101

@@ -135,6 +136,7 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
135136
download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
136137
download::DownloadItem::VALIDATED,
137138
item->GetForcedFilePath(),
139+
base::nullopt,
138140
download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE);
139141
return true;
140142
}
@@ -226,6 +228,7 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
226228
download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT,
227229
download::DownloadItem::VALIDATED,
228230
filePathForCallback.AddExtension(toFilePathString("download")),
231+
base::nullopt,
229232
download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE);
230233
} else
231234
cancelDownload(std::move(*callback));

src/core/extensions/component_extension_resource_manager_qt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include <map>
4848

4949
#include "base/files/file_path.h"
50+
#include "base/macros.h"
5051
#include "extensions/browser/component_extension_resource_manager.h"
5152

5253
struct GritResourceMap;

src/core/extensions/extension_system_qt.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
#include "extensions/browser/quota_service.h"
8484
#include "extensions/browser/renderer_startup_helper.h"
8585
#include "extensions/browser/runtime_data.h"
86-
#include "extensions/browser/shared_user_script_master.h"
86+
#include "extensions/browser/shared_user_script_manager.h"
8787
#include "extensions/browser/service_worker_manager.h"
8888
#include "extensions/browser/value_store/value_store_factory_impl.h"
8989
#include "extensions/common/constants.h"
@@ -278,9 +278,9 @@ ManagementPolicy *ExtensionSystemQt::management_policy()
278278
return nullptr;
279279
}
280280

281-
SharedUserScriptMaster *ExtensionSystemQt::shared_user_script_master()
281+
SharedUserScriptManager *ExtensionSystemQt::shared_user_script_manager()
282282
{
283-
return shared_user_script_master_.get();
283+
return shared_user_script_manager_.get();
284284
}
285285

286286
StateStore *ExtensionSystemQt::state_store()
@@ -349,19 +349,15 @@ void ExtensionSystemQt::Init(bool extensions_enabled)
349349
quota_service_.reset(new QuotaService);
350350
app_sorting_.reset(new NullAppSorting);
351351

352-
shared_user_script_master_ =
353-
std::make_unique<SharedUserScriptMaster>(browser_context_);
352+
shared_user_script_manager_ =
353+
std::make_unique<SharedUserScriptManager>(browser_context_);
354354

355355
// Make the chrome://extension-icon/ resource available.
356356
// content::URLDataSource::Add(browser_context_, new ExtensionIconSource(browser_context_));
357357

358358
if (extensions_enabled) {
359359
// Inform the rest of the extensions system to start.
360360
ready_.Signal();
361-
content::NotificationService::current()->Notify(
362-
NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
363-
content::Source<content::BrowserContext>(browser_context_),
364-
content::NotificationService::NoDetails());
365361

366362
std::string pdf_manifest = ui::ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_PDF_MANIFEST).as_string();
367363
base::ReplaceFirstSubstringAfterOffset(&pdf_manifest, 0, "<NAME>", "chromium-pdf");
@@ -432,4 +428,10 @@ void ExtensionSystemQt::UnregisterExtensionWithRequestContexts(const std::string
432428
FROM_HERE, {BrowserThread::IO},
433429
base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason));
434430
}
431+
432+
bool ExtensionSystemQt::is_ready() const
433+
{
434+
return ready_.is_signaled();
435+
}
436+
435437
} // namespace extensions

src/core/extensions/extension_system_qt.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class ExtensionSystemQt : public ExtensionSystem
8989
RuntimeData *runtime_data() override;
9090
ManagementPolicy *management_policy() override;
9191
ServiceWorkerManager *service_worker_manager() override;
92-
SharedUserScriptMaster *shared_user_script_master() override;
92+
SharedUserScriptManager *shared_user_script_manager() override;
9393
StateStore *state_store() override;
9494
StateStore *rules_store() override;
9595
scoped_refptr<ValueStoreFactory> store_factory() override;
@@ -122,6 +122,7 @@ class ExtensionSystemQt : public ExtensionSystem
122122
void Init(bool extensions_enabled);
123123

124124
const base::OneShotEvent &ready() const override { return ready_; }
125+
bool is_ready() const override;
125126

126127
private:
127128
void OnExtensionRegisteredWithRequestContexts(scoped_refptr<const extensions::Extension> extension);
@@ -137,7 +138,7 @@ class ExtensionSystemQt : public ExtensionSystem
137138
std::unique_ptr<RuntimeData> runtime_data_;
138139
std::unique_ptr<QuotaService> quota_service_;
139140
std::unique_ptr<AppSorting> app_sorting_;
140-
std::unique_ptr<SharedUserScriptMaster> shared_user_script_master_;
141+
std::unique_ptr<SharedUserScriptManager> shared_user_script_manager_;
141142

142143

143144
// For verifying the contents of extensions read from disk.

src/core/find_text_helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void FindTextHelper::startFinding(const QString &findText, bool caseSensitively,
116116
blink::mojom::FindOptionsPtr options = blink::mojom::FindOptions::New();
117117
options->forward = !findBackward;
118118
options->match_case = caseSensitively;
119-
options->find_next = findText == m_previousFindText;
119+
options->new_session = findText != m_previousFindText;
120120
m_previousFindText = findText;
121121

122122
m_currentFindRequestId = m_findRequestIdCounter++;

src/core/location_provider_qt.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050

5151
#include "base/bind.h"
5252
#include "base/memory/weak_ptr.h"
53-
#include "base/message_loop/message_loop.h"
5453
#include "content/public/browser/browser_thread.h"
5554
#include "services/device/geolocation/geolocation_provider.h"
5655
#include "services/device/geolocation/geolocation_provider_impl.h"

src/core/location_provider_qt.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@
4747

4848
QT_FORWARD_DECLARE_CLASS(QThread)
4949

50-
namespace base {
51-
class MessageLoop;
52-
}
53-
5450
namespace QtWebEngineCore {
5551
class QtPositioningHelper;
5652

src/core/net/cookie_monster_delegate_qt.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,15 @@ void CookieMonsterDelegateQt::setCookie(quint64 callbackId, const QNetworkCookie
143143

144144
if (callbackId != CallbackDirectory::NoCallbackId)
145145
callback = base::BindOnce(&CookieMonsterDelegateQt::SetCookieCallbackOnUIThread, this, callbackId);
146-
net::CanonicalCookie::CookieInclusionStatus inclusion;
146+
net::CookieInclusionStatus inclusion;
147147
auto canonCookie = net::CanonicalCookie::Create(gurl, cookie_line, base::Time::Now(), base::nullopt, &inclusion);
148148
if (!inclusion.IsInclude()) {
149149
LOG(WARNING) << "QWebEngineCookieStore::setCookie() - Tried to set invalid cookie";
150150
return;
151151
}
152152
net::CookieOptions options;
153153
options.set_include_httponly();
154+
options.set_same_site_cookie_context(net::CookieOptions::SameSiteCookieContext::MakeInclusiveForSet());
154155
m_mojoCookieManager->SetCanonicalCookie(*canonCookie.get(), gurl, options, std::move(callback));
155156
}
156157

@@ -272,7 +273,7 @@ void CookieMonsterDelegateQt::GetAllCookiesCallbackOnUIThread(qint64 callbackId,
272273
m_client->d_func()->onGetAllCallbackResult(callbackId, rawCookies);
273274
}
274275

275-
void CookieMonsterDelegateQt::SetCookieCallbackOnUIThread(qint64 callbackId, net::CanonicalCookie::CookieInclusionStatus status)
276+
void CookieMonsterDelegateQt::SetCookieCallbackOnUIThread(qint64 callbackId, net::CookieInclusionStatus status)
276277
{
277278
if (m_client)
278279
m_client->d_func()->onSetCallbackResult(callbackId, status.IsInclude());

src/core/net/cookie_monster_delegate_qt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT CookieMonsterDelegateQt : public base::RefC
120120

121121
private:
122122
void GetAllCookiesCallbackOnUIThread(qint64 callbackId, const net::CookieList &cookies);
123-
void SetCookieCallbackOnUIThread(qint64 callbackId, net::CanonicalCookie::CookieInclusionStatus status);
123+
void SetCookieCallbackOnUIThread(qint64 callbackId, net::CookieInclusionStatus status);
124124
void DeleteCookiesCallbackOnUIThread(qint64 callbackId, uint numCookies);
125125
};
126126

src/core/net/proxying_restricted_cookie_manager_qt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void ProxyingRestrictedCookieManagerQt::GetAllForUrl(const GURL &url,
126126
if (allowCookies(url, site_for_cookies)) {
127127
underlying_restricted_cookie_manager_->GetAllForUrl(url, site_for_cookies, top_frame_origin, std::move(options), std::move(callback));
128128
} else {
129-
std::move(callback).Run(std::vector<net::CanonicalCookie>());
129+
std::move(callback).Run(std::vector<net::CookieWithAccessResult>());
130130
}
131131
}
132132

src/core/net/system_network_context_manager.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
#include "components/network_session_configurator/common/network_switches.h"
6565
#include "content/public/browser/browser_task_traits.h"
6666
#include "content/public/browser/browser_thread.h"
67-
#include "content/public/browser/cors_exempt_headers.h"
6867
#include "content/public/browser/network_service_instance.h"
6968
#include "content/public/common/content_features.h"
7069
#include "content/public/common/content_switches.h"
@@ -241,8 +240,7 @@ void SystemNetworkContextManager::OnNetworkServiceCreated(network::mojom::Networ
241240
network_service->SetUpHttpAuth(CreateHttpAuthStaticParams());
242241
network_service->ConfigureHttpAuthPrefs(CreateHttpAuthDynamicParams());
243242

244-
// The system NetworkContext must be created first, since it sets
245-
// |primary_network_context| to true.
243+
// The system NetworkContext is created first
246244
network_service_network_context_.reset();
247245
network_service->CreateNetworkContext(
248246
network_service_network_context_.BindNewPipeAndPassReceiver(),
@@ -265,8 +263,6 @@ void SystemNetworkContextManager::AddSSLConfigToNetworkContextParams(network::mo
265263

266264
void SystemNetworkContextManager::ConfigureDefaultNetworkContextParams(network::mojom::NetworkContextParams *network_context_params)
267265
{
268-
content::UpdateCorsExemptHeader(network_context_params);
269-
270266
network_context_params->enable_brotli = true;
271267

272268
// Disable referrers by default. Any consumer that enables referrers should
@@ -309,8 +305,6 @@ network::mojom::NetworkContextParamsPtr SystemNetworkContextManager::CreateNetwo
309305
network_context_params->enable_ftp_url_support = true;
310306
#endif
311307

312-
network_context_params->primary_network_context = false;
313-
314308
proxy_config_monitor_.AddToNetworkContextParams(network_context_params.get());
315309

316310
return network_context_params;

src/core/ozone/ozone_platform_qt.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
#include "ozone_platform_qt.h"
4141

4242
#if defined(USE_OZONE)
43+
#include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
4344
#include "ui/base/ime/input_method.h"
4445
#include "ui/display/types/native_display_delegate.h"
4546
#include "ui/ozone/common/stub_client_native_pixmap_factory.h"
4647
#include "ui/ozone/common/stub_overlay_manager.h"
47-
#include "ui/ozone/public/cursor_factory_ozone.h"
4848
#include "ui/ozone/public/gpu_platform_support_host.h"
4949
#include "ui/ozone/public/input_controller.h"
5050
#include "ui/ozone/public/ozone_platform.h"
@@ -66,7 +66,7 @@ class OzonePlatformQt : public OzonePlatform {
6666
~OzonePlatformQt() override;
6767

6868
ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override;
69-
ui::CursorFactoryOzone* GetCursorFactoryOzone() override;
69+
ui::CursorFactory* GetCursorFactory() override;
7070
GpuPlatformSupportHost* GetGpuPlatformSupportHost() override;
7171
std::unique_ptr<PlatformWindow> CreatePlatformWindow(PlatformWindowDelegate* delegate, PlatformWindowInitProperties properties) override;
7272
std::unique_ptr<display::NativeDisplayDelegate> CreateNativeDisplayDelegate() override;
@@ -80,7 +80,7 @@ class OzonePlatformQt : public OzonePlatform {
8080
void InitializeGPU(const ui::OzonePlatform::InitParams &) override;
8181

8282
std::unique_ptr<QtWebEngineCore::SurfaceFactoryQt> surface_factory_ozone_;
83-
std::unique_ptr<CursorFactoryOzone> cursor_factory_ozone_;
83+
std::unique_ptr<CursorFactory> cursor_factory_ozone_;
8484

8585
std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_;
8686
std::unique_ptr<InputController> input_controller_;
@@ -99,7 +99,7 @@ ui::SurfaceFactoryOzone* OzonePlatformQt::GetSurfaceFactoryOzone()
9999
return surface_factory_ozone_.get();
100100
}
101101

102-
ui::CursorFactoryOzone* OzonePlatformQt::GetCursorFactoryOzone()
102+
ui::CursorFactory* OzonePlatformQt::GetCursorFactory()
103103
{
104104
return cursor_factory_ozone_.get();
105105
}
@@ -138,7 +138,7 @@ std::unique_ptr<display::NativeDisplayDelegate> OzonePlatformQt::CreateNativeDis
138138
void OzonePlatformQt::InitializeUI(const ui::OzonePlatform::InitParams &)
139139
{
140140
overlay_manager_.reset(new StubOverlayManager());
141-
cursor_factory_ozone_.reset(new CursorFactoryOzone());
141+
cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone());
142142
gpu_platform_support_host_.reset(ui::CreateStubGpuPlatformSupportHost());
143143
input_controller_ = CreateStubInputController();
144144
}

src/core/printing/print_view_manager_base_qt.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include "web_engine_context.h"
4949

5050
#include "base/memory/ref_counted_memory.h"
51-
#include "base/message_loop/message_loop.h"
5251
#include "base/message_loop/message_loop_current.h"
5352
#include "base/run_loop.h"
5453
#include "base/single_thread_task_runner.h"
@@ -157,7 +156,7 @@ void PrintViewManagerBaseQt::OnDidPrintDocument(content::RenderFrameHost* /*rend
157156
if (!document)
158157
return;
159158

160-
const PrintHostMsg_DidPrintContent_Params &content = params.content;
159+
const auto &content = params.content;
161160
if (!content.metafile_data_region.IsValid()) {
162161
NOTREACHED() << "invalid memory handle";
163162
web_contents()->Stop();

src/core/printing/print_view_manager_qt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ bool PrintViewManagerQt::PrintToPDFInternal(const QPageLayout &pageLayout,
266266
m_printSettings->SetInteger(printing::kSettingColor,
267267
printInColor ? printing::COLOR : printing::GRAYSCALE);
268268

269-
if (web_contents()->ShowingInterstitialPage() || web_contents()->IsCrashed())
269+
if (web_contents()->IsCrashed())
270270
return false;
271271

272272
content::RenderFrameHost* rfh = web_contents()->GetMainFrame();

src/core/profile_io_data_qt.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ void ProfileIODataQt::setFullConfiguration()
177177
m_httpCacheType = m_profileAdapter->httpCacheType();
178178
m_httpCachePath = m_profileAdapter->httpCachePath();
179179
m_httpCacheMaxSize = m_profileAdapter->httpCacheMaxSize();
180-
m_useForGlobalCertificateVerification = m_profileAdapter->isUsedForGlobalCertificateVerification();
181180
m_dataPath = m_profileAdapter->dataPath();
182181
m_storageName = m_profileAdapter->storageName();
183182
m_inMemoryOnly = m_profileAdapter->isOffTheRecord() || m_storageName.isEmpty();
@@ -256,7 +255,6 @@ void ProfileIODataQt::ConfigureNetworkContextParams(bool in_memory,
256255
#endif // !BUILDFLAG(DISABLE_FTP_SUPPORT)
257256

258257
network_context_params->enforce_chrome_ct_policy = false;
259-
network_context_params->primary_network_context = m_useForGlobalCertificateVerification;
260258

261259
// Should be initialized with existing per-profile CORS access lists.
262260
network_context_params->cors_origin_access_list =

src/core/profile_io_data_qt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ class ProfileIODataQt {
145145
QRecursiveMutex m_mutex;
146146
#endif
147147
int m_httpCacheMaxSize = 0;
148-
bool m_useForGlobalCertificateVerification = false;
149148
BrowsingDataRemoverObserverQt m_removerObserver;
150149
QString m_dataPath;
151150
bool m_clearHttpCacheInProgress = false;

0 commit comments

Comments
 (0)