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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 334323002: Add null check when accessing WebLocalFrameImpl::mainFrameImpl(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 m_inspectorSettingsMap = adoptPtr(new SettingsMap); 435 m_inspectorSettingsMap = adoptPtr(new SettingsMap);
436 } 436 }
437 437
438 WebViewImpl::~WebViewImpl() 438 WebViewImpl::~WebViewImpl()
439 { 439 {
440 ASSERT(!m_page); 440 ASSERT(!m_page);
441 } 441 }
442 442
443 WebLocalFrameImpl* WebViewImpl::mainFrameImpl() 443 WebLocalFrameImpl* WebViewImpl::mainFrameImpl()
444 { 444 {
445 return m_page && m_page->mainFrame()->isLocalFrame() ? WebLocalFrameImpl::fr omFrame(m_page->deprecatedLocalMainFrame()) : 0; 445 return m_page && m_page->mainFrame() && m_page->mainFrame()->isLocalFrame() ? WebLocalFrameImpl::fromFrame(m_page->deprecatedLocalMainFrame()) : 0;
446 } 446 }
447 447
448 bool WebViewImpl::tabKeyCyclesThroughElements() const 448 bool WebViewImpl::tabKeyCyclesThroughElements() const
449 { 449 {
450 ASSERT(m_page); 450 ASSERT(m_page);
451 return m_page->tabKeyCyclesThroughElements(); 451 return m_page->tabKeyCyclesThroughElements();
452 } 452 }
453 453
454 void WebViewImpl::setTabKeyCyclesThroughElements(bool value) 454 void WebViewImpl::setTabKeyCyclesThroughElements(bool value)
455 { 455 {
(...skipping 3681 matching lines...) Expand 10 before | Expand all | Expand 10 after
4137 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4137 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4138 4138
4139 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4139 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4140 return false; 4140 return false;
4141 4141
4142 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4142 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4143 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4143 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4144 } 4144 }
4145 4145
4146 } // namespace blink 4146 } // namespace blink
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