OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 }; | 127 }; |
128 | 128 |
129 class no { | 129 class no { |
130 yes m[2]; | 130 yes m[2]; |
131 }; | 131 }; |
132 | 132 |
133 struct BaseMixin { | 133 struct BaseMixin { |
134 void reportMemoryUsage(MemoryObjectInfo*) const { } | 134 void reportMemoryUsage(MemoryObjectInfo*) const { } |
135 }; | 135 }; |
136 | 136 |
137 #if COMPILER(MSVC) | 137 struct Base : public Type, public BaseMixin { |
138 #pragma warning(push) | 138 // Provide expicit destructor without definition to avoid MSVC warni
ng "destructor could |
139 #pragma warning(disable: 4624) // Disable warning: destructor could not be gener
ated because a base class destructor is inaccessible. | 139 // not be generated because a base class destructor is inaccessible.
" |
140 #endif | 140 ~Base(); |
141 struct Base : public Type, public BaseMixin { }; | 141 }; |
142 #if COMPILER(MSVC) | |
143 #pragma warning(pop) | |
144 #endif | |
145 | 142 |
146 template <typename T, T t> class Helper { }; | 143 template <typename T, T t> class Helper { }; |
147 | 144 |
148 template <typename U> static no deduce(U*, Helper<void (BaseMixin::*)(Me
moryObjectInfo*) const, &U::reportMemoryUsage>* = 0); | 145 template <typename U> static no deduce(U*, Helper<void (BaseMixin::*)(Me
moryObjectInfo*) const, &U::reportMemoryUsage>* = 0); |
149 static yes deduce(...); | 146 static yes deduce(...); |
150 | 147 |
151 public: | 148 public: |
152 static const bool result = sizeof(yes) == sizeof(deduce((Base*)(0))); | 149 static const bool result = sizeof(yes) == sizeof(deduce((Base*)(0))); |
153 | 150 |
154 }; | 151 }; |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 355 |
359 class ParsedURL; | 356 class ParsedURL; |
360 void reportMemoryUsage(const ParsedURL*, MemoryObjectInfo*); | 357 void reportMemoryUsage(const ParsedURL*, MemoryObjectInfo*); |
361 | 358 |
362 class URLString; | 359 class URLString; |
363 void reportMemoryUsage(const URLString*, MemoryObjectInfo*); | 360 void reportMemoryUsage(const URLString*, MemoryObjectInfo*); |
364 | 361 |
365 } // namespace WTF | 362 } // namespace WTF |
366 | 363 |
367 #endif // !defined(MemoryInstrumentation_h) | 364 #endif // !defined(MemoryInstrumentation_h) |
OLD | NEW |