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

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

Issue 289983004: Remove unnecessary NULL check in DOMWindow::top() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 return parent->domWindow(); 1255 return parent->domWindow();
1256 1256
1257 return m_frame->domWindow(); 1257 return m_frame->domWindow();
1258 } 1258 }
1259 1259
1260 DOMWindow* DOMWindow::top() const 1260 DOMWindow* DOMWindow::top() const
1261 { 1261 {
1262 if (!m_frame) 1262 if (!m_frame)
1263 return 0; 1263 return 0;
1264 1264
1265 Page* page = m_frame->page();
1266 if (!page)
1267 return 0;
1268
1269 return m_frame->tree().top()->domWindow(); 1265 return m_frame->tree().top()->domWindow();
1270 } 1266 }
1271 1267
1272 Document* DOMWindow::document() const 1268 Document* DOMWindow::document() const
1273 { 1269 {
1274 return m_document.get(); 1270 return m_document.get();
1275 } 1271 }
1276 1272
1277 StyleMedia& DOMWindow::styleMedia() const 1273 StyleMedia& DOMWindow::styleMedia() const
1278 { 1274 {
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 visitor->trace(m_media); 1880 visitor->trace(m_media);
1885 visitor->trace(m_sessionStorage); 1881 visitor->trace(m_sessionStorage);
1886 visitor->trace(m_localStorage); 1882 visitor->trace(m_localStorage);
1887 visitor->trace(m_applicationCache); 1883 visitor->trace(m_applicationCache);
1888 visitor->trace(m_performance); 1884 visitor->trace(m_performance);
1889 visitor->trace(m_css); 1885 visitor->trace(m_css);
1890 WillBeHeapSupplementable<DOMWindow>::trace(visitor); 1886 WillBeHeapSupplementable<DOMWindow>::trace(visitor);
1891 } 1887 }
1892 1888
1893 } // namespace WebCore 1889 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698