eugenebut | 064f5bf | 2015-04-14 18:35:05 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef IOS_WEB_ALLOC_WITH_ZONE_INTERCEPTOR_H_ |
| 6 | #define IOS_WEB_ALLOC_WITH_ZONE_INTERCEPTOR_H_ |
| 7 | |
| 8 | #import <Foundation/Foundation.h> |
| 9 | |
| 10 | namespace web { |
| 11 | // Adds |impl_block| as a custom implementation for |allocWithZone:| method of |
| 12 | // |target| Class. AddAllocWithZoneMethod can not swizzle existing |
| 13 | // |allocWithZone:| method of |target| Class. Neither |target| nor any of its |
| 14 | // superclases must not have overridden |allocWithZone:|. |
| 15 | void AddAllocWithZoneMethod(Class target, id (^impl_block)(Class, NSZone*)); |
| 16 | } // namespace web |
| 17 | |
| 18 | #endif // IOS_WEB_ALLOC_WITH_ZONE_INTERCEPTOR_H_ |