summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-02-24 14:55:26 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-04 10:20:18 +0200
commit00fcdc21075a92598170cb59954bbb1b3933fdb4 (patch)
tree88bd1a6a74ba60befd3309b7a1d85b808193e1f5
parent71a0420622cf96d9d436a22fc31dfa9434a28cf0 (diff)
downloadqtwebengine-chromium-00fcdc21075a92598170cb59954bbb1b3933fdb4.tar.gz
Fix for our tests
Change-Id: Ia2bf55a221161e4b404f47b4c9f4e9a5111ddd56 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
-rw-r--r--chromium/content/browser/web_contents/web_contents_impl.cc10
-rw-r--r--chromium/media/capture/content/capture_resolution_chooser.cc8
-rw-r--r--chromium/ui/base/webui/web_ui_util.cc17
3 files changed, 22 insertions, 13 deletions
diff --git a/chromium/content/browser/web_contents/web_contents_impl.cc b/chromium/content/browser/web_contents/web_contents_impl.cc
index dace45aea27..308879e2c46 100644
--- a/chromium/content/browser/web_contents/web_contents_impl.cc
+++ b/chromium/content/browser/web_contents/web_contents_impl.cc
@@ -3825,6 +3825,10 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow(
// new window. As a result, we need to show and navigate the window here.
bool was_blocked = false;
+ // The delegate may delete |opener| during AddNewContents().
+ auto initiator_origin = opener->GetLastCommittedOrigin();
+ auto initiator_process_id = opener->GetProcess()->GetID();
+ auto initiator_frame_token = opener->GetFrameToken();
if (delegate_) {
base::WeakPtr<WebContentsImpl> weak_new_contents =
new_contents_impl->weak_factory_.GetWeakPtr();
@@ -3842,9 +3846,9 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow(
std::unique_ptr<NavigationController::LoadURLParams> load_params =
std::make_unique<NavigationController::LoadURLParams>(
params.target_url);
- load_params->initiator_origin = opener->GetLastCommittedOrigin();
- load_params->initiator_process_id = opener->GetProcess()->GetID();
- load_params->initiator_frame_token = opener->GetFrameToken();
+ load_params->initiator_origin = initiator_origin;
+ load_params->initiator_process_id = initiator_process_id;
+ load_params->initiator_frame_token = initiator_frame_token;
// Avoiding setting |load_params->source_site_instance| when
// |opener_suppressed| is true, because in that case we do not want to use
// the old SiteInstance and/or BrowsingInstance. See also the test here:
diff --git a/chromium/media/capture/content/capture_resolution_chooser.cc b/chromium/media/capture/content/capture_resolution_chooser.cc
index 496ae311fa9..087305df289 100644
--- a/chromium/media/capture/content/capture_resolution_chooser.cc
+++ b/chromium/media/capture/content/capture_resolution_chooser.cc
@@ -70,10 +70,10 @@ CaptureResolutionChooser::~CaptureResolutionChooser() = default;
void CaptureResolutionChooser::SetConstraints(const gfx::Size& min_frame_size,
const gfx::Size& max_frame_size,
bool use_fixed_aspect_ratio) {
- DCHECK_LT(0, min_frame_size.width());
- DCHECK_LT(0, min_frame_size.height());
- DCHECK_LE(min_frame_size.width(), max_frame_size.width());
- DCHECK_LE(min_frame_size.height(), max_frame_size.height());
+// DCHECK_LT(0, min_frame_size.width());
+// DCHECK_LT(0, min_frame_size.height());
+// DCHECK_LE(min_frame_size.width(), max_frame_size.width());
+// DCHECK_LE(min_frame_size.height(), max_frame_size.height());
min_frame_size_ = min_frame_size;
max_frame_size_ = max_frame_size;
diff --git a/chromium/ui/base/webui/web_ui_util.cc b/chromium/ui/base/webui/web_ui_util.cc
index c6cd6de9ee1..c02a50d93df 100644
--- a/chromium/ui/base/webui/web_ui_util.cc
+++ b/chromium/ui/base/webui/web_ui_util.cc
@@ -7,6 +7,7 @@
#include <vector>
#include "base/base64.h"
+#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/i18n/rtl.h"
#include "base/logging.h"
@@ -17,6 +18,7 @@
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "content/public/common/content_switches.h"
#include "net/base/escape.h"
#include "third_party/modp_b64/modp_b64.h"
#include "ui/base/l10n/l10n_util.h"
@@ -225,12 +227,15 @@ std::string GetFontFamily() {
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
- std::string font_name = ui::ResourceBundle::GetSharedInstance()
- .GetFont(ui::ResourceBundle::BaseFont)
- .GetFontName();
- // Wrap |font_name| with quotes to ensure it will always be parsed correctly
- // in CSS.
- font_family = "\"" + font_name + "\", " + font_family;
+ const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
+ if (!cmdline->HasSwitch(switches::kSingleProcess)) {
+ std::string font_name = ui::ResourceBundle::GetSharedInstance()
+ .GetFont(ui::ResourceBundle::BaseFont)
+ .GetFontName();
+ // Wrap |font_name| with quotes to ensure it will always be parsed correctly
+ // in CSS.
+ font_family = "\"" + font_name + "\", " + font_family;
+ }
#endif
return font_family;