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

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

Issue 46783003: Add a unique frame id and save it on HistoryItem. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 94
95 static inline float parentTextZoomFactor(Frame* frame) 95 static inline float parentTextZoomFactor(Frame* frame)
96 { 96 {
97 Frame* parent = frame->tree().parent(); 97 Frame* parent = frame->tree().parent();
98 if (!parent) 98 if (!parent)
99 return 1; 99 return 1;
100 return parent->textZoomFactor(); 100 return parent->textZoomFactor();
101 } 101 }
102 102
103 static int64_t nextFrameID()
104 {
105 static int64_t next = static_cast<long long>(currentTime() * 10000000);
106 return ++next;
107 }
108
103 inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoader Client* frameLoaderClient) 109 inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoader Client* frameLoaderClient)
104 : m_page(page) 110 : m_page(page)
105 , m_treeNode(this, parentFromOwnerElement(ownerElement)) 111 , m_treeNode(this, parentFromOwnerElement(ownerElement))
106 , m_loader(this, frameLoaderClient) 112 , m_loader(this, frameLoaderClient)
107 , m_navigationScheduler(this) 113 , m_navigationScheduler(this)
108 , m_ownerElement(ownerElement) 114 , m_ownerElement(ownerElement)
109 , m_script(adoptPtr(new ScriptController(this))) 115 , m_script(adoptPtr(new ScriptController(this)))
110 , m_editor(Editor::create(*this)) 116 , m_editor(Editor::create(*this))
111 , m_spellChecker(SpellChecker::create(*this)) 117 , m_spellChecker(SpellChecker::create(*this))
112 , m_selection(adoptPtr(new FrameSelection(this))) 118 , m_selection(adoptPtr(new FrameSelection(this)))
113 , m_eventHandler(adoptPtr(new EventHandler(this))) 119 , m_eventHandler(adoptPtr(new EventHandler(this)))
114 , m_animationController(adoptPtr(new AnimationController(this))) 120 , m_animationController(adoptPtr(new AnimationController(this)))
115 , m_inputMethodController(InputMethodController::create(*this)) 121 , m_inputMethodController(InputMethodController::create(*this))
122 , m_id(nextFrameID())
116 , m_pageZoomFactor(parentPageZoomFactor(this)) 123 , m_pageZoomFactor(parentPageZoomFactor(this))
117 , m_textZoomFactor(parentTextZoomFactor(this)) 124 , m_textZoomFactor(parentTextZoomFactor(this))
118 #if ENABLE(ORIENTATION_EVENTS) 125 #if ENABLE(ORIENTATION_EVENTS)
119 , m_orientation(0) 126 , m_orientation(0)
120 #endif 127 #endif
121 , m_inViewSourceMode(false) 128 , m_inViewSourceMode(false)
122 { 129 {
123 ASSERT(page); 130 ASSERT(page);
124 131
125 if (ownerElement) { 132 if (ownerElement) {
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 if (!m_page) 684 if (!m_page)
678 return 0; 685 return 0;
679 686
680 double ratio = m_page->deviceScaleFactor(); 687 double ratio = m_page->deviceScaleFactor();
681 if (RuntimeEnabledFeatures::devicePixelRatioIncludesZoomEnabled()) 688 if (RuntimeEnabledFeatures::devicePixelRatioIncludesZoomEnabled())
682 ratio *= pageZoomFactor(); 689 ratio *= pageZoomFactor();
683 return ratio; 690 return ratio;
684 } 691 }
685 692
686 } // namespace WebCore 693 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698