| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "core/rendering/RenderPart.h" | 48 #include "core/rendering/RenderPart.h" |
| 49 #include "platform/graphics/GraphicsLayer.h" | 49 #include "platform/graphics/GraphicsLayer.h" |
| 50 #include "public/platform/WebLayer.h" | 50 #include "public/platform/WebLayer.h" |
| 51 #include "wtf/PassOwnPtr.h" | 51 #include "wtf/PassOwnPtr.h" |
| 52 #include "wtf/RefCountedLeakCounter.h" | 52 #include "wtf/RefCountedLeakCounter.h" |
| 53 | 53 |
| 54 namespace blink { | 54 namespace blink { |
| 55 | 55 |
| 56 using namespace HTMLNames; | 56 using namespace HTMLNames; |
| 57 | 57 |
| 58 namespace { |
| 59 |
| 60 int64_t generateFrameID() |
| 61 { |
| 62 // Initialize to the current time to reduce the likelihood of generating |
| 63 // identifiers that overlap with those from past/future browser sessions. |
| 64 static int64_t next = static_cast<int64_t>(currentTime() * 1000000.0); |
| 65 return ++next; |
| 66 } |
| 67 |
| 68 } // namespace |
| 69 |
| 58 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); | 70 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); |
| 59 | 71 |
| 60 Frame::~Frame() | 72 Frame::~Frame() |
| 61 { | 73 { |
| 62 ASSERT(!m_owner); | 74 ASSERT(!m_owner); |
| 63 #ifndef NDEBUG | 75 #ifndef NDEBUG |
| 64 frameCounter.decrement(); | 76 frameCounter.decrement(); |
| 65 #endif | 77 #endif |
| 66 } | 78 } |
| 67 | 79 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 if (m_host) | 295 if (m_host) |
| 284 return &m_host->settings(); | 296 return &m_host->settings(); |
| 285 return nullptr; | 297 return nullptr; |
| 286 } | 298 } |
| 287 | 299 |
| 288 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) | 300 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) |
| 289 : m_treeNode(this) | 301 : m_treeNode(this) |
| 290 , m_host(host) | 302 , m_host(host) |
| 291 , m_owner(owner) | 303 , m_owner(owner) |
| 292 , m_client(client) | 304 , m_client(client) |
| 305 , m_frameID(generateFrameID()) |
| 293 , m_remotePlatformLayer(nullptr) | 306 , m_remotePlatformLayer(nullptr) |
| 294 , m_isLoading(false) | 307 , m_isLoading(false) |
| 295 { | 308 { |
| 296 ASSERT(page()); | 309 ASSERT(page()); |
| 297 | 310 |
| 298 #ifndef NDEBUG | 311 #ifndef NDEBUG |
| 299 frameCounter.increment(); | 312 frameCounter.increment(); |
| 300 #endif | 313 #endif |
| 301 | 314 |
| 302 if (m_owner) { | 315 if (m_owner) { |
| 303 if (m_owner->isLocal()) | 316 if (m_owner->isLocal()) |
| 304 toHTMLFrameOwnerElement(m_owner)->setContentFrame(*this); | 317 toHTMLFrameOwnerElement(m_owner)->setContentFrame(*this); |
| 305 } else { | 318 } else { |
| 306 page()->setMainFrame(this); | 319 page()->setMainFrame(this); |
| 307 } | 320 } |
| 308 } | 321 } |
| 309 | 322 |
| 310 } // namespace blink | 323 } // namespace blink |
| OLD | NEW |