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

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2783543004: Move registration of LocalFrame mojo interfaces to ModulesInitializer. (Closed)
Patch Set: Address code review feedback. Created 3 years, 9 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/frame/LocalFrame.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index 79e76e01993ab7a1f1ba3c4220fa9fb19d2e886d..1345128f766e6a0c6c9068c6d8807b0872c8b65b 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -255,6 +255,13 @@ inline float parentTextZoomFactor(LocalFrame* frame) {
return toLocalFrame(parent)->textZoomFactor();
}
+std::vector<LocalFrame::FrameInitCallback>& getInitializationVector() {
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(
+ std::vector<LocalFrame::FrameInitCallback>, initializationVector,
haraken 2017/03/29 08:10:24 Use WTF::Vector. Blink doesn't use std::vector. A
slangley 2017/03/29 23:09:38 Done
+ new std::vector<LocalFrame::FrameInitCallback>());
+ return initializationVector;
+}
+
} // namespace
template class CORE_TEMPLATE_EXPORT Supplement<LocalFrame>;
@@ -274,6 +281,14 @@ LocalFrame* LocalFrame::create(LocalFrameClient* client,
return frame;
}
+void LocalFrame::init() {
+ m_loader.init();
+
+ for (auto& initilizationCallback : getInitializationVector()) {
+ initilizationCallback(this);
+ }
+}
+
void LocalFrame::setView(FrameView* view) {
ASSERT(!m_view || m_view != view);
ASSERT(!document() || !document()->isActive());
@@ -844,6 +859,10 @@ bool LocalFrame::shouldThrottleRendering() const {
return view() && view()->shouldThrottleRendering();
}
+void LocalFrame::registerInitializationCallback(FrameInitCallback cb) {
+ getInitializationVector().push_back(cb);
haraken 2017/03/29 08:10:24 cb => callback Blink prefers a fully qualified na
slangley 2017/03/29 23:09:38 Done
+}
+
inline LocalFrame::LocalFrame(LocalFrameClient* client,
Page& page,
FrameOwner* owner,

Powered by Google App Engine
This is Rietveld 408576698