Suppress a few -Wunreachable-code warnings on iOS and Android.
While here, also replace an LOG(INFO) with a DLOG(INFO) on Windows for a LOG(INFO) that had a TODO to switch to DLOG once crbug.com/730068 is fixed (which it now is). Other than that, no behavior change. Bug: 730068,346399 Change-Id: Ifa5cef7e27f3fc2f45ac30fe2769eeb6c44b5d5a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2113738 Auto-Submit: Nico Weber <thakis@chromium.org> Reviewed-by: Jochen Eisinger <jochen@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org> Cr-Commit-Position: refs/heads/master@{#752493}
This commit is contained in:
base/android
chrome/browser
download
metrics
profiles
components
password_manager
core
safe_browsing
content
password_protection
content/shell/browser
ios/chrome/browser/ui/util
media/capture/video
rlz/lib
sandbox/linux/integration_tests
third_party/blink/renderer/modules
ui/gfx
weblayer/shell/app
@@ -274,9 +274,6 @@ TEST_F(JavaObjectArrayReaderTest, ZeroLengthArray) {
|
|||||||
EXPECT_TRUE(zero_length.empty());
|
EXPECT_TRUE(zero_length.empty());
|
||||||
EXPECT_EQ(zero_length.size(), 0);
|
EXPECT_EQ(zero_length.size(), 0);
|
||||||
EXPECT_EQ(zero_length.begin(), zero_length.end());
|
EXPECT_EQ(zero_length.begin(), zero_length.end());
|
||||||
for (auto element : zero_length) {
|
|
||||||
FAIL() << "Loop body should not execute";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify that we satisfy the C++ "InputIterator" named requirements.
|
// Verify that we satisfy the C++ "InputIterator" named requirements.
|
||||||
|
@@ -683,16 +683,13 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
|
|||||||
|
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
DownloadUtils::OpenDownload(download, DownloadOpenSource::kUnknown);
|
DownloadUtils::OpenDownload(download, DownloadOpenSource::kUnknown);
|
||||||
return;
|
#else
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!DownloadItemModel(download).ShouldPreferOpeningInBrowser()) {
|
if (!DownloadItemModel(download).ShouldPreferOpeningInBrowser()) {
|
||||||
RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_PLATFORM);
|
RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_PLATFORM);
|
||||||
OpenDownloadUsingPlatformHandler(download);
|
OpenDownloadUsingPlatformHandler(download);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(OS_ANDROID)
|
|
||||||
content::WebContents* web_contents =
|
content::WebContents* web_contents =
|
||||||
content::DownloadItemUtils::GetWebContents(download);
|
content::DownloadItemUtils::GetWebContents(download);
|
||||||
Browser* browser =
|
Browser* browser =
|
||||||
@@ -714,9 +711,6 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
|
|||||||
browser->OpenURL(params);
|
browser->OpenURL(params);
|
||||||
|
|
||||||
RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_BROWSER);
|
RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_BROWSER);
|
||||||
#else // OS_ANDROID
|
|
||||||
// ShouldPreferOpeningInBrowser() should never be true on Android.
|
|
||||||
NOTREACHED();
|
|
||||||
#endif // OS_ANDROID
|
#endif // OS_ANDROID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,20 +40,14 @@ void OnGetAdapter(scoped_refptr<device::BluetoothAdapter> adapter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ReportBluetoothAvailability() {
|
void ReportBluetoothAvailability() {
|
||||||
#if !defined(OS_MACOSX) && !defined(OS_WIN) && !defined(OS_LINUX)
|
|
||||||
// This is only relevant for desktop platforms.
|
// This is only relevant for desktop platforms.
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
// TODO(kenrb): This is separate from other platforms because we get a
|
// TODO(kenrb): This is separate from other platforms because we get a
|
||||||
// little bit of extra information from the Mac-specific code. It might not
|
// little bit of extra information from the Mac-specific code. It might not
|
||||||
// be worth having the extra code path, and we should consider whether to
|
// be worth having the extra code path, and we should consider whether to
|
||||||
// combine them (https://crbug.com/907279).
|
// combine them (https://crbug.com/907279).
|
||||||
ReportAvailability(bluetooth_utility::GetBluetoothAvailability());
|
ReportAvailability(bluetooth_utility::GetBluetoothAvailability());
|
||||||
return;
|
#elif defined(OS_WIN) || defined(OS_LINUX)
|
||||||
#endif // defined(OS_MACOSX)
|
|
||||||
|
|
||||||
// GetAdapter must be called on the UI thread, because it creates a
|
// GetAdapter must be called on the UI thread, because it creates a
|
||||||
// WeakPtr, which is checked from that thread on future calls.
|
// WeakPtr, which is checked from that thread on future calls.
|
||||||
if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
|
if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
|
||||||
@@ -78,6 +72,7 @@ void ReportBluetoothAvailability() {
|
|||||||
|
|
||||||
device::BluetoothAdapterFactory::Get().GetAdapter(
|
device::BluetoothAdapterFactory::Get().GetAdapter(
|
||||||
base::BindOnce(&OnGetAdapter));
|
base::BindOnce(&OnGetAdapter));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace bluetooth_utility
|
} // namespace bluetooth_utility
|
||||||
|
@@ -51,14 +51,14 @@ void NetworkQualityEstimatorProviderImpl::PostReplyOnNetworkQualityChanged(
|
|||||||
AddEffectiveConnectionTypeObserverNow,
|
AddEffectiveConnectionTypeObserverNow,
|
||||||
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
|
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
|
||||||
return;
|
return;
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
bool task_posted = base::ThreadTaskRunnerHandle::Get()->PostTask(
|
bool task_posted = base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||||
FROM_HERE,
|
FROM_HERE,
|
||||||
base::BindOnce(&NetworkQualityEstimatorProviderImpl::
|
base::BindOnce(&NetworkQualityEstimatorProviderImpl::
|
||||||
AddEffectiveConnectionTypeObserverNow,
|
AddEffectiveConnectionTypeObserverNow,
|
||||||
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
|
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
|
||||||
DCHECK(task_posted);
|
DCHECK(task_posted);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkQualityEstimatorProviderImpl::AddEffectiveConnectionTypeObserverNow(
|
void NetworkQualityEstimatorProviderImpl::AddEffectiveConnectionTypeObserverNow(
|
||||||
|
@@ -451,9 +451,7 @@ void ProfileAttributesStorage::DownloadHighResAvatarIfNeeded(
|
|||||||
void ProfileAttributesStorage::DownloadHighResAvatar(
|
void ProfileAttributesStorage::DownloadHighResAvatar(
|
||||||
size_t icon_index,
|
size_t icon_index,
|
||||||
const base::FilePath& profile_path) {
|
const base::FilePath& profile_path) {
|
||||||
#if defined(OS_ANDROID)
|
#if !defined(OS_ANDROID)
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
const char* file_name =
|
const char* file_name =
|
||||||
profiles::GetDefaultAvatarIconFileNameAtIndex(icon_index);
|
profiles::GetDefaultAvatarIconFileNameAtIndex(icon_index);
|
||||||
DCHECK(file_name);
|
DCHECK(file_name);
|
||||||
@@ -472,6 +470,7 @@ void ProfileAttributesStorage::DownloadHighResAvatar(
|
|||||||
AsWeakPtr(), profile_path)));
|
AsWeakPtr(), profile_path)));
|
||||||
|
|
||||||
current_downloader->Start();
|
current_downloader->Start();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileAttributesStorage::SaveAvatarImageAtPath(
|
void ProfileAttributesStorage::SaveAvatarImageAtPath(
|
||||||
|
@@ -15,6 +15,7 @@ namespace {
|
|||||||
|
|
||||||
constexpr char kFieldInfoTableName[] = "field_info";
|
constexpr char kFieldInfoTableName[] = "field_info";
|
||||||
|
|
||||||
|
#if !defined(OS_ANDROID)
|
||||||
// Represents columns of the FieldInfoTable. Used with SQL queries that use all
|
// Represents columns of the FieldInfoTable. Used with SQL queries that use all
|
||||||
// the columns.
|
// the columns.
|
||||||
enum class FieldInfoTableColumn {
|
enum class FieldInfoTableColumn {
|
||||||
@@ -57,6 +58,7 @@ std::vector<FieldInfo> StatementToFieldInfo(sql::Statement* s) {
|
|||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
@@ -79,12 +81,13 @@ void FieldInfoTable::Init(sql::Database* db) {
|
|||||||
bool FieldInfoTable::CreateTableIfNecessary() {
|
bool FieldInfoTable::CreateTableIfNecessary() {
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
return true;
|
return true;
|
||||||
#endif // defined(OS_ANDROID)
|
#else
|
||||||
if (db_->DoesTableExist(kFieldInfoTableName))
|
if (db_->DoesTableExist(kFieldInfoTableName))
|
||||||
return true;
|
return true;
|
||||||
SQLTableBuilder builder(kFieldInfoTableName);
|
SQLTableBuilder builder(kFieldInfoTableName);
|
||||||
InitializeFieldInfoBuilder(&builder);
|
InitializeFieldInfoBuilder(&builder);
|
||||||
return builder.CreateTable(db_);
|
return builder.CreateTable(db_);
|
||||||
|
#endif // defined(OS_ANDROID)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FieldInfoTable::DropTableIfExists() {
|
bool FieldInfoTable::DropTableIfExists() {
|
||||||
@@ -96,7 +99,7 @@ bool FieldInfoTable::DropTableIfExists() {
|
|||||||
bool FieldInfoTable::AddRow(const FieldInfo& field) {
|
bool FieldInfoTable::AddRow(const FieldInfo& field) {
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
return false;
|
return false;
|
||||||
#endif // defined(OS_ANDROID)
|
#else
|
||||||
sql::Statement s(db_->GetCachedStatement(
|
sql::Statement s(db_->GetCachedStatement(
|
||||||
SQL_FROM_HERE,
|
SQL_FROM_HERE,
|
||||||
"INSERT OR IGNORE INTO field_info "
|
"INSERT OR IGNORE INTO field_info "
|
||||||
@@ -111,13 +114,14 @@ bool FieldInfoTable::AddRow(const FieldInfo& field) {
|
|||||||
s.BindInt64(GetColumnNumber(FieldInfoTableColumn::kCreateTime),
|
s.BindInt64(GetColumnNumber(FieldInfoTableColumn::kCreateTime),
|
||||||
field.create_time.ToDeltaSinceWindowsEpoch().InMicroseconds());
|
field.create_time.ToDeltaSinceWindowsEpoch().InMicroseconds());
|
||||||
return s.Run();
|
return s.Run();
|
||||||
|
#endif // defined(OS_ANDROID)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FieldInfoTable::RemoveRowsByTime(base::Time remove_begin,
|
bool FieldInfoTable::RemoveRowsByTime(base::Time remove_begin,
|
||||||
base::Time remove_end) {
|
base::Time remove_end) {
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
return false;
|
return false;
|
||||||
#endif // defined(OS_ANDROID)
|
#else
|
||||||
sql::Statement s(
|
sql::Statement s(
|
||||||
db_->GetCachedStatement(SQL_FROM_HERE,
|
db_->GetCachedStatement(SQL_FROM_HERE,
|
||||||
"DELETE FROM field_info WHERE "
|
"DELETE FROM field_info WHERE "
|
||||||
@@ -125,17 +129,19 @@ bool FieldInfoTable::RemoveRowsByTime(base::Time remove_begin,
|
|||||||
s.BindInt64(0, remove_begin.ToDeltaSinceWindowsEpoch().InMicroseconds());
|
s.BindInt64(0, remove_begin.ToDeltaSinceWindowsEpoch().InMicroseconds());
|
||||||
s.BindInt64(1, remove_end.ToDeltaSinceWindowsEpoch().InMicroseconds());
|
s.BindInt64(1, remove_end.ToDeltaSinceWindowsEpoch().InMicroseconds());
|
||||||
return s.Run();
|
return s.Run();
|
||||||
|
#endif // defined(OS_ANDROID)
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<FieldInfo> FieldInfoTable::GetAllRows() {
|
std::vector<FieldInfo> FieldInfoTable::GetAllRows() {
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
return std::vector<FieldInfo>();
|
return std::vector<FieldInfo>();
|
||||||
#endif // defined(OS_ANDROID)
|
#else
|
||||||
sql::Statement s(db_->GetCachedStatement(
|
sql::Statement s(db_->GetCachedStatement(
|
||||||
SQL_FROM_HERE,
|
SQL_FROM_HERE,
|
||||||
"SELECT form_signature, field_signature, field_type, create_time FROM "
|
"SELECT form_signature, field_signature, field_type, create_time FROM "
|
||||||
"field_info"));
|
"field_info"));
|
||||||
return StatementToFieldInfo(&s);
|
return StatementToFieldInfo(&s);
|
||||||
|
#endif // defined(OS_ANDROID)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns all FieldInfo from the database which have |form_signature|.
|
// Returns all FieldInfo from the database which have |form_signature|.
|
||||||
@@ -143,7 +149,7 @@ std::vector<FieldInfo> FieldInfoTable::GetAllRowsForFormSignature(
|
|||||||
uint64_t form_signature) {
|
uint64_t form_signature) {
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
return std::vector<FieldInfo>();
|
return std::vector<FieldInfo>();
|
||||||
#endif // defined(OS_ANDROID)
|
#else
|
||||||
sql::Statement s(
|
sql::Statement s(
|
||||||
db_->GetCachedStatement(SQL_FROM_HERE,
|
db_->GetCachedStatement(SQL_FROM_HERE,
|
||||||
"SELECT form_signature, field_signature, "
|
"SELECT form_signature, field_signature, "
|
||||||
@@ -151,6 +157,7 @@ std::vector<FieldInfo> FieldInfoTable::GetAllRowsForFormSignature(
|
|||||||
"WHERE form_signature = ?"));
|
"WHERE form_signature = ?"));
|
||||||
s.BindInt64(0, form_signature);
|
s.BindInt64(0, form_signature);
|
||||||
return StatementToFieldInfo(&s);
|
return StatementToFieldInfo(&s);
|
||||||
|
#endif // defined(OS_ANDROID)
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace password_manager
|
} // namespace password_manager
|
||||||
|
@@ -953,8 +953,7 @@ bool PasswordFormManager::UsePossibleUsername(
|
|||||||
// Do not trust local heuristics on Android.
|
// Do not trust local heuristics on Android.
|
||||||
// TODO(https://crbug.com/1051914): Make local heuristics more reliable.
|
// TODO(https://crbug.com/1051914): Make local heuristics more reliable.
|
||||||
return false;
|
return false;
|
||||||
#endif // defined(OS_ANDROID)
|
#else
|
||||||
|
|
||||||
// Check whether it is already learned from previous user actions whether
|
// Check whether it is already learned from previous user actions whether
|
||||||
// |possible_username| corresponds to the valid username form.
|
// |possible_username| corresponds to the valid username form.
|
||||||
const FieldInfoManager* field_info_manager = client_->GetFieldInfoManager();
|
const FieldInfoManager* field_info_manager = client_->GetFieldInfoManager();
|
||||||
@@ -979,6 +978,7 @@ bool PasswordFormManager::UsePossibleUsername(
|
|||||||
LogUsingPossibleUsername(client_, /*is_used*/ is_possible_username_valid,
|
LogUsingPossibleUsername(client_, /*is_used*/ is_possible_username_valid,
|
||||||
"Local heuristics");
|
"Local heuristics");
|
||||||
return is_possible_username_valid;
|
return is_possible_username_valid;
|
||||||
|
#endif // defined(OS_ANDROID)
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace password_manager
|
} // namespace password_manager
|
||||||
|
@@ -575,8 +575,7 @@ bool PasswordProtectionService::IsSupportedPasswordTypeForModalWarning(
|
|||||||
// Android.
|
// Android.
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
if (password_type.account_type() ==
|
if (password_type.account_type() ==
|
||||||
ReusedPasswordAccountType::NON_GAIA_ENTERPRISE)
|
ReusedPasswordAccountType::NON_GAIA_ENTERPRISE)
|
||||||
return true;
|
return true;
|
||||||
@@ -588,6 +587,7 @@ bool PasswordProtectionService::IsSupportedPasswordTypeForModalWarning(
|
|||||||
return password_type.is_account_syncing() ||
|
return password_type.is_account_syncing() ||
|
||||||
base::FeatureList::IsEnabled(
|
base::FeatureList::IsEnabled(
|
||||||
safe_browsing::kPasswordProtectionForSignedInUsers);
|
safe_browsing::kPasswordProtectionForSignedInUsers);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BUILDFLAG(FULL_SAFE_BROWSING)
|
#if BUILDFLAG(FULL_SAFE_BROWSING)
|
||||||
|
@@ -64,13 +64,12 @@ GURL GetStartupURL() {
|
|||||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||||
if (command_line->HasSwitch(switches::kBrowserTest))
|
if (command_line->HasSwitch(switches::kBrowserTest))
|
||||||
return GURL();
|
return GURL();
|
||||||
const base::CommandLine::StringVector& args = command_line->GetArgs();
|
|
||||||
|
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
// Delay renderer creation on Android until surface is ready.
|
// Delay renderer creation on Android until surface is ready.
|
||||||
return GURL();
|
return GURL();
|
||||||
#endif
|
#else
|
||||||
|
const base::CommandLine::StringVector& args = command_line->GetArgs();
|
||||||
if (args.empty())
|
if (args.empty())
|
||||||
return GURL("https://www.google.com/");
|
return GURL("https://www.google.com/");
|
||||||
|
|
||||||
@@ -80,6 +79,7 @@ GURL GetStartupURL() {
|
|||||||
|
|
||||||
return net::FilePathToFileURL(
|
return net::FilePathToFileURL(
|
||||||
base::MakeAbsoluteFilePath(base::FilePath(args[0])));
|
base::MakeAbsoluteFilePath(base::FilePath(args[0])));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
scoped_refptr<base::RefCountedMemory> PlatformResourceProvider(int key) {
|
scoped_refptr<base::RefCountedMemory> PlatformResourceProvider(int key) {
|
||||||
|
@@ -12,6 +12,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool IsMultiwindowSupported() {
|
bool IsMultiwindowSupported() {
|
||||||
return BUILDFLAG(IOS_MULTIWINDOW_ENABLED) &&
|
#if BUILDFLAG(IOS_MULTIWINDOW_ENABLED)
|
||||||
base::ios::IsRunningOnIOS13OrLater();
|
return base::ios::IsRunningOnIOS13OrLater();
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -356,6 +356,10 @@ class VideoCaptureDeviceTest
|
|||||||
video_capture_device_factory_->GetDeviceDescriptors(
|
video_capture_device_factory_->GetDeviceDescriptors(
|
||||||
device_descriptors_.get());
|
device_descriptors_.get());
|
||||||
|
|
||||||
|
if (device_descriptors_->empty()) {
|
||||||
|
DLOG(WARNING) << "No camera found";
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
for (const auto& descriptor : *device_descriptors_) {
|
for (const auto& descriptor : *device_descriptors_) {
|
||||||
// Android deprecated/legacy devices capture on a single thread, which is
|
// Android deprecated/legacy devices capture on a single thread, which is
|
||||||
@@ -370,25 +374,11 @@ class VideoCaptureDeviceTest
|
|||||||
}
|
}
|
||||||
DLOG(WARNING) << "No usable camera found";
|
DLOG(WARNING) << "No usable camera found";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (device_descriptors_->empty()) {
|
|
||||||
DLOG(WARNING) << "No camera found";
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
// Dump the camera model to help debugging.
|
|
||||||
// TODO(alaoui.rda@gmail.com): remove after http://crbug.com/730068 is
|
|
||||||
// fixed.
|
|
||||||
LOG(INFO) << "Using camera "
|
|
||||||
<< device_descriptors_->front().GetNameAndModel();
|
|
||||||
#else
|
#else
|
||||||
DLOG(INFO) << "Using camera "
|
const auto& descriptor = device_descriptors_->front();
|
||||||
<< device_descriptors_->front().GetNameAndModel();
|
DLOG(INFO) << "Using camera " << descriptor.GetNameAndModel();
|
||||||
|
return std::make_unique<VideoCaptureDeviceDescriptor>(descriptor);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return std::make_unique<VideoCaptureDeviceDescriptor>(
|
|
||||||
device_descriptors_->front());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const VideoCaptureFormat& last_format() const { return last_format_; }
|
const VideoCaptureFormat& last_format() const { return last_format_; }
|
||||||
|
@@ -1039,7 +1039,6 @@ TEST_F(RlzLibTest, ConcurrentStoreAccessWithProcessExitsWhileLockHeld) {
|
|||||||
EXPECT_TRUE(success);
|
EXPECT_TRUE(success);
|
||||||
_exit(success ? 0 : 1);
|
_exit(success ? 0 : 1);
|
||||||
}
|
}
|
||||||
_exit(0);
|
|
||||||
} else {
|
} else {
|
||||||
// Parent.
|
// Parent.
|
||||||
pids.push_back(pid);
|
pids.push_back(pid);
|
||||||
|
@@ -1915,17 +1915,19 @@ BPF_TEST_C(SandboxBPF, PthreadBitMask, PthreadPolicyBitMask) {
|
|||||||
//
|
//
|
||||||
// Depending on the architecture, this may modify regs, so the caller is
|
// Depending on the architecture, this may modify regs, so the caller is
|
||||||
// responsible for committing these changes using PTRACE_SETREGS.
|
// responsible for committing these changes using PTRACE_SETREGS.
|
||||||
|
#if !defined(__arm__) && !defined(__aarch64__) && !defined(__mips__)
|
||||||
long SetSyscall(pid_t pid, regs_struct* regs, int syscall_number) {
|
long SetSyscall(pid_t pid, regs_struct* regs, int syscall_number) {
|
||||||
#if defined(__arm__)
|
#if defined(__arm__)
|
||||||
// On ARM, the syscall is changed using PTRACE_SET_SYSCALL. We cannot use the
|
// On ARM, the syscall is changed using PTRACE_SET_SYSCALL. We cannot use the
|
||||||
// libc ptrace call as the request parameter is an enum, and
|
// libc ptrace call as the request parameter is an enum, and
|
||||||
// PTRACE_SET_SYSCALL may not be in the enum.
|
// PTRACE_SET_SYSCALL may not be in the enum.
|
||||||
return syscall(__NR_ptrace, PTRACE_SET_SYSCALL, pid, NULL, syscall_number);
|
return syscall(__NR_ptrace, PTRACE_SET_SYSCALL, pid, NULL, syscall_number);
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
SECCOMP_PT_SYSCALL(*regs) = syscall_number;
|
SECCOMP_PT_SYSCALL(*regs) = syscall_number;
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const uint16_t kTraceData = 0xcc;
|
const uint16_t kTraceData = 0xcc;
|
||||||
|
|
||||||
@@ -1952,16 +1954,11 @@ SANDBOX_TEST(SandboxBPF, DISABLE_ON_TSAN(SeccompRetTrace)) {
|
|||||||
// See https://code.google.com/p/chromium/issues/detail?id=383977
|
// See https://code.google.com/p/chromium/issues/detail?id=383977
|
||||||
#if defined(__arm__) || defined(__aarch64__)
|
#if defined(__arm__) || defined(__aarch64__)
|
||||||
printf("This test is currently disabled on ARM32/64 due to a kernel bug.");
|
printf("This test is currently disabled on ARM32/64 due to a kernel bug.");
|
||||||
return;
|
#elif defined(__mips__)
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__mips__)
|
|
||||||
// TODO: Figure out how to support specificity of handling indirect syscalls
|
// TODO: Figure out how to support specificity of handling indirect syscalls
|
||||||
// in this test and enable it.
|
// in this test and enable it.
|
||||||
printf("This test is currently disabled on MIPS.");
|
printf("This test is currently disabled on MIPS.");
|
||||||
return;
|
#else
|
||||||
#endif
|
|
||||||
|
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
BPF_ASSERT_NE(-1, pid);
|
BPF_ASSERT_NE(-1, pid);
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
@@ -2040,6 +2037,7 @@ SANDBOX_TEST(SandboxBPF, DISABLE_ON_TSAN(SeccompRetTrace)) {
|
|||||||
|
|
||||||
BPF_ASSERT_NE(-1, ptrace(PTRACE_CONT, pid, NULL, NULL));
|
BPF_ASSERT_NE(-1, ptrace(PTRACE_CONT, pid, NULL, NULL));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Android does not expose pread64 nor pwrite64.
|
// Android does not expose pread64 nor pwrite64.
|
||||||
|
@@ -516,8 +516,7 @@ int ProcessedLocalAudioSource::GetBufferSize(int sample_rate) const {
|
|||||||
// TODO(henrika): Re-evaluate whether to use same logic as other platforms.
|
// TODO(henrika): Re-evaluate whether to use same logic as other platforms.
|
||||||
// https://crbug.com/638081
|
// https://crbug.com/638081
|
||||||
return (2 * sample_rate / 100);
|
return (2 * sample_rate / 100);
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
// If audio processing is turned on, require 10ms buffers.
|
// If audio processing is turned on, require 10ms buffers.
|
||||||
if (audio_processor_->has_audio_processing() || audio_processor_proxy_)
|
if (audio_processor_->has_audio_processing() || audio_processor_proxy_)
|
||||||
return (sample_rate / 100);
|
return (sample_rate / 100);
|
||||||
@@ -535,6 +534,7 @@ int ProcessedLocalAudioSource::GetBufferSize(int sample_rate) const {
|
|||||||
// TODO(miu): Identify where/why the buffer size might be missing, fix the
|
// TODO(miu): Identify where/why the buffer size might be missing, fix the
|
||||||
// code, and then require it here. https://crbug.com/638081
|
// code, and then require it here. https://crbug.com/638081
|
||||||
return (sample_rate / 100);
|
return (sample_rate / 100);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace blink
|
} // namespace blink
|
||||||
|
@@ -74,21 +74,19 @@ VideoFrameMetadata* WebGLVideoTexture::VideoElementTargetVideoTexture(
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For WebGL last-uploaded-frame-metadata API.
|
|
||||||
WebMediaPlayer::VideoFrameUploadMetadata frame_metadata = {};
|
|
||||||
int already_uploaded_id = HTMLVideoElement::kNoAlreadyUploadedFrame;
|
|
||||||
auto* frame_metadata_ptr = &frame_metadata;
|
|
||||||
if (RuntimeEnabledFeatures::ExtraWebGLVideoTextureMetadataEnabled())
|
|
||||||
already_uploaded_id = texture->GetLastUploadedVideoFrameId();
|
|
||||||
|
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
// TODO(crbug.com/776222): support extension on Android
|
// TODO(crbug.com/776222): support extension on Android
|
||||||
NOTIMPLEMENTED();
|
NOTIMPLEMENTED();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#else // defined OS_ANDROID
|
#else
|
||||||
target = GL_TEXTURE_2D;
|
// For WebGL last-uploaded-frame-metadata API.
|
||||||
|
WebMediaPlayer::VideoFrameUploadMetadata frame_metadata = {};
|
||||||
|
auto* frame_metadata_ptr = &frame_metadata;
|
||||||
|
int already_uploaded_id = HTMLVideoElement::kNoAlreadyUploadedFrame;
|
||||||
|
if (RuntimeEnabledFeatures::ExtraWebGLVideoTextureMetadataEnabled())
|
||||||
|
already_uploaded_id = texture->GetLastUploadedVideoFrameId();
|
||||||
|
|
||||||
#endif // defined OS_ANDROID
|
target = GL_TEXTURE_2D;
|
||||||
|
|
||||||
// TODO(shaobo.yan@intel.com) : A fallback path or exception needs to be
|
// TODO(shaobo.yan@intel.com) : A fallback path or exception needs to be
|
||||||
// added when video is not using gpu decoder.
|
// added when video is not using gpu decoder.
|
||||||
@@ -120,6 +118,7 @@ VideoFrameMetadata* WebGLVideoTexture::VideoElementTargetVideoTexture(
|
|||||||
current_frame_metadata_->setPresentationTimestamp(
|
current_frame_metadata_->setPresentationTimestamp(
|
||||||
frame_metadata_ptr->timestamp.InSecondsF());
|
frame_metadata_ptr->timestamp.InSecondsF());
|
||||||
return current_frame_metadata_;
|
return current_frame_metadata_;
|
||||||
|
#endif // defined OS_ANDROID
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace blink
|
} // namespace blink
|
||||||
|
@@ -5794,11 +5794,8 @@ TEST_F(RenderTextTest, HarfBuzz_BreakRunsByEmojiVariationSelectors) {
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_ANDROID)
|
|
||||||
// TODO(865709): make this work on Android.
|
// TODO(865709): make this work on Android.
|
||||||
return;
|
#if !defined(OS_ANDROID)
|
||||||
#endif
|
|
||||||
|
|
||||||
// Jump over the telephone: two codepoints, but a single glyph.
|
// Jump over the telephone: two codepoints, but a single glyph.
|
||||||
render_text->MoveCursor(CHARACTER_BREAK, CURSOR_RIGHT, SELECTION_NONE);
|
render_text->MoveCursor(CHARACTER_BREAK, CURSOR_RIGHT, SELECTION_NONE);
|
||||||
EXPECT_EQ(gfx::Range(3, 3), render_text->selection());
|
EXPECT_EQ(gfx::Range(3, 3), render_text->selection());
|
||||||
@@ -5812,6 +5809,7 @@ TEST_F(RenderTextTest, HarfBuzz_BreakRunsByEmojiVariationSelectors) {
|
|||||||
render_text->MoveCursor(CHARACTER_BREAK, CURSOR_RIGHT, SELECTION_NONE);
|
render_text->MoveCursor(CHARACTER_BREAK, CURSOR_RIGHT, SELECTION_NONE);
|
||||||
EXPECT_EQ(gfx::Range(4, 4), render_text->selection());
|
EXPECT_EQ(gfx::Range(4, 4), render_text->selection());
|
||||||
EXPECT_EQ(3 * kGlyphWidth, render_text->GetUpdatedCursorBounds().x());
|
EXPECT_EQ(3 * kGlyphWidth, render_text->GetUpdatedCursorBounds().x());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(RenderTextTest, HarfBuzz_OrphanedVariationSelector) {
|
TEST_F(RenderTextTest, HarfBuzz_OrphanedVariationSelector) {
|
||||||
|
@@ -28,12 +28,11 @@ GURL GetStartupURL() {
|
|||||||
if (command_line->HasSwitch(switches::kNoInitialNavigation))
|
if (command_line->HasSwitch(switches::kNoInitialNavigation))
|
||||||
return GURL();
|
return GURL();
|
||||||
|
|
||||||
const base::CommandLine::StringVector& args = command_line->GetArgs();
|
|
||||||
|
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
// Delay renderer creation on Android until surface is ready.
|
// Delay renderer creation on Android until surface is ready.
|
||||||
return GURL();
|
return GURL();
|
||||||
#endif
|
#else
|
||||||
|
const base::CommandLine::StringVector& args = command_line->GetArgs();
|
||||||
|
|
||||||
if (args.empty())
|
if (args.empty())
|
||||||
return GURL("https://www.google.com/");
|
return GURL("https://www.google.com/");
|
||||||
@@ -44,6 +43,7 @@ GURL GetStartupURL() {
|
|||||||
|
|
||||||
return net::FilePathToFileURL(
|
return net::FilePathToFileURL(
|
||||||
base::MakeAbsoluteFilePath(base::FilePath(args[0])));
|
base::MakeAbsoluteFilePath(base::FilePath(args[0])));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
class MainDelegateImpl : public MainDelegate {
|
class MainDelegateImpl : public MainDelegate {
|
||||||
|
Reference in New Issue
Block a user