Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from chromium:master #36

Merged
merged 49 commits into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
cc4f038
[triage] Triage *-intrinsic-size.
bfgeek Aug 24, 2021
89c9236
CCA: Fine tune document mode dialog style to match ux mock
Aug 24, 2021
2822b79
WebGPU: Properly dirty and clear swap chain textures
austinEng Aug 24, 2021
16aa00f
arc: Prevent running NearbyShare session finish OnceCallback after move
alan33d Aug 24, 2021
4caa039
Update V8 to version 9.5.47.
Aug 24, 2021
c9260c1
[@layer] Gather layers from all sheets and compute layer ordering
xiaochengh Aug 24, 2021
a36b029
Extends expiration time for ChromeOS.Camera metrics
Aug 24, 2021
5ba125a
[FilesBanner] Add WarningBanner type
ben-reich Aug 24, 2021
0225615
Projector: Add URL handling for SWA in Ash Chrome
Aug 24, 2021
ecd1dc7
[App Management] Show a list of supported links.
jeevan-shikaram Aug 24, 2021
484bc1a
content-visibility: Force range base/extent when computing visual sel…
vmpstr Aug 24, 2021
588aef4
Rename WebAppProvider::GetForLocalApps to discourage use
Aug 24, 2021
9567903
ArcVmBalloonPolicy experiment
Aug 24, 2021
72364c6
Retire Windows.FilesystemError.* and Windows.PostOperationState.*.
GregTho Aug 24, 2021
6a7132a
MPArch: Prerendering doesn't record metrics/histogram in PageLoadMetr…
Gyuyoung Aug 24, 2021
ce61d89
OsSettingsLanguages: Add metric for dismissing shortcut reminder
mlcui-corp Aug 24, 2021
d913aa7
Reland "[LSS] Tweak the fuzzy search parameters for the inverted index."
Aug 24, 2021
d89c9d2
Turn CHECK in |GetNonSharedCharacterBreakIterator| to DCHECK
kojiishi Aug 24, 2021
95feceb
Don't assume visibility state of RenderWidgetHost.
Aug 24, 2021
6947aed
Remove exclusion rules for classes without operator new
Aug 24, 2021
55b9467
Add JSONReaderTest.Doubles test case
Aug 24, 2021
3f14625
Mac10.11 Tests print some launcher logs
Aug 24, 2021
97621d8
testing/trigger_scripts: use Go client
Aug 24, 2021
34c82a1
[mparch] Add a test for PerformAfterWriteChecks() in prerendering
jkim-julie Aug 24, 2021
184e035
CCA: Add type definitions of trustedTypes
peter50216 Aug 24, 2021
7e394ec
Update docs/early-hints.md
bashi Aug 24, 2021
52a9eb9
[FilesBanner] Force show banners for testing
ben-reich Aug 24, 2021
f6b55b7
Load legacy modules for panels/animation
TimvdLippe Aug 24, 2021
d651802
[Frameworks roll] Roll to 392598787 piper revision
Aug 24, 2021
ceda522
Update V8 to version 9.5.49.
Aug 24, 2021
a8f0ef5
[iOS][10/N] Adds ChromeAccountManagerServiceObserver
Aug 24, 2021
8f71070
Quick Answers V2: Hide settings sub-toggles and update description
Aug 24, 2021
e6648d3
[fuchsia] Fix TestLauncher to use persistent storage for /cache.
Aug 24, 2021
e4b2f3c
[Fuchsia] Fix FYI Builder
Aug 24, 2021
859cfe2
Add BrowserTest coverage for InstanceKey::IsForWebBasedApp
Aug 24, 2021
8f2550d
[Autofill Assistant] Rollback to VisualViewport
Aug 24, 2021
edd4e93
Make CachedTextInputInfo to handle ShadowRoot
yosinch Aug 24, 2021
591d7c4
[FilesBanner] Update Downloads warning string and Learn more label
ben-reich Aug 24, 2021
8cfdfb5
[iOS] Adds ContextMenuActionsRefresh feature flag
Aug 24, 2021
554302b
Delay expiry of histograms causing alerts.
Aug 24, 2021
0569ad1
Rewrite MediaStream onactive test to use promise API
Aug 24, 2021
3908122
Add absl/numeric:bits to absl component
Aug 24, 2021
137498b
[iOS][SyncDisabled] Updates sync item
Aug 24, 2021
d740521
Delay expiry of frequently used histograms.
Aug 24, 2021
cf341ce
Fix flaky org.chromium.chrome.browser.tabmodel.TabModelMergingTest#te…
tasak Aug 24, 2021
b82df5b
[iOS][SyncDisabled] Updates singIn item
Aug 24, 2021
8710436
Internally handle system-ui as a generic family
fred-wang Aug 24, 2021
602ccb7
Revert "[iOS][MobileConfig] Updates alert style"
Aug 24, 2021
4115987
[CrOS Settings] Check in Polymer3 version of os_settings_menu
Aug 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling V8
# and whatever else without interference from each other.
'v8_revision': '9543988eec751ce6f27e0f8a07c0dad45b3a035f',
'v8_revision': '6b73348c3a7e59c459e86dccac8dabc1dadf96fb',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling swarming_client
# and whatever else without interference from each other.
Expand Down
8 changes: 8 additions & 0 deletions ash/constants/ash_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,10 @@ const base::Feature kQuickAnswersTranslationCloudAPI{
const base::Feature kQuickAnswersV2{"QuickAnswersV2",
base::FEATURE_DISABLED_BY_DEFAULT};

// Controls whether to enable quick answers V2 settings sub-toggles.
const base::Feature kQuickAnswersV2SettingsSubToggle{
"QuickAnswersV2SettingsSubToggle", base::FEATURE_DISABLED_BY_DEFAULT};

// Enables or disables fingerprint quick unlock.
const base::Feature kQuickUnlockFingerprint{"QuickUnlockFingerprint",
base::FEATURE_DISABLED_BY_DEFAULT};
Expand Down Expand Up @@ -1550,6 +1554,10 @@ bool IsQuickAnswersV2TranslationDisabled() {
return base::FeatureList::IsEnabled(kDisableQuickAnswersV2Translation);
}

bool IsQuickAnswersV2SettingsSubToggleEnabled() {
return base::FeatureList::IsEnabled(kQuickAnswersV2SettingsSubToggle);
}

bool IsReduceDisplayNotificationsEnabled() {
return base::FeatureList::IsEnabled(kReduceDisplayNotifications);
}
Expand Down
3 changes: 3 additions & 0 deletions ash/constants/ash_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kQuickAnswersV2;
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const base::Feature kDisableQuickAnswersV2Translation;
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const base::Feature kQuickAnswersV2SettingsSubToggle;
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const base::Feature kQuickAnswersOnEditableText;
COMPONENT_EXPORT(ASH_CONSTANTS)
extern const base::Feature kQuickAnswersStandaloneSettings;
Expand Down Expand Up @@ -540,6 +542,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsQuickAnswersTranslationCloudAPIEnabled();
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsQuickAnswersTranslationEnabled();
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsQuickAnswersV2Enabled();
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsQuickAnswersV2TranslationDisabled();
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsQuickAnswersV2SettingsSubToggleEnabled();
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsReduceDisplayNotificationsEnabled();
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsReverseScrollGesturesEnabled();
COMPONENT_EXPORT(ASH_CONSTANTS)
Expand Down
80 changes: 3 additions & 77 deletions base/files/file_util_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,67 +55,6 @@ namespace {
const DWORD kFileShareAll =
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;

// Records a sample in a histogram named
// "Windows.PostOperationState.|operation|" indicating the state of |path|
// following the named operation. If |operation_succeeded| is true, the
// "operation succeeded" sample is recorded. Otherwise, the state of |path| is
// queried and the most meaningful sample is recorded.
void RecordPostOperationState(const FilePath& path,
StringPiece operation,
bool operation_succeeded) {
// The state of a filesystem item after an operation.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class PostOperationState {
kOperationSucceeded = 0,
kFileNotFoundAfterFailure = 1,
kPathNotFoundAfterFailure = 2,
kAccessDeniedAfterFailure = 3,
kNoAttributesAfterFailure = 4,
kEmptyDirectoryAfterFailure = 5,
kNonEmptyDirectoryAfterFailure = 6,
kNotDirectoryAfterFailure = 7,
kCount
} metric = PostOperationState::kOperationSucceeded;

if (!operation_succeeded) {
const DWORD attributes = ::GetFileAttributes(path.value().c_str());
if (attributes == INVALID_FILE_ATTRIBUTES) {
// On failure to delete, one might expect the file/directory to still be
// in place. Slice a failure to get its attributes into a few common error
// buckets.
const DWORD error_code = ::GetLastError();
if (error_code == ERROR_FILE_NOT_FOUND)
metric = PostOperationState::kFileNotFoundAfterFailure;
else if (error_code == ERROR_PATH_NOT_FOUND)
metric = PostOperationState::kPathNotFoundAfterFailure;
else if (error_code == ERROR_ACCESS_DENIED)
metric = PostOperationState::kAccessDeniedAfterFailure;
else
metric = PostOperationState::kNoAttributesAfterFailure;
} else if (attributes & FILE_ATTRIBUTE_DIRECTORY) {
if (IsDirectoryEmpty(path))
metric = PostOperationState::kEmptyDirectoryAfterFailure;
else
metric = PostOperationState::kNonEmptyDirectoryAfterFailure;
} else {
metric = PostOperationState::kNotDirectoryAfterFailure;
}
}

std::string histogram_name =
base::StrCat({"Windows.PostOperationState.", operation});
UmaHistogramEnumeration(histogram_name, metric, PostOperationState::kCount);
}

// Records the sample |error| in a histogram named
// "Windows.FilesystemError.|operation|".
void RecordFilesystemError(StringPiece operation, DWORD error) {
std::string histogram_name =
base::StrCat({"Windows.FilesystemError.", operation});
UmaHistogramSparse(histogram_name, error);
}

// Returns the Win32 last error code or ERROR_SUCCESS if the last error code is
// ERROR_FILE_NOT_FOUND or ERROR_PATH_NOT_FOUND. This is useful in cases where
// the absence of a file or path is a success condition (e.g., when attempting
Expand Down Expand Up @@ -361,24 +300,11 @@ DWORD DoDeleteFile(const FilePath& path, bool recursive) {
// Deletes the file/directory at |path| (recursively if |recursive| and |path|
// names a directory), returning true on success. Sets the Windows last-error
// code and returns false on failure.
bool DeleteFileAndRecordMetrics(const FilePath& path, bool recursive) {
static constexpr char kRecursive[] = "DeleteFile.Recursive";
static constexpr char kNonRecursive[] = "DeleteFile.NonRecursive";
const StringPiece operation(recursive ? kRecursive : kNonRecursive);

ScopedBlockingCall scoped_blocking_call(FROM_HERE, BlockingType::MAY_BLOCK);

// Metrics for delete failures tracked in https://crbug.com/599084. Delete may
// fail for a number of reasons. Log some metrics relating to failures in the
// current code so that any improvements or regressions resulting from
// subsequent code changes can be detected.
bool DeleteFileOrSetLastError(const FilePath& path, bool recursive) {
const DWORD error = DoDeleteFile(path, recursive);
RecordPostOperationState(path, operation, error == ERROR_SUCCESS);
if (error == ERROR_SUCCESS)
return true;

RecordFilesystemError(operation, error);

::SetLastError(error);
return false;
}
Expand Down Expand Up @@ -432,11 +358,11 @@ FilePath MakeAbsoluteFilePath(const FilePath& input) {
}

bool DeleteFile(const FilePath& path) {
return DeleteFileAndRecordMetrics(path, /*recursive=*/false);
return DeleteFileOrSetLastError(path, /*recursive=*/false);
}

bool DeletePathRecursively(const FilePath& path) {
return DeleteFileAndRecordMetrics(path, /*recursive=*/true);
return DeleteFileOrSetLastError(path, /*recursive=*/true);
}

bool DeleteFileAfterReboot(const FilePath& path) {
Expand Down
9 changes: 8 additions & 1 deletion base/json/json_reader_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ TEST(JSONReaderTest, Doubles) {
EXPECT_TRUE(root->is_double());
EXPECT_DOUBLE_EQ(1.0, root->GetDouble());

// Some "parse to float64" implementations find this one tricky.
// https://github.com/serde-rs/json/issues/707
root = JSONReader::Read("122.416294033786585");
ASSERT_TRUE(root);
EXPECT_TRUE(root->is_double());
EXPECT_DOUBLE_EQ(122.416294033786585, root->GetDouble());

// This is syntaxtically valid, but out of range of a double.
auto value_with_error =
JSONReader::ReadAndReturnValueWithError("1e1000", JSON_PARSE_RFC);
Expand Down Expand Up @@ -220,7 +227,7 @@ TEST(JSONReaderTest, InvalidNumbers) {
EXPECT_FALSE(JSONReader::Read("4.a"));
}

TEST(JSONReader, SimpleString) {
TEST(JSONReaderTest, SimpleString) {
absl::optional<Value> root = JSONReader::Read("\"hello world\"");
ASSERT_TRUE(root);
EXPECT_TRUE(root->is_string());
Expand Down
36 changes: 24 additions & 12 deletions base/test/launcher/test_launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,16 @@ int LaunchChildTestProcessWithOptions(const CommandLine& command_line,
new_options.spawn_flags = FDIO_SPAWN_CLONE_STDIO | FDIO_SPAWN_CLONE_JOB;

const base::FilePath kDataPath(base::kPersistedDataDirectoryPath);
const base::FilePath kCachePath(base::kPersistedCacheDirectoryPath);

// Clone all namespace entries from the current process, except /data, which
// is overridden below.
// Clone all namespace entries from the current process, except /data and
// /cache, which are overridden below.
fdio_flat_namespace_t* flat_namespace = nullptr;
zx_status_t result = fdio_ns_export_root(&flat_namespace);
ZX_CHECK(ZX_OK == result, result) << "fdio_ns_export_root";
for (size_t i = 0; i < flat_namespace->count; ++i) {
base::FilePath path(flat_namespace->path[i]);
if (path == kDataPath) {
if (path == kDataPath || path == kCachePath) {
result = zx_handle_close(flat_namespace->handle[i]);
ZX_CHECK(ZX_OK == result, result) << "zx_handle_close";
} else {
Expand All @@ -379,25 +380,36 @@ int LaunchChildTestProcessWithOptions(const CommandLine& command_line,
new_options.job_handle = job_handle.get();

// Give this test its own isolated /data directory by creating a new temporary
// subdirectory under data (/data/test-$PID) and binding that to /data on the
// child process.
// subdirectory under data (/data/test-$PID) and binding paths under that to
// /data and /cache in the child process.
// Persistent data storage is mapped to /cache rather than system-provided
// cache storage, to avoid unexpected purges (see crbug.com/1242170).
CHECK(base::PathExists(kDataPath));

// Create the test subdirectory with a name that is unique to the child test
// process (qualified by parent PID and an autoincrementing test process
// index).
static base::AtomicSequenceNumber child_launch_index;
base::FilePath nested_data_path = kDataPath.AppendASCII(
const base::FilePath child_data_path = kDataPath.AppendASCII(
base::StringPrintf("test-%zu-%d", base::Process::Current().Pid(),
child_launch_index.GetNext()));
CHECK(!base::DirectoryExists(nested_data_path));
CHECK(base::CreateDirectory(nested_data_path));
DCHECK(base::DirectoryExists(nested_data_path));
CHECK(!base::DirectoryExists(child_data_path));
CHECK(base::CreateDirectory(child_data_path));
DCHECK(base::DirectoryExists(child_data_path));

// Bind the new test subdirectory to /data in the child process' namespace.
const base::FilePath test_data_dir(child_data_path.AppendASCII("data"));
CHECK(base::CreateDirectory(test_data_dir));
const base::FilePath test_cache_dir(child_data_path.AppendASCII("cache"));
CHECK(base::CreateDirectory(test_cache_dir));

// Transfer handles to the new directories as /data and /cache in the child
// process' namespace.
new_options.paths_to_transfer.push_back(
{kDataPath,
base::OpenDirectoryHandle(nested_data_path).TakeChannel().release()});
base::OpenDirectoryHandle(test_data_dir).TakeChannel().release()});
new_options.paths_to_transfer.push_back(
{kCachePath,
base::OpenDirectoryHandle(test_cache_dir).TakeChannel().release()});
#endif // defined(OS_FUCHSIA)

#if defined(OS_LINUX) || defined(OS_CHROMEOS)
Expand Down Expand Up @@ -483,7 +495,7 @@ int LaunchChildTestProcessWithOptions(const CommandLine& command_line,
ZX_CHECK(status == ZX_OK, status);

// Cleanup the data directory.
CHECK(DeletePathRecursively(nested_data_path));
CHECK(DeletePathRecursively(child_data_path));
#elif defined(OS_POSIX)
// It is not possible to waitpid() on any leaked sub-processes of the test
// batch process, since those are not direct children of this process.
Expand Down
9 changes: 9 additions & 0 deletions base/test/launcher/test_launcher_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,15 @@ TEST_F(TestLauncherTest, TestChildTempDir) {
EXPECT_FALSE(DirectoryExists(task_temp));
}

#if defined(OS_FUCHSIA)
// Verifies that test processes have /data, /cache and /tmp available.
TEST_F(TestLauncherTest, ProvidesDataCacheAndTmpDirs) {
EXPECT_TRUE(base::DirectoryExists(base::FilePath("/data")));
EXPECT_TRUE(base::DirectoryExists(base::FilePath("/cache")));
EXPECT_TRUE(base::DirectoryExists(base::FilePath("/tmp")));
}
#endif // defined(OS_FUCHSIA)

// Unit tests to validate UnitTestLauncherDelegate implementation.
class UnitTestLauncherDelegateTester : public testing::Test {
protected:
Expand Down
7 changes: 0 additions & 7 deletions build/config/fuchsia/test/access_test_data_dir.test-cmx

This file was deleted.

4 changes: 2 additions & 2 deletions build/fuchsia/fvdl_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
_DEFAULT_SSH_PORT = 22
_DEVICE_PROTO_TEMPLATE = """
device_spec: {{
horizontal_resolution: 1280
vertical_resolution: 800
horizontal_resolution: 1024
vertical_resolution: 600
vm_heap: 192
ram: {ramsize}
cache: 32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package org.chromium.chrome.browser.autofill_assistant.overlay;

import android.content.Context;
import android.graphics.RectF;

import org.chromium.chrome.browser.autofill_assistant.overlay.AssistantOverlayModel.AssistantOverlayRect;
import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider;
Expand Down Expand Up @@ -49,6 +50,10 @@ public AssistantOverlayCoordinator(Context context,
WebContents webContents = model.get(AssistantOverlayModel.WEB_CONTENTS);
mEventFilter.setWebContents(webContents);
mDrawable.setWebContents(webContents);
} else if (AssistantOverlayModel.VISUAL_VIEWPORT == propertyKey) {
RectF rect = model.get(AssistantOverlayModel.VISUAL_VIEWPORT);
mEventFilter.setVisualViewport(rect);
mDrawable.setVisualViewport(rect);
} else if (AssistantOverlayModel.TOUCHABLE_AREA == propertyKey) {
List<AssistantOverlayRect> area = model.get(AssistantOverlayModel.TOUCHABLE_AREA);
mEventFilter.setTouchableArea(area);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ class AssistantOverlayDrawable extends Drawable
/** The {@link WebContents} this Autofill Assistant is currently associated with. */
private WebContents mWebContents;

/**
* Coordinates of the visual viewport within the page, if known, in CSS pixels relative to the
* origin of the page.
*
* The visual viewport includes the portion of the page that is really visible, excluding any
* area not fully visible because of the current zoom value.
*
* Only relevant in partial mode, when the transparent area is non-empty.
*/
private final RectF mVisualViewport = new RectF();

private final List<Box> mTransparentArea = new ArrayList<>();
private List<AssistantOverlayRect> mRestrictedArea = Collections.emptyList();

Expand Down Expand Up @@ -214,6 +225,11 @@ void setWebContents(@NonNull WebContents webContents) {
invalidateSelf();
}

void setVisualViewport(RectF visualViewport) {
mVisualViewport.set(visualViewport);
invalidateSelf();
}

/** Set or updates the transparent area. */
void setTransparentArea(List<AssistantOverlayRect> transparentArea) {
// Add or update boxes for each rectangle in the area.
Expand Down Expand Up @@ -325,8 +341,9 @@ public void draw(Canvas canvas) {
RenderCoordinatesImpl renderCoordinates =
RenderCoordinatesImpl.fromWebContents(mWebContents);

float left = renderCoordinates.getScrollX();
float top = renderCoordinates.getScrollY();
// TODO(b/195482173): Use renderCoordinates to get left and top, remove mVisualViewport.
float left = mVisualViewport.left;
float top = mVisualViewport.top;

// Don't draw on top of the restricted area.
for (AssistantOverlayRect rect : mRestrictedArea) {
Expand Down Expand Up @@ -387,7 +404,7 @@ public void onBottomControlsHeightChanged(

@Override
public void onScrollOffsetOrExtentChanged(int scrollOffsetY, int scrollExtentY) {
invalidateSelf();
// TODO(b/195482173): call invalidateSelf once the visual viewport is removed.
}

/**
Expand Down
Loading