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

Unified Diff: ios/web/public/crw_browsing_data_store.h

Issue 1154923003: Fixing an edge case in CRWBrowsingDataStore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/crw_browsing_data_store_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/crw_browsing_data_store.h
diff --git a/ios/web/public/crw_browsing_data_store.h b/ios/web/public/crw_browsing_data_store.h
index 4f51c8a229e729c96d1f6c94fec95a64b05a7a9a..c23f388b6c470b7e44550d99e68ef05454f85221 100644
--- a/ios/web/public/crw_browsing_data_store.h
+++ b/ios/web/public/crw_browsing_data_store.h
@@ -47,26 +47,31 @@ enum CRWBrowsingDataStoreMode {
- (instancetype)initWithBrowserState:(web::BrowserState*)browserState
NS_DESIGNATED_INITIALIZER;
-// The mode that the CRWBrowsingDataStore is in.
+// The mode that the CRWBrowsingDataStore is in. KVO compliant.
@property(nonatomic, assign, readonly) CRWBrowsingDataStoreMode mode;
// TODO(shreyasv): Verify the preconditions for the following 3 methods when
// web::WebViewCounter class is implemented. crbug.com/480507
// Changes the mode to |ACTIVE|.
-// |completionHandler| is called on the main thread.
+// |completionHandler| is called on the main thread. This block has no return
+// value and takes a single BOOL argument that indicates whether or not the
+// the mode was successfully changed to |ACTIVE|.
+// The mode change to |ACTIVE| can fail if another |makeActive| or
+// |makeInactive| was enqueued after this call.
// Precondition: There must be no web views associated with the BrowserState.
-// Note: If there is another operation driven to change the mode, the mode will
-// still be |SYNCHRONIZING| rather than |ACTIVE| when the callback is received.
-- (void)makeActiveWithCompletionHandler:(ProceduralBlock)completionHandler;
+- (void)makeActiveWithCompletionHandler:
+ (void (^)(BOOL success))completionHandler;
// Changes the mode to |INACTIVE|.
-// |completionHandler| is called on the main thread.
+// |completionHandler| is called on the main thread. This block has no return
+// value and takes a single BOOL argument that indicates whether or not the
+// the mode was successfully changed to |INACTIVE|.
+// The mode change to |ACTIVE| can fail if another |makeActive| or
+// |makeInactive| was enqueued after this call.
// Precondition: There must be no web views associated with the BrowserState.
-// Note: If there is another operation driven to change the mode, the mode will
-// still be |SYNCHRONIZING| rather than |INACTIVE| when the callback is
-// received.
-- (void)makeInactiveWithCompletionHandler:(ProceduralBlock)completionHandler;
+- (void)makeInactiveWithCompletionHandler:
+ (void (^)(BOOL success))completionHandler;
// Removes all browsing data of the provided |browsingDataTypes|.
// |completionHandler| is called on the main thread after the browsing data has
« no previous file with comments | « ios/web/crw_browsing_data_store_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698