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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #include "core/rendering/RenderPart.h" | 49 #include "core/rendering/RenderPart.h" |
50 #include "platform/graphics/GraphicsLayer.h" | 50 #include "platform/graphics/GraphicsLayer.h" |
51 #include "public/platform/WebLayer.h" | 51 #include "public/platform/WebLayer.h" |
52 #include "wtf/PassOwnPtr.h" | 52 #include "wtf/PassOwnPtr.h" |
53 #include "wtf/RefCountedLeakCounter.h" | 53 #include "wtf/RefCountedLeakCounter.h" |
54 | 54 |
55 namespace WebCore { | 55 namespace WebCore { |
56 | 56 |
57 using namespace HTMLNames; | 57 using namespace HTMLNames; |
58 | 58 |
| 59 namespace { |
| 60 |
| 61 int64_t generateFrameID() |
| 62 { |
| 63 // Initialize to the current time to reduce the likelihood of generating |
| 64 // identifiers that overlap with those from past/future browser sessions. |
| 65 static int64_t next = static_cast<int64_t>(currentTime() * 1000000.0); |
| 66 return ++next; |
| 67 } |
| 68 |
| 69 } // namespace |
| 70 |
59 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); | 71 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); |
60 | 72 |
61 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) | 73 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) |
62 : m_treeNode(this) | 74 : m_treeNode(this) |
63 , m_host(host) | 75 , m_host(host) |
64 , m_owner(owner) | 76 , m_owner(owner) |
65 , m_client(client) | 77 , m_client(client) |
| 78 , m_frameID(generateFrameID()) |
66 , m_remotePlatformLayer(0) | 79 , m_remotePlatformLayer(0) |
67 { | 80 { |
68 ASSERT(page()); | 81 ASSERT(page()); |
69 | 82 |
70 #ifndef NDEBUG | 83 #ifndef NDEBUG |
71 frameCounter.increment(); | 84 frameCounter.increment(); |
72 #endif | 85 #endif |
73 | 86 |
74 if (m_owner) { | 87 if (m_owner) { |
75 page()->incrementSubframeCount(); | 88 page()->incrementSubframeCount(); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 } | 233 } |
221 m_owner = 0; | 234 m_owner = 0; |
222 } | 235 } |
223 | 236 |
224 HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const | 237 HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const |
225 { | 238 { |
226 return m_owner && m_owner->isLocal() ? toHTMLFrameOwnerElement(m_owner) : 0; | 239 return m_owner && m_owner->isLocal() ? toHTMLFrameOwnerElement(m_owner) : 0; |
227 } | 240 } |
228 | 241 |
229 } // namespace WebCore | 242 } // namespace WebCore |
OLD | NEW |