| Summary: | Move TreeScope, IdTargetObserverRegistry to std::unique_ptr | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Zan Dobersek <zan> | ||||||
| Component: | New Bugs | Assignee: | Zan Dobersek <zan> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | andersca, bfulgham, commit-queue, esprehn+autocc, kangil.han, kling, koivisto | ||||||
| Priority: | P2 | ||||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 128007 | ||||||||
| Attachments: |
|
||||||||
|
Description
Zan Dobersek
2014-01-20 02:28:56 PST
Created attachment 221639 [details]
Patch
Created attachment 221721 [details]
Patch
Comment on attachment 221721 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=221721&action=review This looks great! I would prefer we not use the 'get()' method in the shouldCacheLabelsByForAttribute. Can you confirm it must be implemented the way you have written that? > Source/WebCore/dom/TreeScope.h:83 > + bool shouldCacheLabelsByForAttribute() const { return m_labelsByForAttribute.get(); } std::unique_ptr has an operator (bool). Why is the 'get()' necessary here? At the worst, you should be doing something like "static_cast<bool>(m_labelsByForAttribute)". (In reply to comment #3) > (From update of attachment 221721 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=221721&action=review > > This looks great! I would prefer we not use the 'get()' method in the shouldCacheLabelsByForAttribute. Can you confirm it must be implemented the way you have written that? > > > Source/WebCore/dom/TreeScope.h:83 > > + bool shouldCacheLabelsByForAttribute() const { return m_labelsByForAttribute.get(); } > > std::unique_ptr has an operator (bool). Why is the 'get()' necessary here? At the worst, you should be doing something like "static_cast<bool>(m_labelsByForAttribute)". the bool operator is explicit. I think .get() is better than an explicit static cast. Comment on attachment 221721 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=221721&action=review r=me >>> Source/WebCore/dom/TreeScope.h:83 >>> + bool shouldCacheLabelsByForAttribute() const { return m_labelsByForAttribute.get(); } >> >> std::unique_ptr has an operator (bool). Why is the 'get()' necessary here? At the worst, you should be doing something like "static_cast<bool>(m_labelsByForAttribute)". > > the bool operator is explicit. I think .get() is better than an explicit static cast. How about "return !!m_labelsByForAttribute;" Comment on attachment 221721 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=221721&action=review >>>> Source/WebCore/dom/TreeScope.h:83 >>>> + bool shouldCacheLabelsByForAttribute() const { return m_labelsByForAttribute.get(); } >>> >>> std::unique_ptr has an operator (bool). Why is the 'get()' necessary here? At the worst, you should be doing something like "static_cast<bool>(m_labelsByForAttribute)". >> >> the bool operator is explicit. I think .get() is better than an explicit static cast. > > How about "return !!m_labelsByForAttribute;" Sure. Committed r163719: <http://trac.webkit.org/changeset/163719> |