Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2894063002: Expose UseCounter::Feature enum out of blink as WebFeature (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/testing/Internals.cpp
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index 29cddf967555d612c0707c618ee9c00cfd8db2d9..140f507d60350fc95896917f459f673d9693f53c 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -164,14 +164,13 @@ class UseCounterObserverImpl final : public UseCounter::Observer {
WTF_MAKE_NONCOPYABLE(UseCounterObserverImpl);
public:
- UseCounterObserverImpl(ScriptPromiseResolver* resolver,
- UseCounter::Feature feature)
+ UseCounterObserverImpl(ScriptPromiseResolver* resolver, WebFeature feature)
: resolver_(resolver), feature_(feature) {}
- bool OnCountFeature(UseCounter::Feature feature) final {
+ bool OnCountFeature(WebFeature feature) final {
if (feature_ != feature)
return false;
- resolver_->Resolve(feature);
+ resolver_->Resolve(static_cast<int>(feature));
return true;
}
@@ -182,7 +181,7 @@ class UseCounterObserverImpl final : public UseCounter::Observer {
private:
Member<ScriptPromiseResolver> resolver_;
- UseCounter::Feature feature_;
+ WebFeature feature_;
};
} // namespace
@@ -3208,8 +3207,8 @@ ScriptPromise Internals::observeUseCounter(ScriptState* script_state,
return promise;
}
- page->GetUseCounter().AddObserver(
- new UseCounterObserverImpl(resolver, use_counter_feature));
+ page->GetUseCounter().AddObserver(new UseCounterObserverImpl(
+ resolver, static_cast<WebFeature>(use_counter_feature)));
return promise;
}

Powered by Google App Engine
This is Rietveld 408576698