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

Side by Side Diff: tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp

Issue 2805043003: Requiring Get prefix for 5 more methods (to avoid conflicts after Blink rename). (Closed)
Patch Set: Rebasing... Created 3 years, 8 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 | 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Changes Blink-style names to Chrome-style names. Currently transforms: 5 // Changes Blink-style names to Chrome-style names. Currently transforms:
6 // fields: 6 // fields:
7 // int m_operationCount => int operation_count_ 7 // int m_operationCount => int operation_count_
8 // variables (including parameters): 8 // variables (including parameters):
9 // int mySuperVariable => int my_super_variable 9 // int mySuperVariable => int my_super_variable
10 // constants: 10 // constants:
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 } 651 }
652 652
653 AST_MATCHER_P(clang::QualType, hasString, std::string, ExpectedString) { 653 AST_MATCHER_P(clang::QualType, hasString, std::string, ExpectedString) {
654 return ExpectedString == Node.getAsString(); 654 return ExpectedString == Node.getAsString();
655 } 655 }
656 656
657 bool ShouldPrefixFunctionName(const std::string& old_method_name) { 657 bool ShouldPrefixFunctionName(const std::string& old_method_name) {
658 // Functions that are named similarily to a type - they should be prefixed 658 // Functions that are named similarily to a type - they should be prefixed
659 // with a "Get" prefix. 659 // with a "Get" prefix.
660 static const char* kConflictingMethods[] = { 660 static const char* kConflictingMethods[] = {
661 "accumulatorMap",
661 "animationWorklet", 662 "animationWorklet",
662 "audioWorklet", 663 "audioWorklet",
663 "binaryType", 664 "binaryType",
664 "blob", 665 "blob",
665 "channelCountMode", 666 "channelCountMode",
666 "color", 667 "color",
667 "compositorElementId", 668 "compositorElementId",
668 "counterDirectives", 669 "counterDirectives",
669 "document", 670 "document",
670 "element", 671 "element",
671 "emptyChromeClient", 672 "emptyChromeClient",
672 "emptyEditorClient", 673 "emptyEditorClient",
673 "emptySpellCheckerClient", 674 "emptySpellCheckerClient",
674 "entryType", 675 "entryType",
675 "error", 676 "error",
677 "eventTargetDataMap",
676 "fileUtilities", 678 "fileUtilities",
677 "font", 679 "font",
678 "frame", 680 "frame",
679 "frameBlameContext", 681 "frameBlameContext",
680 "frontend", 682 "frontend",
681 "gridCell", 683 "gridCell",
682 "hash", 684 "hash",
683 "heapObjectHeader", 685 "heapObjectHeader",
686 "heapObjectSet",
684 "iconURL", 687 "iconURL",
685 "image", 688 "image",
686 "inputMethodController", 689 "inputMethodController",
687 "inputType", 690 "inputType",
688 "interpolationTypes", 691 "interpolationTypes",
689 "layout", 692 "layout",
690 "layoutBlock", 693 "layoutBlock",
691 "layoutObject", 694 "layoutObject",
692 "layoutSize", 695 "layoutSize",
693 "lineCap", 696 "lineCap",
694 "lineEndings", 697 "lineEndings",
695 "lineJoin", 698 "lineJoin",
696 "listItems", 699 "listItems",
697 "matchedProperties", 700 "matchedProperties",
698 "midpointState", 701 "midpointState",
699 "modifiers", 702 "modifiers",
700 "mouseEvent", 703 "mouseEvent",
701 "name", 704 "name",
702 "navigationType", 705 "navigationType",
703 "node", 706 "node",
704 "notificationManager", 707 "notificationManager",
705 "outcome", 708 "outcome",
706 "pagePopup", 709 "pagePopup",
707 "paintWorklet", 710 "paintWorklet",
708 "path", 711 "path",
709 "position", 712 "position",
710 "processingInstruction", 713 "processingInstruction",
714 "qualifiedNameCache",
711 "readyState", 715 "readyState",
712 "relList", 716 "relList",
713 "referrer", 717 "referrer",
714 "referrerPolicy", 718 "referrerPolicy",
715 "resource", 719 "resource",
716 "response", 720 "response",
717 "restrictedKeyMap", 721 "restrictedKeyMap",
718 "sandboxSupport", 722 "sandboxSupport",
719 "screenInfo", 723 "screenInfo",
720 "screenOrientationController", 724 "screenOrientationController",
721 "scrollAnimator", 725 "scrollAnimator",
722 "selectionInDOMTree", 726 "selectionInDOMTree",
723 "selectionInFlatTree", 727 "selectionInFlatTree",
728 "selectorTextCache",
724 "settings", 729 "settings",
725 "signalingState", 730 "signalingState",
726 "snapshotById", 731 "snapshotById",
727 "state", 732 "state",
728 "string", 733 "string",
729 "styleSheet", 734 "styleSheet",
730 "supplementable", 735 "supplementable",
731 "text", 736 "text",
732 "textAlign", 737 "textAlign",
733 "textBaseline", 738 "textBaseline",
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1926 for (const auto& r : replacements) { 1931 for (const auto& r : replacements) {
1927 std::string replacement_text = r.getReplacementText().str(); 1932 std::string replacement_text = r.getReplacementText().str();
1928 std::replace(replacement_text.begin(), replacement_text.end(), '\n', '\0'); 1933 std::replace(replacement_text.begin(), replacement_text.end(), '\n', '\0');
1929 llvm::outs() << "r:::" << r.getFilePath() << ":::" << r.getOffset() 1934 llvm::outs() << "r:::" << r.getFilePath() << ":::" << r.getOffset()
1930 << ":::" << r.getLength() << ":::" << replacement_text << "\n"; 1935 << ":::" << r.getLength() << ":::" << replacement_text << "\n";
1931 } 1936 }
1932 llvm::outs() << "==== END EDITS ====\n"; 1937 llvm::outs() << "==== END EDITS ====\n";
1933 1938
1934 return 0; 1939 return 0;
1935 } 1940 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698