OLD | NEW |
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 #ifndef IOS_WEB_PUBLIC_BLOCK_TYPES_H_ | 5 #ifndef IOS_WEB_PUBLIC_BLOCK_TYPES_H_ |
6 #define IOS_WEB_PUBLIC_BLOCK_TYPES_H_ | 6 #define IOS_WEB_PUBLIC_BLOCK_TYPES_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 namespace web { | 10 namespace web { |
11 | 11 |
12 // The type of the completion handler block that is called to inform about | 12 // The type of the completion handler block that is called to inform about |
13 // JavaScript evaluation completion. | |
14 // TODO(crbug.com/595761): Remove this completion handler. | |
15 typedef void (^JavaScriptCompletion)(NSString*, NSError*); | |
16 | |
17 // The type of the completion handler block that is called to inform about | |
18 // JavaScript execution completion. id will be backed up by different classes | 13 // JavaScript execution completion. id will be backed up by different classes |
19 // depending on resulting JS type: NSString (string), NSNumber (number or | 14 // depending on resulting JS type: NSString (string), NSNumber (number or |
20 // boolean), NSDictionary (object), NSArray (array), NSNull (null), | 15 // boolean), NSDictionary (object), NSArray (array), NSNull (null), |
21 // NSDate (Date), nil (undefined). | 16 // NSDate (Date), nil (undefined). |
22 typedef void (^JavaScriptResultBlock)(id, NSError*); | 17 typedef void (^JavaScriptResultBlock)(id, NSError*); |
23 | 18 |
24 } // namespace | 19 } // namespace |
25 | 20 |
26 #endif // IOS_WEB_PUBLIC_BLOCK_TYPES_H_ | 21 #endif // IOS_WEB_PUBLIC_BLOCK_TYPES_H_ |
OLD | NEW |