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

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

Issue 2624443003: Enable ThreadRestrictionVerifier for StringImpl (Closed)
Patch Set: simplify 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 | « no previous file | third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp » ('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 * 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. Currently
1499 // code that calls into this method from the impl thread tries to make
1500 // sure that the main thread is not running at this time.
1501 StringImpl* impl = thisElement.getIdAttribute().impl();
1502 if (impl) {
1503 name.append(impl->is8Bit()
1504 ? StringView(impl->characters8(), impl->length())
1505 : StringView(impl->characters16(), impl->length()));
esprehn 2017/01/11 22:34:02 Why do we need this but not below where we use Ato
Charlie Harrison 2017/01/12 16:42:30 I think we probably do and we're just not hitting
1506 }
1497 name.append('\''); 1507 name.append('\'');
1498 } 1508 }
1499 1509
1500 if (thisElement.hasClass()) { 1510 if (thisElement.hasClass()) {
1501 name.append(" class=\'"); 1511 name.append(" class=\'");
1502 for (size_t i = 0; i < thisElement.classNames().size(); ++i) { 1512 for (size_t i = 0; i < thisElement.classNames().size(); ++i) {
1503 if (i > 0) 1513 if (i > 0)
1504 name.append(' '); 1514 name.append(' ');
1505 name.append(thisElement.classNames()[i]); 1515 name.append(thisElement.classNames()[i]);
1506 } 1516 }
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 if (node) { 2552 if (node) {
2543 std::stringstream stream; 2553 std::stringstream stream;
2544 node->printNodePathTo(stream); 2554 node->printNodePathTo(stream);
2545 LOG(INFO) << stream.str(); 2555 LOG(INFO) << stream.str();
2546 } else { 2556 } else {
2547 LOG(INFO) << "Cannot showNodePath for <null>"; 2557 LOG(INFO) << "Cannot showNodePath for <null>";
2548 } 2558 }
2549 } 2559 }
2550 2560
2551 #endif 2561 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698