Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1581)

Side by Side Diff: Source/core/frame/Frame.cpp

Issue 908453003: Blink changes to record interest rects for http://w3c.github.io/frame-timing/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review comments (and re-sync) Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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);
chrishtr 2015/03/27 01:13:02 currentTime() is already in seconds, no?
MikeB 2015/04/14 18:05:45 Yes, it's making "next" start off at a very large
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 if (m_host) 291 if (m_host)
280 return &m_host->settings(); 292 return &m_host->settings();
281 return nullptr; 293 return nullptr;
282 } 294 }
283 295
284 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) 296 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner)
285 : m_treeNode(this) 297 : m_treeNode(this)
286 , m_host(host) 298 , m_host(host)
287 , m_owner(owner) 299 , m_owner(owner)
288 , m_client(client) 300 , m_client(client)
301 , m_frameID(generateFrameID())
289 , m_isLoading(false) 302 , m_isLoading(false)
290 { 303 {
291 ASSERT(page()); 304 ASSERT(page());
292 305
293 #ifndef NDEBUG 306 #ifndef NDEBUG
294 frameCounter.increment(); 307 frameCounter.increment();
295 #endif 308 #endif
296 309
297 if (m_owner) { 310 if (m_owner) {
298 if (m_owner->isLocal()) 311 if (m_owner->isLocal())
299 toHTMLFrameOwnerElement(m_owner)->setContentFrame(*this); 312 toHTMLFrameOwnerElement(m_owner)->setContentFrame(*this);
300 } else { 313 } else {
301 page()->setMainFrame(this); 314 page()->setMainFrame(this);
302 } 315 }
303 } 316 }
304 317
305 } // namespace blink 318 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698