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(FrameClient* client, FrameHost* host, FrameOwner* owner) | 72 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) |
61 : m_treeNode(this) | 73 : m_treeNode(this) |
62 , m_host(host) | 74 , m_host(host) |
63 , m_owner(owner) | 75 , m_owner(owner) |
64 , m_client(client) | 76 , m_client(client) |
| 77 , m_frameID(generateFrameID()) |
65 , m_remotePlatformLayer(0) | 78 , m_remotePlatformLayer(0) |
66 { | 79 { |
67 ASSERT(page()); | 80 ASSERT(page()); |
68 | 81 |
69 #ifndef NDEBUG | 82 #ifndef NDEBUG |
70 frameCounter.increment(); | 83 frameCounter.increment(); |
71 #endif | 84 #endif |
72 | 85 |
73 if (m_owner) { | 86 if (m_owner) { |
74 page()->incrementSubframeCount(); | 87 page()->incrementSubframeCount(); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 212 } |
200 m_owner = 0; | 213 m_owner = 0; |
201 } | 214 } |
202 | 215 |
203 HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const | 216 HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const |
204 { | 217 { |
205 return m_owner && m_owner->isLocal() ? toHTMLFrameOwnerElement(m_owner) : 0; | 218 return m_owner && m_owner->isLocal() ? toHTMLFrameOwnerElement(m_owner) : 0; |
206 } | 219 } |
207 | 220 |
208 } // namespace blink | 221 } // namespace blink |
OLD | NEW |