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

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

Issue 2783543004: Move registration of LocalFrame mojo interfaces to ModulesInitializer. (Closed)
Patch Set: Remove unused headers. 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..91582a29150065241cb2d22dcb34bb89666e7bd8 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::frame_init_callback>& getInitiailizationVector() {
sashab 2017/03/29 00:33:23 getInitiailizationVector -> getInitializationVecto
slangley 2017/03/29 02:27:08 Done
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(
+ std::vector<LocalFrame::frame_init_callback>, iv,
+ new std::vector<LocalFrame::frame_init_callback>());
+ return iv;
sashab 2017/03/29 00:33:23 initializationVector
slangley 2017/03/29 02:27:08 Done
+}
+
} // 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& cb : getInitiailizationVector()) {
sashab 2017/03/29 00:33:23 choose better var name than cb. maybe initializati
slangley 2017/03/29 02:27:08 Done
+ cb(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(frame_init_callback cb) {
sashab 2017/03/29 00:33:23 why does frame_init_callback have underscores? wha
slangley 2017/03/29 02:27:08 Done
+ getInitiailizationVector().push_back(cb);
+}
+
inline LocalFrame::LocalFrame(LocalFrameClient* client,
Page& page,
FrameOwner* owner,

Powered by Google App Engine
This is Rietveld 408576698