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

Side by Side Diff: sky/engine/wtf/InstanceCounter.cpp

Issue 719063002: Revert "Remove support for MSVC" (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 25 matching lines...) Expand all
36 namespace WTF { 36 namespace WTF {
37 37
38 #if ENABLE(INSTANCE_COUNTER) || ENABLE(GC_PROFILING) 38 #if ENABLE(INSTANCE_COUNTER) || ENABLE(GC_PROFILING)
39 39
40 #if COMPILER(CLANG) 40 #if COMPILER(CLANG)
41 const size_t extractNameFunctionPrefixLength = sizeof("const char *WTF::extractN ameFunction() [T = ") - 1; 41 const size_t extractNameFunctionPrefixLength = sizeof("const char *WTF::extractN ameFunction() [T = ") - 1;
42 const size_t extractNameFunctionPostfixLength = sizeof("]") - 1; 42 const size_t extractNameFunctionPostfixLength = sizeof("]") - 1;
43 #elif COMPILER(GCC) 43 #elif COMPILER(GCC)
44 const size_t extractNameFunctionPrefixLength = sizeof("const char* WTF::extractN ameFunction() [with T = ") - 1; 44 const size_t extractNameFunctionPrefixLength = sizeof("const char* WTF::extractN ameFunction() [with T = ") - 1;
45 const size_t extractNameFunctionPostfixLength = sizeof("]") - 1; 45 const size_t extractNameFunctionPostfixLength = sizeof("]") - 1;
46 #elif COMPILER(MSVC)
47 const size_t extractNameFunctionPrefixLength = sizeof("const char *__cdecl WTF:: extractNameFunction<class ") - 1;
48 const size_t extractNameFunctionPostfixLength = sizeof(">(void)") - 1;
46 #else 49 #else
47 #warning "Extracting typename is supported only in compiler GCC, CLANG and MSVC at this moment" 50 #warning "Extracting typename is supported only in compiler GCC, CLANG and MSVC at this moment"
48 #endif 51 #endif
49 52
50 // This function is used to stringify a typename T without using RTTI. 53 // This function is used to stringify a typename T without using RTTI.
51 // The result of extractNameFunction<T>() is given as |funcName|. |extractTypeNa meFromFunctionName| then extracts a typename string from |funcName|. 54 // The result of extractNameFunction<T>() is given as |funcName|. |extractTypeNa meFromFunctionName| then extracts a typename string from |funcName|.
52 String extractTypeNameFromFunctionName(const char* funcName) 55 String extractTypeNameFromFunctionName(const char* funcName)
53 { 56 {
54 #if COMPILER(CLANG) || COMPILER(GCC) 57 #if COMPILER(CLANG) || COMPILER(GCC) || COMPILER(MSVC)
55 size_t funcNameLength = strlen(funcName); 58 size_t funcNameLength = strlen(funcName);
56 ASSERT(funcNameLength > extractNameFunctionPrefixLength + extractNameFunctio nPostfixLength); 59 ASSERT(funcNameLength > extractNameFunctionPrefixLength + extractNameFunctio nPostfixLength);
57 60
58 const char* funcNameWithoutPrefix = funcName + extractNameFunctionPrefixLeng th; 61 const char* funcNameWithoutPrefix = funcName + extractNameFunctionPrefixLeng th;
59 return String(funcNameWithoutPrefix, funcNameLength - extractNameFunctionPre fixLength - extractNameFunctionPostfixLength); 62 return String(funcNameWithoutPrefix, funcNameLength - extractNameFunctionPre fixLength - extractNameFunctionPostfixLength);
60 #else 63 #else
61 return String("unknown"); 64 return String("unknown");
62 #endif 65 #endif
63 } 66 }
64 67
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 #else 145 #else
143 146
144 String dumpRefCountedInstanceCounts() 147 String dumpRefCountedInstanceCounts()
145 { 148 {
146 return String("{}"); 149 return String("{}");
147 } 150 }
148 151
149 #endif // ENABLE(INSTANCE_COUNTER) || ENABLE(GC_PROFILING) 152 #endif // ENABLE(INSTANCE_COUNTER) || ENABLE(GC_PROFILING)
150 153
151 } // namespace WTF 154 } // namespace WTF
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698