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

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

Issue 2629603003: Added constness to the hashmap on Document. (Closed)
Patch Set: rebase Created 3 years, 11 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 | « third_party/WebKit/Source/core/dom/Document.h ('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) 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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1362 1362
1363 return documentElement(); 1363 return documentElement();
1364 } 1364 }
1365 1365
1366 return body(); 1366 return body();
1367 } 1367 }
1368 1368
1369 // We use HashMap::set over HashMap::add here as we want to 1369 // We use HashMap::set over HashMap::add here as we want to
1370 // replace the ComputedStyle but not the Node if the Node is 1370 // replace the ComputedStyle but not the Node if the Node is
1371 // already present. 1371 // already present.
1372 void Document::addStyleReattachData(Node& node, 1372 void Document::addStyleReattachData(const Node& node,
1373 StyleReattachData& styleReattachData) { 1373 StyleReattachData& styleReattachData) {
1374 DCHECK(node.isElementNode() || node.isTextNode()); 1374 DCHECK(node.isElementNode() || node.isTextNode());
1375 m_styleReattachDataMap.set(&node, styleReattachData); 1375 m_styleReattachDataMap.set(&node, styleReattachData);
1376 } 1376 }
1377 1377
1378 StyleReattachData Document::getStyleReattachData(Node& node) { 1378 StyleReattachData Document::getStyleReattachData(const Node& node) const {
1379 return m_styleReattachDataMap.get(&node); 1379 return m_styleReattachDataMap.get(&node);
1380 } 1380 }
1381 1381
1382 /* 1382 /*
1383 * Performs three operations: 1383 * Performs three operations:
1384 * 1. Convert control characters to spaces 1384 * 1. Convert control characters to spaces
1385 * 2. Trim leading and trailing spaces 1385 * 2. Trim leading and trailing spaces
1386 * 3. Collapse internal whitespace. 1386 * 3. Collapse internal whitespace.
1387 */ 1387 */
1388 template <typename CharacterType> 1388 template <typename CharacterType>
(...skipping 5128 matching lines...) Expand 10 before | Expand all | Expand 10 after
6517 } 6517 }
6518 6518
6519 void showLiveDocumentInstances() { 6519 void showLiveDocumentInstances() {
6520 WeakDocumentSet& set = liveDocumentSet(); 6520 WeakDocumentSet& set = liveDocumentSet();
6521 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6521 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6522 for (Document* document : set) 6522 for (Document* document : set)
6523 fprintf(stderr, "- Document %p URL: %s\n", document, 6523 fprintf(stderr, "- Document %p URL: %s\n", document,
6524 document->url().getString().utf8().data()); 6524 document->url().getString().utf8().data());
6525 } 6525 }
6526 #endif 6526 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698