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

Side by Side Diff: Source/WebKit/chromium/src/WebViewImpl.cpp

Issue 7782040: Merge 94102 - [Chromium] Add null checks for document()->loader() (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 3 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 | « Source/WebKit/chromium/src/WebSearchableFormData.cpp ('k') | 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 m_webSettings = adoptPtr(new WebSettingsImpl(m_page->settings())); 1621 m_webSettings = adoptPtr(new WebSettingsImpl(m_page->settings()));
1622 ASSERT(m_webSettings.get()); 1622 ASSERT(m_webSettings.get());
1623 return m_webSettings.get(); 1623 return m_webSettings.get();
1624 } 1624 }
1625 1625
1626 WebString WebViewImpl::pageEncoding() const 1626 WebString WebViewImpl::pageEncoding() const
1627 { 1627 {
1628 if (!m_page.get()) 1628 if (!m_page.get())
1629 return WebString(); 1629 return WebString();
1630 1630
1631 if (!m_page->mainFrame()->document()->loader())
1632 return WebString();
1633
1631 return m_page->mainFrame()->document()->loader()->writer()->encoding(); 1634 return m_page->mainFrame()->document()->loader()->writer()->encoding();
1632 } 1635 }
1633 1636
1634 void WebViewImpl::setPageEncoding(const WebString& encodingName) 1637 void WebViewImpl::setPageEncoding(const WebString& encodingName)
1635 { 1638 {
1636 if (!m_page.get()) 1639 if (!m_page.get())
1637 return; 1640 return;
1638 1641
1639 // Only change override encoding, don't change default encoding. 1642 // Only change override encoding, don't change default encoding.
1640 // Note that the new encoding must be 0 if it isn't supposed to be set. 1643 // Note that the new encoding must be 0 if it isn't supposed to be set.
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
2670 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int> (visibilityState)), isInitialState); 2673 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int> (visibilityState)), isInitialState);
2671 #endif 2674 #endif
2672 2675
2673 #if USE(ACCELERATED_COMPOSITING) 2676 #if USE(ACCELERATED_COMPOSITING)
2674 if (isAcceleratedCompositingActive() && visibilityState == WebPageVisibility StateHidden) 2677 if (isAcceleratedCompositingActive() && visibilityState == WebPageVisibility StateHidden)
2675 m_layerRenderer->releaseTextures(); 2678 m_layerRenderer->releaseTextures();
2676 #endif 2679 #endif
2677 } 2680 }
2678 2681
2679 } // namespace WebKit 2682 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/WebSearchableFormData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698