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

Side by Side Diff: Source/core/inspector/InspectorOverlay.cpp

Issue 482753002: Use StringBuilder::appendLiteral() / StringBuilder::append(char) when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 for (size_t i = 0; i < classNameCount; ++i) { 629 for (size_t i = 0; i < classNameCount; ++i) {
630 const AtomicString& className = classNamesString[i]; 630 const AtomicString& className = classNamesString[i];
631 if (!usedClassNames.add(className).isNewEntry) 631 if (!usedClassNames.add(className).isNewEntry)
632 continue; 632 continue;
633 classNames.append('.'); 633 classNames.append('.');
634 classNames.append(className); 634 classNames.append(className);
635 } 635 }
636 } 636 }
637 if (pseudoElement) { 637 if (pseudoElement) {
638 if (pseudoElement->pseudoId() == BEFORE) 638 if (pseudoElement->pseudoId() == BEFORE)
639 classNames.append("::before"); 639 classNames.appendLiteral("::before");
640 else if (pseudoElement->pseudoId() == AFTER) 640 else if (pseudoElement->pseudoId() == AFTER)
641 classNames.append("::after"); 641 classNames.appendLiteral("::after");
642 } 642 }
643 if (!classNames.isEmpty()) 643 if (!classNames.isEmpty())
644 elementInfo->setString("className", classNames.toString()); 644 elementInfo->setString("className", classNames.toString());
645 645
646 RenderObject* renderer = element->renderer(); 646 RenderObject* renderer = element->renderer();
647 FrameView* containingView = element->document().view(); 647 FrameView* containingView = element->document().view();
648 if (!renderer || !containingView) 648 if (!renderer || !containingView)
649 return elementInfo; 649 return elementInfo;
650 650
651 IntRect boundingBox = pixelSnappedIntRect(containingView->contentsToRootView (renderer->absoluteBoundingBoxRect())); 651 IntRect boundingBox = pixelSnappedIntRect(containingView->contentsToRootView (renderer->absoluteBoundingBoxRect()));
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 hideHighlight(); 846 hideHighlight();
847 } 847 }
848 848
849 void InspectorOverlay::startedRecordingProfile() 849 void InspectorOverlay::startedRecordingProfile()
850 { 850 {
851 if (!m_activeProfilerCount++) 851 if (!m_activeProfilerCount++)
852 freePage(); 852 freePage();
853 } 853 }
854 854
855 } // namespace blink 855 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorInspectorAgent.cpp ('k') | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698