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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 291823009: Refine the UseCounter for Document.charset (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/dom/Document.idl » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 1157
1158 String Document::defaultCharset() const 1158 String Document::defaultCharset() const
1159 { 1159 {
1160 if (Settings* settings = this->settings()) 1160 if (Settings* settings = this->settings())
1161 return settings->defaultTextEncodingName(); 1161 return settings->defaultTextEncodingName();
1162 return String(); 1162 return String();
1163 } 1163 }
1164 1164
1165 void Document::setCharset(const String& charset) 1165 void Document::setCharset(const String& charset)
1166 { 1166 {
1167 UseCounter::count(*this, UseCounter::DocumentSetCharset);
1167 if (DocumentLoader* documentLoader = loader()) 1168 if (DocumentLoader* documentLoader = loader())
1168 documentLoader->setUserChosenEncoding(charset); 1169 documentLoader->setUserChosenEncoding(charset);
1169 WTF::TextEncoding encoding(charset); 1170 WTF::TextEncoding encoding(charset);
1170 // In case the encoding didn't exist, we keep the old one (helps some sites specifying invalid encodings). 1171 // In case the encoding didn't exist, we keep the old one (helps some sites specifying invalid encodings).
1171 if (!encoding.isValid()) 1172 if (!encoding.isValid())
1172 return; 1173 return;
1173 DocumentEncodingData newEncodingData = m_encodingData; 1174 DocumentEncodingData newEncodingData = m_encodingData;
1174 newEncodingData.setEncoding(encoding); 1175 newEncodingData.setEncoding(encoding);
1175 setEncodingData(newEncodingData); 1176 setEncodingData(newEncodingData);
1176 } 1177 }
(...skipping 4582 matching lines...) Expand 10 before | Expand all | Expand 10 after
5759 visitor->trace(m_timeline); 5760 visitor->trace(m_timeline);
5760 visitor->trace(m_compositorPendingAnimations); 5761 visitor->trace(m_compositorPendingAnimations);
5761 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5762 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5762 DocumentSupplementable::trace(visitor); 5763 DocumentSupplementable::trace(visitor);
5763 TreeScope::trace(visitor); 5764 TreeScope::trace(visitor);
5764 ContainerNode::trace(visitor); 5765 ContainerNode::trace(visitor);
5765 ExecutionContext::trace(visitor); 5766 ExecutionContext::trace(visitor);
5766 } 5767 }
5767 5768
5768 } // namespace WebCore 5769 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698