OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Simon Hausmann <hausmann@kde.org> | 5 * 2000 Simon Hausmann <hausmann@kde.org> |
6 * 2000 Stefan Schimanski <1Stein@gmx.de> | 6 * 2000 Stefan Schimanski <1Stein@gmx.de> |
7 * 2001 George Staikos <staikos@kde.org> | 7 * 2001 George Staikos <staikos@kde.org> |
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> | 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> |
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "config.h" | 30 #include "config.h" |
31 #include "core/frame/Frame.h" | 31 #include "core/frame/Frame.h" |
32 | 32 |
33 #include "core/dom/DocumentType.h" | 33 #include "core/dom/DocumentType.h" |
34 #include "core/events/Event.h" | 34 #include "core/events/Event.h" |
35 #include "core/frame/LocalDOMWindow.h" | 35 #include "core/frame/LocalDOMWindow.h" |
36 #include "core/frame/FrameHost.h" | 36 #include "core/frame/FrameHost.h" |
37 #include "core/frame/Settings.h" | 37 #include "core/frame/Settings.h" |
38 #include "core/html/HTMLFrameElementBase.h" | 38 #include "core/html/HTMLFrameElementBase.h" |
39 #include "core/inspector/InspectorInstrumentation.h" | 39 #include "core/inspector/InspectorInstrumentation.h" |
40 #include "core/layout/Layer.h" | |
41 #include "core/loader/EmptyClients.h" | 40 #include "core/loader/EmptyClients.h" |
42 #include "core/loader/FrameLoaderClient.h" | 41 #include "core/loader/FrameLoaderClient.h" |
43 #include "core/page/Chrome.h" | 42 #include "core/page/Chrome.h" |
44 #include "core/page/ChromeClient.h" | 43 #include "core/page/ChromeClient.h" |
45 #include "core/page/EventHandler.h" | 44 #include "core/page/EventHandler.h" |
46 #include "core/page/FocusController.h" | 45 #include "core/page/FocusController.h" |
47 #include "core/page/Page.h" | 46 #include "core/page/Page.h" |
48 #include "core/rendering/RenderPart.h" | 47 #include "core/rendering/RenderPart.h" |
49 #include "platform/graphics/GraphicsLayer.h" | |
50 #include "public/platform/WebLayer.h" | |
51 #include "wtf/PassOwnPtr.h" | 48 #include "wtf/PassOwnPtr.h" |
52 #include "wtf/RefCountedLeakCounter.h" | 49 #include "wtf/RefCountedLeakCounter.h" |
53 | 50 |
54 namespace blink { | 51 namespace blink { |
55 | 52 |
56 using namespace HTMLNames; | 53 using namespace HTMLNames; |
57 | 54 |
58 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); | 55 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); |
59 | 56 |
60 Frame::~Frame() | 57 Frame::~Frame() |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 return nullptr; | 254 return nullptr; |
258 // FIXME: If <object> is ever fixed to disassociate itself from frames | 255 // FIXME: If <object> is ever fixed to disassociate itself from frames |
259 // that it has started but canceled, then this can turn into an ASSERT | 256 // that it has started but canceled, then this can turn into an ASSERT |
260 // since ownerElement() would be 0 when the load is canceled. | 257 // since ownerElement() would be 0 when the load is canceled. |
261 // https://bugs.webkit.org/show_bug.cgi?id=18585 | 258 // https://bugs.webkit.org/show_bug.cgi?id=18585 |
262 if (!object->isRenderPart()) | 259 if (!object->isRenderPart()) |
263 return nullptr; | 260 return nullptr; |
264 return toRenderPart(object); | 261 return toRenderPart(object); |
265 } | 262 } |
266 | 263 |
267 void Frame::setRemotePlatformLayer(WebLayer* layer) | |
268 { | |
269 if (m_remotePlatformLayer) | |
270 GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); | |
271 m_remotePlatformLayer = layer; | |
272 if (m_remotePlatformLayer) | |
273 GraphicsLayer::registerContentsLayer(layer); | |
274 | |
275 ASSERT(owner()); | |
276 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); | |
277 if (RenderPart* renderer = ownerRenderer()) | |
278 renderer->layer()->updateSelfPaintingLayer(); | |
279 } | |
280 | |
281 Settings* Frame::settings() const | 264 Settings* Frame::settings() const |
282 { | 265 { |
283 if (m_host) | 266 if (m_host) |
284 return &m_host->settings(); | 267 return &m_host->settings(); |
285 return nullptr; | 268 return nullptr; |
286 } | 269 } |
287 | 270 |
288 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) | 271 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) |
289 : m_treeNode(this) | 272 : m_treeNode(this) |
290 , m_host(host) | 273 , m_host(host) |
291 , m_owner(owner) | 274 , m_owner(owner) |
292 , m_client(client) | 275 , m_client(client) |
293 , m_remotePlatformLayer(nullptr) | |
294 , m_isLoading(false) | 276 , m_isLoading(false) |
295 { | 277 { |
296 ASSERT(page()); | 278 ASSERT(page()); |
297 | 279 |
298 #ifndef NDEBUG | 280 #ifndef NDEBUG |
299 frameCounter.increment(); | 281 frameCounter.increment(); |
300 #endif | 282 #endif |
301 | 283 |
302 if (m_owner) { | 284 if (m_owner) { |
303 if (m_owner->isLocal()) | 285 if (m_owner->isLocal()) |
304 toHTMLFrameOwnerElement(m_owner)->setContentFrame(*this); | 286 toHTMLFrameOwnerElement(m_owner)->setContentFrame(*this); |
305 } else { | 287 } else { |
306 page()->setMainFrame(this); | 288 page()->setMainFrame(this); |
307 } | 289 } |
308 } | 290 } |
309 | 291 |
310 } // namespace blink | 292 } // namespace blink |
OLD | NEW |