| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "core/page/Page.h" | 47 #include "core/page/Page.h" |
| 48 #include "core/rendering/RenderPart.h" | 48 #include "core/rendering/RenderPart.h" |
| 49 #include "public/platform/WebLayer.h" | 49 #include "public/platform/WebLayer.h" |
| 50 #include "wtf/PassOwnPtr.h" | 50 #include "wtf/PassOwnPtr.h" |
| 51 #include "wtf/RefCountedLeakCounter.h" | 51 #include "wtf/RefCountedLeakCounter.h" |
| 52 | 52 |
| 53 namespace WebCore { | 53 namespace WebCore { |
| 54 | 54 |
| 55 using namespace HTMLNames; | 55 using namespace HTMLNames; |
| 56 | 56 |
| 57 namespace { | |
| 58 | |
| 59 int64_t generateFrameID() | |
| 60 { | |
| 61 // Initialize to the current time to reduce the likelihood of generating | |
| 62 // identifiers that overlap with those from past/future browser sessions. | |
| 63 static int64_t next = static_cast<int64_t>(currentTime() * 1000000.0); | |
| 64 return ++next; | |
| 65 } | |
| 66 | |
| 67 } // namespace | |
| 68 | |
| 69 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); | 57 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); |
| 70 | 58 |
| 71 Frame::Frame(FrameHost* host, HTMLFrameOwnerElement* ownerElement) | 59 Frame::Frame(FrameHost* host, HTMLFrameOwnerElement* ownerElement) |
| 72 : m_host(host) | 60 : m_host(host) |
| 73 , m_ownerElement(ownerElement) | 61 , m_ownerElement(ownerElement) |
| 74 , m_frameID(generateFrameID()) | |
| 75 , m_remotePlatformLayer(0) | 62 , m_remotePlatformLayer(0) |
| 76 { | 63 { |
| 77 ASSERT(page()); | 64 ASSERT(page()); |
| 78 | 65 |
| 79 #ifndef NDEBUG | 66 #ifndef NDEBUG |
| 80 frameCounter.increment(); | 67 frameCounter.increment(); |
| 81 #endif | 68 #endif |
| 82 | 69 |
| 83 if (this->ownerElement()) { | 70 if (this->ownerElement()) { |
| 84 page()->incrementSubframeCount(); | 71 page()->incrementSubframeCount(); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 { | 183 { |
| 197 if (ownerElement()) { | 184 if (ownerElement()) { |
| 198 ownerElement()->clearContentFrame(); | 185 ownerElement()->clearContentFrame(); |
| 199 if (page()) | 186 if (page()) |
| 200 page()->decrementSubframeCount(); | 187 page()->decrementSubframeCount(); |
| 201 } | 188 } |
| 202 m_ownerElement = 0; | 189 m_ownerElement = 0; |
| 203 } | 190 } |
| 204 | 191 |
| 205 } // namespace WebCore | 192 } // namespace WebCore |
| OLD | NEW |