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

Side by Side Diff: third_party/WebKit/Source/wtf/InstanceCounter.cpp

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // The result of stringWithTypeName<T>() is given as |funcName|. 57 // The result of stringWithTypeName<T>() is given as |funcName|.
58 // |extractTypeNameFromFunctionName| then extracts a typename string from 58 // |extractTypeNameFromFunctionName| then extracts a typename string from
59 // |funcName|. 59 // |funcName|.
60 String extractTypeNameFromFunctionName(const char* funcName) { 60 String extractTypeNameFromFunctionName(const char* funcName) {
61 #if COMPILER(CLANG) || COMPILER(GCC) || COMPILER(MSVC) 61 #if COMPILER(CLANG) || COMPILER(GCC) || COMPILER(MSVC)
62 size_t funcNameLength = strlen(funcName); 62 size_t funcNameLength = strlen(funcName);
63 DCHECK_GT(funcNameLength, 63 DCHECK_GT(funcNameLength,
64 stringWithTypeNamePrefixLength + stringWithTypeNamePostfixLength); 64 stringWithTypeNamePrefixLength + stringWithTypeNamePostfixLength);
65 65
66 const char* funcNameWithoutPrefix = funcName + stringWithTypeNamePrefixLength; 66 const char* funcNameWithoutPrefix = funcName + stringWithTypeNamePrefixLength;
67 return String(funcNameWithoutPrefix, funcNameLength - 67 return String(funcNameWithoutPrefix,
68 stringWithTypeNamePrefixLength - 68 funcNameLength - stringWithTypeNamePrefixLength -
69 stringWithTypeNamePostfixLength); 69 stringWithTypeNamePostfixLength);
70 #else 70 #else
71 return String("unknown"); 71 return String("unknown");
72 #endif 72 #endif
73 } 73 }
74 74
75 class InstanceCounter { 75 class InstanceCounter {
76 public: 76 public:
77 void incrementInstanceCount(const String& instanceName, void* ptr); 77 void incrementInstanceCount(const String& instanceName, void* ptr);
78 void decrementInstanceCount(const String& instanceName, void* ptr); 78 void decrementInstanceCount(const String& instanceName, void* ptr);
79 String dump(); 79 String dump();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 #else 147 #else
148 148
149 String dumpRefCountedInstanceCounts() { 149 String dumpRefCountedInstanceCounts() {
150 return String("{}"); 150 return String("{}");
151 } 151 }
152 152
153 #endif // ENABLE(INSTANCE_COUNTER) 153 #endif // ENABLE(INSTANCE_COUNTER)
154 154
155 } // namespace WTF 155 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/DateMath.cpp ('k') | third_party/WebKit/Source/wtf/MathExtrasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698