Chromium Code Reviews| 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, |