Commit 6ff2460f authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

AXObjectCache doesn't need to be an ExecutionContextLifecycleObserver

Bug: 1209822
Change-Id: I5aef8983d84ea517aef14134c9d657479dc72e19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2106533
Auto-Submit: Nate Chapin <japhet@chromium.org>
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750953}
parent 04970754
...@@ -12,7 +12,6 @@ blink_core_sources("accessibility") { ...@@ -12,7 +12,6 @@ blink_core_sources("accessibility") {
"ax_context.h", "ax_context.h",
"ax_object_cache.cc", "ax_object_cache.cc",
"ax_object_cache.h", "ax_object_cache.h",
"ax_object_cache_base.cc",
"ax_object_cache_base.h", "ax_object_cache_base.h",
"axid.h", "axid.h",
] ]
......
...@@ -56,11 +56,6 @@ AXObjectCache* AXObjectCache::Create(Document& document) { ...@@ -56,11 +56,6 @@ AXObjectCache* AXObjectCache::Create(Document& document) {
return create_function_(document); return create_function_(document);
} }
AXObjectCache::AXObjectCache(Document& document)
: ExecutionContextLifecycleObserver(document.GetExecutionContext()) {}
AXObjectCache::~AXObjectCache() = default;
namespace { namespace {
typedef HashSet<String, CaseFoldingHash> ARIAWidgetSet; typedef HashSet<String, CaseFoldingHash> ARIAWidgetSet;
...@@ -141,8 +136,4 @@ bool AXObjectCache::IsInsideFocusableElementOrARIAWidget(const Node& node) { ...@@ -141,8 +136,4 @@ bool AXObjectCache::IsInsideFocusableElementOrARIAWidget(const Node& node) {
return false; return false;
} }
void AXObjectCache::Trace(Visitor* visitor) {
ExecutionContextLifecycleObserver::Trace(visitor);
}
} // namespace blink } // namespace blink
...@@ -46,15 +46,12 @@ class LayoutRect; ...@@ -46,15 +46,12 @@ class LayoutRect;
class LineLayoutItem; class LineLayoutItem;
class LocalFrameView; class LocalFrameView;
class CORE_EXPORT AXObjectCache : public GarbageCollected<AXObjectCache>, class CORE_EXPORT AXObjectCache : public GarbageCollected<AXObjectCache> {
public ExecutionContextLifecycleObserver {
USING_GARBAGE_COLLECTED_MIXIN(AXObjectCache);
public: public:
static AXObjectCache* Create(Document&); static AXObjectCache* Create(Document&);
virtual ~AXObjectCache(); virtual ~AXObjectCache() = default;
void Trace(Visitor*) override; virtual void Trace(Visitor*) {}
virtual void Dispose() = 0; virtual void Dispose() = 0;
...@@ -152,7 +149,7 @@ class CORE_EXPORT AXObjectCache : public GarbageCollected<AXObjectCache>, ...@@ -152,7 +149,7 @@ class CORE_EXPORT AXObjectCache : public GarbageCollected<AXObjectCache>,
private: private:
friend class AXObjectCacheBase; friend class AXObjectCacheBase;
AXObjectCache(Document&); AXObjectCache() = default;
static AXObjectCacheCreateFunction create_function_; static AXObjectCacheCreateFunction create_function_;
DISALLOW_COPY_AND_ASSIGN(AXObjectCache); DISALLOW_COPY_AND_ASSIGN(AXObjectCache);
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/core/accessibility/ax_object_cache_base.h"
#include "third_party/blink/renderer/core/accessibility/ax_object_cache.h"
#include "third_party/blink/renderer/core/core_export.h"
namespace blink {
AXObjectCacheBase::~AXObjectCacheBase() = default;
AXObjectCacheBase::AXObjectCacheBase(Document& document)
: AXObjectCache(document) {}
} // namespace blink
...@@ -24,13 +24,13 @@ class AXObject; ...@@ -24,13 +24,13 @@ class AXObject;
// new public API methods or similar) and remove this class. // new public API methods or similar) and remove this class.
class CORE_EXPORT AXObjectCacheBase : public AXObjectCache { class CORE_EXPORT AXObjectCacheBase : public AXObjectCache {
public: public:
~AXObjectCacheBase() override; ~AXObjectCacheBase() override = default;
virtual AXObject* Get(const Node*) = 0; virtual AXObject* Get(const Node*) = 0;
virtual AXObject* GetOrCreate(LayoutObject*) = 0; virtual AXObject* GetOrCreate(LayoutObject*) = 0;
protected: protected:
AXObjectCacheBase(Document&); AXObjectCacheBase() = default;
DISALLOW_COPY_AND_ASSIGN(AXObjectCacheBase); DISALLOW_COPY_AND_ASSIGN(AXObjectCacheBase);
}; };
......
...@@ -129,8 +129,7 @@ AXObjectCache* AXObjectCacheImpl::Create(Document& document) { ...@@ -129,8 +129,7 @@ AXObjectCache* AXObjectCacheImpl::Create(Document& document) {
} }
AXObjectCacheImpl::AXObjectCacheImpl(Document& document) AXObjectCacheImpl::AXObjectCacheImpl(Document& document)
: AXObjectCacheBase(document), : document_(document),
document_(document),
modification_count_(0), modification_count_(0),
validation_message_axid_(0), validation_message_axid_(0),
relation_cache_(std::make_unique<AXRelationCache>(this)), relation_cache_(std::make_unique<AXRelationCache>(this)),
...@@ -1906,8 +1905,6 @@ void AXObjectCacheImpl::DidFinishLifecycleUpdate(const LocalFrameView& view) { ...@@ -1906,8 +1905,6 @@ void AXObjectCacheImpl::DidFinishLifecycleUpdate(const LocalFrameView& view) {
} }
} }
void AXObjectCacheImpl::ContextDestroyed() {}
void AXObjectCacheImpl::Trace(Visitor* visitor) { void AXObjectCacheImpl::Trace(Visitor* visitor) {
visitor->Trace(document_); visitor->Trace(document_);
visitor->Trace(accessible_node_mapping_); visitor->Trace(accessible_node_mapping_);
......
...@@ -339,9 +339,6 @@ class MODULES_EXPORT AXObjectCacheImpl ...@@ -339,9 +339,6 @@ class MODULES_EXPORT AXObjectCacheImpl
HeapVector<Member<AXEventParams>> notifications_to_post_; HeapVector<Member<AXEventParams>> notifications_to_post_;
void PostNotificationsAfterLayout(Document*); void PostNotificationsAfterLayout(Document*);
// ExecutionContextLifecycleObserver overrides.
void ContextDestroyed() override;
// Get the currently focused Node element. // Get the currently focused Node element.
Node* FocusedElement(); Node* FocusedElement();
......
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