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

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

Issue 2624443003: Enable ThreadRestrictionVerifier for StringImpl (Closed)
Patch Set: Get rid of vestigial debugging code 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
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 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 connection; 1486 connection;
1487 } 1487 }
1488 1488
1489 String Node::debugName() const { 1489 String Node::debugName() const {
1490 StringBuilder name; 1490 StringBuilder name;
1491 name.append(debugNodeName()); 1491 name.append(debugNodeName());
1492 if (isElementNode()) { 1492 if (isElementNode()) {
1493 const Element& thisElement = toElement(*this); 1493 const Element& thisElement = toElement(*this);
1494 if (thisElement.hasID()) { 1494 if (thisElement.hasID()) {
1495 name.append(" id=\'"); 1495 name.append(" id=\'");
1496 name.append(thisElement.getIdAttribute()); 1496 // Unsafe hack to avoid triggering the ThreadRestrictionVerifier on
1497 // StringImpl. crbug.com/545926 should be fixed completely, and we should
1498 // always avoid accessing these strings from the impl thread.
1499 StringImpl* impl = thisElement.getIdAttribute().impl();
1500 if (impl) {
1501 name.append(impl->is8Bit()
esprehn 2017/01/11 22:34:01 Why does't the thisElement.classNames() line below
1502 ? StringView(impl->characters8(), impl->length())
1503 : StringView(impl->characters16(), impl->length()));
1504 }
1497 name.append('\''); 1505 name.append('\'');
1498 } 1506 }
1499 1507
1500 if (thisElement.hasClass()) { 1508 if (thisElement.hasClass()) {
1501 name.append(" class=\'"); 1509 name.append(" class=\'");
1502 for (size_t i = 0; i < thisElement.classNames().size(); ++i) { 1510 for (size_t i = 0; i < thisElement.classNames().size(); ++i) {
1503 if (i > 0) 1511 if (i > 0)
1504 name.append(' '); 1512 name.append(' ');
1505 name.append(thisElement.classNames()[i]); 1513 name.append(thisElement.classNames()[i]);
1506 } 1514 }
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 if (node) { 2550 if (node) {
2543 std::stringstream stream; 2551 std::stringstream stream;
2544 node->printNodePathTo(stream); 2552 node->printNodePathTo(stream);
2545 LOG(INFO) << stream.str(); 2553 LOG(INFO) << stream.str();
2546 } else { 2554 } else {
2547 LOG(INFO) << "Cannot showNodePath for <null>"; 2555 LOG(INFO) << "Cannot showNodePath for <null>";
2548 } 2556 }
2549 } 2557 }
2550 2558
2551 #endif 2559 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698