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_CRW_BROWSING_DATA_STORE_H_ | 5 #ifndef IOS_WEB_CRW_BROWSING_DATA_STORE_H_ |
6 #define IOS_WEB_CRW_BROWSING_DATA_STORE_H_ | 6 #define IOS_WEB_CRW_BROWSING_DATA_STORE_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #import "base/ios/block_types.h" | 10 #import "base/ios/block_types.h" |
(...skipping 25 matching lines...) Expand all Loading... | |
36 | 36 |
37 // Designated initializer. |browserState| cannot be a nullptr. | 37 // Designated initializer. |browserState| cannot be a nullptr. |
38 // The |web::ActiveStateManager| associated with |browserState| needs to be in | 38 // The |web::ActiveStateManager| associated with |browserState| needs to be in |
39 // active state. | 39 // active state. |
40 - (instancetype)initWithBrowserState:(web::BrowserState*)browserState | 40 - (instancetype)initWithBrowserState:(web::BrowserState*)browserState |
41 NS_DESIGNATED_INITIALIZER; | 41 NS_DESIGNATED_INITIALIZER; |
42 | 42 |
43 // Returns a set of all available browsing data types. | 43 // Returns a set of all available browsing data types. |
44 + (NSSet*)allBrowsingDataTypes; | 44 + (NSSet*)allBrowsingDataTypes; |
45 | 45 |
46 // The mode that the CRWBrowsingDataStore is in. | 46 // The mode that the CRWBrowsingDataStore is in. KVO compliant. |
47 @property(nonatomic, assign, readonly) CRWBrowsingDataStoreMode mode; | 47 @property(nonatomic, assign, readonly) CRWBrowsingDataStoreMode mode; |
48 | 48 |
49 // TODO(shreyasv): Verify the preconditions for the following 3 methods when | 49 // TODO(shreyasv): Verify the preconditions for the following 3 methods when |
50 // web::WebViewCounter class is implemented. crbug.com/480507 | 50 // web::WebViewCounter class is implemented. crbug.com/480507 |
51 | 51 |
52 // Changes the mode to |ACTIVE|. | 52 // Changes the mode to |ACTIVE|. |
53 // |completionHandler| is called on the main thread. | 53 // |completionHandler| is called on the main thread. This block has no return |
54 // value and takes a single Boolean argument that indicates whether or not the | |
Eugene But (OOO till 7-30)
2015/05/29 21:14:26
NIT: s/Boolean/BOOL, because Boolean is an actual
shreyasv1
2015/05/29 22:22:57
well, this is modeled after the comment in
https:
| |
55 // the mode was successfully changed to |ACTIVE|. | |
Eugene But (OOO till 7-30)
2015/05/29 21:14:26
Please describe cases where completion handler is
shreyasv1
2015/05/29 22:22:57
Done.
| |
54 // Precondition: There must be no web views associated with the BrowserState. | 56 // Precondition: There must be no web views associated with the BrowserState. |
55 // Note: If there is another operation driven to change the mode, the mode will | 57 - (void)makeActiveWithCompletionHandler: |
56 // still be |SYNCHRONIZING| rather than |ACTIVE| when the callback is received. | 58 (void (^)(BOOL success))completionHandler; |
57 - (void)makeActiveWithCompletionHandler:(ProceduralBlock)completionHandler; | |
58 | 59 |
59 // Changes the mode to |INACTIVE|. | 60 // Changes the mode to |INACTIVE|. |
60 // |completionHandler| is called on the main thread. | 61 // |completionHandler| is called on the main thread. This block has no return |
62 // value and takes a single Boolean argument that indicates whether or not the | |
63 // the mode was successfully changed to |INACTIVE|. | |
Eugene But (OOO till 7-30)
2015/05/29 21:14:26
Same thing, please describe failure case
shreyasv1
2015/05/29 22:22:57
Done.
| |
61 // Precondition: There must be no web views associated with the BrowserState. | 64 // Precondition: There must be no web views associated with the BrowserState. |
62 // Note: If there is another operation driven to change the mode, the mode will | 65 - (void)makeInactiveWithCompletionHandler: |
63 // still be |SYNCHRONIZING| rather than |INACTIVE| when the callback is | 66 (void (^)(BOOL success))completionHandler; |
64 // received. | |
65 - (void)makeInactiveWithCompletionHandler:(ProceduralBlock)completionHandler; | |
66 | 67 |
67 // Removes all browsing data of the provided |browsingDataTypes|. | 68 // Removes all browsing data of the provided |browsingDataTypes|. |
68 // |completionHandler| is called on the main thread after the browsing data has | 69 // |completionHandler| is called on the main thread after the browsing data has |
69 // been removed. | 70 // been removed. |
70 // Precondition: There must be no web views associated with the BrowserState. | 71 // Precondition: There must be no web views associated with the BrowserState. |
71 - (void)removeDataOfTypes:(NSSet*)browsingDataTypes | 72 - (void)removeDataOfTypes:(NSSet*)browsingDataTypes |
72 completionHandler:(ProceduralBlock)completionHandler; | 73 completionHandler:(ProceduralBlock)completionHandler; |
73 | 74 |
74 // Returns YES if there is still a pending operation that has not finished | 75 // Returns YES if there is still a pending operation that has not finished |
75 // running. Creating web views (UIWebViews and WKWebViews) with this | 76 // running. Creating web views (UIWebViews and WKWebViews) with this |
76 // CRWBrowsingDataStore when there are pending operations is undefined | 77 // CRWBrowsingDataStore when there are pending operations is undefined |
77 // behavior. | 78 // behavior. |
78 @property(nonatomic, assign, readonly) BOOL hasPendingOperations; | 79 @property(nonatomic, assign, readonly) BOOL hasPendingOperations; |
79 | 80 |
80 @end | 81 @end |
81 | 82 |
82 #endif // IOS_WEB_CRW_BROWSING_DATA_STORE_H_ | 83 #endif // IOS_WEB_CRW_BROWSING_DATA_STORE_H_ |
OLD | NEW |