Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into master.lion
  • Loading branch information
bluebox authored and bluebox committed Sep 7, 2020
2 parents 98a10ad + 6080113 commit 7d0d5f0
Show file tree
Hide file tree
Showing 168 changed files with 1,939 additions and 777 deletions.
2 changes: 0 additions & 2 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,11 @@ no_check_targets = [
"//third_party/blink/renderer/modules/webtransport:*", # 16 errors
"//third_party/blink/renderer/modules/xr:*", # 13 errors
"//third_party/blink/renderer/modules:*", # 321 errors
"//third_party/blink/renderer/platform/blob:*", # 16 errors
"//third_party/blink/renderer/platform/heap:*", # 65 errors
"//third_party/blink/renderer/platform/instrumentation:*", # 13 errors
"//third_party/blink/renderer/platform/loader:*", # 180 errors
"//third_party/blink/renderer/platform/network:*", # 15 errors
"//third_party/blink/renderer/platform/scheduler:*", # 45 errors
"//third_party/blink/renderer/platform/wtf:*", # 2 errors
"//third_party/blink/renderer/platform:*", # 72 errors

"//third_party/breakpad:*", # 34 errors
Expand Down
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ if (is_win) {
"//components/zucchini",
"//courgette",
"//courgette:copy_courgette_binaries",
"//third_party/hyphenation-patterns",
"//tools/metrics:metrics_metadata",
]

Expand Down
14 changes: 7 additions & 7 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -195,23 +195,23 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling Skia
# and whatever else without interference from each other.
'skia_revision': 'a73a84f9b8e38aa0117f17df6ec54334adb2e4b9',
'skia_revision': 'd0fe7d37d678fc3a8726b73c265ced5a82ae4bfa',
# 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': 'ef9e56c6d3efce74216a967f3774a5c8bc8c142a',
'v8_revision': '3e2d6551eed76b7bdafb278b44c630965a840da8',
# 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.
'swarming_revision': '4c095d04179dc725a300085ae21fe3b79900d072',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling ANGLE
# and whatever else without interference from each other.
'angle_revision': '72f6b99c29f28bd7461f383e9b7223a8f670b7cc',
'angle_revision': 'f184cb61cea6c70204154a24477f67c2f1a7d6b4',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling SwiftShader
# and whatever else without interference from each other.
'swiftshader_revision': 'e63aa953ddfd935a022090b3ef221438a328d1a1',
'swiftshader_revision': '10121443c16deb0435be8ea61be54e3bee1b9855',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling PDFium
# and whatever else without interference from each other.
Expand Down Expand Up @@ -258,15 +258,15 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling catapult
# and whatever else without interference from each other.
'catapult_revision': '8584a9dfb9461b609749185105e1c4f9ac8186c1',
'catapult_revision': 'a02d5dc9584e3476f02a2c03b4fa186134bd0c16',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling libFuzzer
# and whatever else without interference from each other.
'libfuzzer_revision': 'debe7d2d1982e540fbd6bd78604bf001753f9e74',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling devtools-frontend
# and whatever else without interference from each other.
'devtools_frontend_revision': 'c8f4177cf443389ab48b9a1502a078be2f53798e',
'devtools_frontend_revision': '9de988b61cfc951e08c904f6366023e0d3d6c0dd',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling libprotobuf-mutator
# and whatever else without interference from each other.
Expand Down Expand Up @@ -947,7 +947,7 @@ deps = {
Var('chromium_git') + '/codecs/libgav1.git' + '@' + 'a9449e612bc251b4271bbe1e3a0d12e9809bf74c',

'src/third_party/glslang/src':
Var('chromium_git') + '/external/github.com/KhronosGroup/glslang.git' + '@' + '517f39eee46f27c83527117d831c4d7e2f7c9fe3',
Var('chromium_git') + '/external/github.com/KhronosGroup/glslang.git' + '@' + 'dc1b9762731ebca934143f1852637a48cd5b0656',

'src/third_party/google_toolbox_for_mac/src': {
'url': Var('chromium_git') + '/external/github.com/google/google-toolbox-for-mac.git' + '@' + Var('google_toolbox_for_mac_revision'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ size_t PartitionGetSizeEstimate(const AllocatorDispatch*,
void* address,
void* context) {
// TODO(lizeb): Returns incorrect values for aligned allocations.
return base::ThreadSafePartitionRoot::GetSizeFromPointer(address);
return base::ThreadSafePartitionRoot::GetAllocatedSize(address);
}

} // namespace
Expand Down
16 changes: 10 additions & 6 deletions base/allocator/partition_allocator/partition_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ struct BASE_EXPORT PartitionRoot {
// Same as |Free()|, bypasses the allocator hooks.
ALWAYS_INLINE static void FreeNoHooks(void* ptr);

ALWAYS_INLINE static size_t GetSizeFromPointer(void* ptr);
ALWAYS_INLINE static size_t GetAllocatedSize(void* ptr);
ALWAYS_INLINE size_t GetSize(void* ptr) const;
ALWAYS_INLINE size_t ActualSize(size_t size);

Expand Down Expand Up @@ -649,17 +649,21 @@ PartitionAllocGetPageForSize(void* ptr) {
} // namespace internal

// static
// Gets the allocated size of the |ptr|, adjusted for cookie and tag.
// (if any). Used as malloc_usable_size.
template <bool thread_safe>
ALWAYS_INLINE size_t PartitionRoot<thread_safe>::GetSizeFromPointer(void* ptr) {
ALWAYS_INLINE size_t PartitionRoot<thread_safe>::GetAllocatedSize(void* ptr) {
Page* page = Page::FromPointerNoAlignmentCheck(ptr);
auto* root = PartitionRoot<thread_safe>::FromPage(page);
return root->GetSize(ptr);

size_t size = page->GetAllocatedSize();
size = internal::PartitionSizeAdjustSubtract(root->allow_extras, size);
return size;
}

// Gets the size of the allocated slot that contains |ptr|, adjusted for cookie
// (if any).
// CAUTION! For direct-mapped allocation, |ptr| has to be within the first
// partition page.
// and tag (if any). CAUTION! For direct-mapped allocation, |ptr| has to be
// within the first partition page.
template <bool thread_safe>
ALWAYS_INLINE size_t PartitionRoot<thread_safe>::GetSize(void* ptr) const {
ptr = internal::PartitionPointerAdjustSubtract(allow_extras, ptr);
Expand Down
13 changes: 13 additions & 0 deletions base/allocator/partition_allocator/partition_alloc_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2566,6 +2566,19 @@ TEST_F(PartitionAllocTest, OptimizedGetSlotOffset) {
}
}

TEST_F(PartitionAllocTest, GetAllocatedSize) {
size_t delta = kSystemPageSize + 1;
for (size_t size = 1; size <= kMinDirectMappedDownsize; size += delta) {
void* ptr = allocator.root()->Alloc(size, "");
EXPECT_TRUE(ptr);
size_t usable_size = PartitionRoot<ThreadSafe>::GetAllocatedSize(ptr);
EXPECT_LE(size, usable_size);
memset(ptr, 0xDE, usable_size);
// Should not crash when free the ptr.
allocator.root()->Free(ptr);
}
}

} // namespace internal
} // namespace base

Expand Down
2 changes: 1 addition & 1 deletion build/fuchsia/linux.sdk.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.20200906.3.1
0.20200907.0.1
2 changes: 1 addition & 1 deletion build/fuchsia/mac.sdk.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.20200906.3.1
0.20200907.0.1
3 changes: 2 additions & 1 deletion cc/layers/picture_layer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,8 @@ LCDTextDisallowedReason PictureLayerImpl::ComputeLCDTextDisallowedReason(
return LCDTextDisallowedReason::kTransformAnimation;

EffectNode* effect_node = GetEffectTree().Node(effect_tree_index());
if (effect_node->node_or_ancestor_has_filters)
if (effect_node->node_or_ancestor_has_filters ||
effect_node->affected_by_backdrop_effect)
return LCDTextDisallowedReason::kPixelOrColorEffect;

return LCDTextDisallowedReason::kNone;
Expand Down
14 changes: 14 additions & 0 deletions cc/layers/picture_layer_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6418,6 +6418,20 @@ TEST_P(LCDTextTest, Filter) {
CheckCanUseLCDText(LCDTextDisallowedReason::kNone, "no filter");
}

TEST_P(LCDTextTest, BackdropFilter) {
FilterOperations backdrop_filter;
backdrop_filter.Append(FilterOperation::CreateBlurFilter(4.0f));
SetBackdropFilter(descendant_, backdrop_filter);
CheckCanUseLCDText(LCDTextDisallowedReason::kPixelOrColorEffect,
"backdrop-filter", layer_);
CheckCanUseLCDText(LCDTextDisallowedReason::kNone, "backdrop-filter",
descendant_);

SetBackdropFilter(descendant_, FilterOperations());
CheckCanUseLCDText(LCDTextDisallowedReason::kNone, "no backdrop-filter",
layer_);
}

TEST_P(LCDTextTest, ContentsOpaqueForText) {
layer_->SetContentsOpaque(false);
layer_->SetBackgroundColor(SK_ColorGREEN);
Expand Down
3 changes: 3 additions & 0 deletions cc/trees/effect_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ EffectNode::EffectNode()
subtree_has_copy_request(false),
is_fast_rounded_corner(false),
node_or_ancestor_has_filters(false),
affected_by_backdrop_effect(false),
render_surface_reason(RenderSurfaceReason::kNone),
transform_id(0),
clip_id(0),
Expand All @@ -61,6 +62,7 @@ bool EffectNode::operator==(const EffectNode& other) const {
rounded_corner_bounds == other.rounded_corner_bounds &&
is_fast_rounded_corner == other.is_fast_rounded_corner &&
node_or_ancestor_has_filters == other.node_or_ancestor_has_filters &&
affected_by_backdrop_effect == other.affected_by_backdrop_effect &&
// The specific reason is just for tracing/testing/debugging, so just
// check whether a render surface is needed.
HasRenderSurface() == other.HasRenderSurface() &&
Expand Down Expand Up @@ -188,6 +190,7 @@ void EffectNode::AsValueInto(base::trace_event::TracedValue* value) const {
closest_ancestor_with_cached_render_surface_id);
value->SetInteger("closest_ancestor_with_copy_request_id",
closest_ancestor_with_copy_request_id);
value->SetBoolean("affected_by_backdrop_effect", affected_by_backdrop_effect);
}

} // namespace cc
4 changes: 4 additions & 0 deletions cc/trees/effect_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ struct CC_EXPORT EffectNode {
bool is_fast_rounded_corner : 1;
// If the node or it's parent has the filters, it sets to true.
bool node_or_ancestor_has_filters : 1;
// All node in the subtree starting from the containing render surface, and
// before the backdrop effect node in pre tree order.
// The backdrop effects include backdrop filters and exotic blend modes.
bool affected_by_backdrop_effect: 1;
// RenderSurfaceReason::kNone if this effect node should not create a render
// surface, or the reason that this effect node should create one.
RenderSurfaceReason render_surface_reason;
Expand Down
12 changes: 12 additions & 0 deletions cc/trees/property_tree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,17 @@ void EffectTree::UpdateOnlyDrawsVisibleContent(EffectNode* node,
}
}

void EffectTree::UpdateNodesAffectedByBackdropEffect(EffectNode* node) {
node->affected_by_backdrop_effect = false;
const bool has_backdrop_effect = !node->backdrop_filters.IsEmpty() ||
node->blend_mode != SkBlendMode::kSrcOver;
if (!has_backdrop_effect)
return;

for (int i = node->target_id; i < node->id; ++i)
Node(i)->affected_by_backdrop_effect = true;
}

void EffectTree::UpdateSurfaceContentsScale(EffectNode* effect_node) {
if (!effect_node->HasRenderSurface()) {
effect_node->surface_contents_scale = gfx::Vector2dF(1.0f, 1.0f);
Expand Down Expand Up @@ -868,6 +879,7 @@ void EffectTree::UpdateEffects(int id) {
UpdateHasMaskingChild(node, parent_node);
UpdateOnlyDrawsVisibleContent(node, parent_node);
UpdateSurfaceContentsScale(node);
UpdateNodesAffectedByBackdropEffect(node);
}

void EffectTree::AddCopyRequest(
Expand Down
1 change: 1 addition & 0 deletions cc/trees/property_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> {
void UpdateBackfaceVisibility(EffectNode* node, EffectNode* parent_node);
void UpdateHasMaskingChild(EffectNode* node, EffectNode* parent_node);
void UpdateOnlyDrawsVisibleContent(EffectNode* node, EffectNode* parent_node);
void UpdateNodesAffectedByBackdropEffect(EffectNode* node);

// Stores copy requests, keyed by node id.
std::unordered_multimap<int, std::unique_ptr<viz::CopyOutputRequest>>
Expand Down
2 changes: 1 addition & 1 deletion chrome/VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MAJOR=87
MINOR=0
BUILD=4257
BUILD=4258
PATCH=0
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.content.Context;

import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;

import org.chromium.base.metrics.RecordUserAction;
Expand Down Expand Up @@ -66,6 +67,8 @@ interface UpdatedCallback {

private static final int RECENTLY_CLOSED_MAX_TAB_COUNT = 5;

private static @Nullable @PromoState Integer sPromoStateForTests;

private static RecentlyClosedTabManager sRecentlyClosedTabManagerForTests;

private final Profile mProfile;
Expand Down Expand Up @@ -360,6 +363,10 @@ public boolean isPromoCollapsed() {
*/
@PromoState
int getPromoType() {
if (sPromoStateForTests != null) {
return sPromoStateForTests;
}

if (!mSignInManager.getIdentityManager().hasPrimaryAccount()) {
if (!mSignInManager.isSignInAllowed()) {
return PromoState.PROMO_NONE;
Expand All @@ -373,10 +380,6 @@ int getPromoType() {
return PromoState.PROMO_SIGNIN_PERSONALIZED;
}

if (ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)) {
return PromoState.PROMO_SYNC_PERSONALIZED;
}

if (AndroidSyncSettings.get().isSyncEnabled()
&& AndroidSyncSettings.get().isChromeSyncEnabled() && !mForeignSessions.isEmpty()) {
return PromoState.PROMO_NONE;
Expand Down Expand Up @@ -443,6 +446,16 @@ private void update() {
});
}

/**
* Forces the promo state to a particular value for testing purposes.
* @param promoState The promo state to which the manager will be set to.
* TODO(https://crbug.com/1123478): Create a different method to enforce promo state.
*/
@VisibleForTesting
static void forcePromoStateForTests(@Nullable @PromoState Integer promoState) {
sPromoStateForTests = promoState;
}

@VisibleForTesting
public static void setRecentlyClosedTabManagerForTests(RecentlyClosedTabManager manager) {
sRecentlyClosedTabManagerForTests = manager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class RecentTabsRowAdapter extends BaseExpandableListAdapter {
private static final int MAX_NUM_FAVICONS_TO_CACHE = 128;

@IntDef({ChildType.NONE, ChildType.DEFAULT_CONTENT, ChildType.PERSONALIZED_SIGNIN_PROMO,
ChildType.SYNC_PROMO})
ChildType.PERSONALIZED_SYNC_PROMO, ChildType.SYNC_PROMO})
@Retention(RetentionPolicy.SOURCE)
private @interface ChildType {
// Values should be enumerated from 0 and can't have gaps.
Expand Down
Loading

0 comments on commit 7d0d5f0

Please sign in to comment.