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