Commit b9e7641f authored by Omer Katz's avatar Omer Katz Committed by Commit Bot

heap: Fix bailout for HashMap

The HashTraits for KeyValuePair were updated to allow concurrent
marking, but HashMapValueTraits did not inherit that.
kCanTraceConcurrently is moved from HashTraits<KeyValuePair> to
KeyValuePairHashTraits so that it is inherited by HashMapValueTraits.

Bug: 986235
Change-Id: Id33b6054db3b8bf044cab6ebfd0e1d677118fab4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2320169
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791852}
parent ab74e927
......@@ -8,7 +8,6 @@
#include "base/compiler_specific.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/layout/geometry/physical_offset.h"
#include "third_party/blink/renderer/core/layout/geometry/physical_rect.h"
#include "third_party/blink/renderer/core/layout/geometry/physical_size.h"
#include "third_party/blink/renderer/platform/geometry/float_rect.h"
#include "third_party/blink/renderer/platform/geometry/layout_rect.h"
......
......@@ -7,6 +7,7 @@
#include "third_party/blink/public/platform/web_vector.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/layout/geometry/physical_rect.h"
#include "third_party/blink/renderer/core/layout/layout_shift_region.h"
#include "third_party/blink/renderer/core/scroll/scroll_types.h"
#include "third_party/blink/renderer/core/timing/layout_shift.h"
......
......@@ -50,13 +50,6 @@ static const int kProgressItemDefaultEstimatedLength = 1024 * 1024;
static const double kProgressNotificationInterval = 0.02;
static const double kProgressNotificationTimeInterval = 0.1;
struct ProgressItem {
USING_FAST_MALLOC(ProgressItem);
public:
int64_t bytes_received = 0;
int64_t estimated_length = 0;
};
ProgressTracker::ProgressTracker(LocalFrame* frame)
: frame_(frame),
last_notified_progress_value_(0),
......
......@@ -42,7 +42,14 @@ namespace blink {
class LocalFrameClient;
class LocalFrame;
class ResourceResponse;
struct ProgressItem;
struct ProgressItem {
USING_FAST_MALLOC(ProgressItem);
public:
int64_t bytes_received = 0;
int64_t estimated_length = 0;
};
// FIXME: This is only used on Android. Android is the only Chrome
// browser which shows a progress bar during loading.
......
......@@ -8,6 +8,7 @@
#include "third_party/blink/renderer/core/dom/qualified_name.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/heap_allocator.h"
#include "third_party/blink/renderer/platform/heap/member.h"
namespace blink {
......
......@@ -9,7 +9,7 @@
#include "base/macros.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/mojom/cache_storage/cache_storage.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/cache_storage/cache_storage.mojom-blink.h"
#include "third_party/blink/renderer/core/inspector/inspector_base_agent.h"
#include "third_party/blink/renderer/core/inspector/protocol/CacheStorage.h"
#include "third_party/blink/renderer/modules/modules_export.h"
......
......@@ -32,15 +32,6 @@ bool RemoveStreamDeviceFromArray(const MediaStreamDevice& device,
} // namespace
struct MediaStreamDeviceObserver::Stream {
Stream() {}
~Stream() {}
WebMediaStreamDeviceObserver::OnDeviceStoppedCb on_device_stopped_cb;
WebMediaStreamDeviceObserver::OnDeviceChangedCb on_device_changed_cb;
MediaStreamDevices audio_devices;
MediaStreamDevices video_devices;
};
MediaStreamDeviceObserver::MediaStreamDeviceObserver(LocalFrame* frame) {
// There is no frame on unit tests.
if (frame) {
......
......@@ -69,7 +69,12 @@ class MODULES_EXPORT MediaStreamDeviceObserver
// Private class for keeping track of opened devices and who have
// opened it.
struct Stream;
struct Stream {
WebMediaStreamDeviceObserver::OnDeviceStoppedCb on_device_stopped_cb;
WebMediaStreamDeviceObserver::OnDeviceChangedCb on_device_changed_cb;
MediaStreamDevices audio_devices;
MediaStreamDevices video_devices;
};
// mojom::MediaStreamDeviceObserver implementation.
void OnDeviceStopped(const String& label,
......
......@@ -10,6 +10,7 @@
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/mojom/blob/blob.mojom-blink.h"
#include "third_party/blink/renderer/platform/weborigin/kurl_hash.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
......
......@@ -477,15 +477,16 @@ struct KeyValuePairHashTraits
static bool IsDeletedValue(const TraitType& value) {
return KeyTraits::IsDeletedValue(value.key);
}
static constexpr bool kCanTraceConcurrently =
KeyTraitsArg::kCanTraceConcurrently &&
(ValueTraitsArg::kCanTraceConcurrently ||
!IsTraceable<typename ValueTraitsArg::TraitType>::value);
};
template <typename Key, typename Value>
struct HashTraits<KeyValuePair<Key, Value>>
: public KeyValuePairHashTraits<HashTraits<Key>, HashTraits<Value>> {
static constexpr bool kCanTraceConcurrently =
HashTraits<Key>::kCanTraceConcurrently &&
(HashTraits<Value>::kCanTraceConcurrently || !IsTraceable<Value>::value);
};
: public KeyValuePairHashTraits<HashTraits<Key>, HashTraits<Value>> {};
template <typename T>
struct NullableHashTraits : public HashTraits<T> {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment