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

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

Issue 1215433003: CL for Objective-C readability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 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
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 adfccef978bcba5353426a2494059ef955430be4..af7cafc5fc3a32e5a0ce1d3d84322c6c4609801d 100644
--- a/ios/web/public/crw_browsing_data_store.h
+++ b/ios/web/public/crw_browsing_data_store.h
@@ -37,28 +37,30 @@ typedef NS_ENUM(NSUInteger, BrowsingDataStoreMode) {
} // namespace web
-// A CRWBrowsingDataStore represents various types of data that a web view
-// (UIWebView and WKWebView) uses.
-// All methods must be called on the UI thread.
+// A CRWBrowsingDataStore represents various types of data that a web view uses.
+// All methods must be called on the main thread.
@interface CRWBrowsingDataStore : NSObject
-// Designated initializer. |browserState| cannot be null.
-// The initial mode of the CRWBrowsingDataStore is obtained from the active
-// state of the |web::ActiveStateManager| associated with |browserState|.
-- (instancetype)initWithBrowserState:(web::BrowserState*)browserState
- NS_DESIGNATED_INITIALIZER;
-
// The delegate that is consulted when the mode needs to change.
@property(nonatomic, weak) id<CRWBrowsingDataStoreDelegate> delegate;
// The mode that the CRWBrowsingDataStore is in. KVO compliant.
@property(nonatomic, assign, readonly) web::BrowsingDataStoreMode mode;
-// TODO(shreyasv): Verify the preconditions for the following 3 methods when
-// web::WebViewCounter class is implemented. crbug.com/480507
+// A BOOL indicating whether there is still a pending operation that has not
+// finished running. Creating web views with this CRWBrowsingDataStore when
+// there are pending operations results in undefined behavior.
+@property(nonatomic, assign, readonly) BOOL hasPendingOperations;
+
+// |browserState| cannot be nullptr. The initial mode of the
Eugene But (OOO till 7-30) 2015/07/09 20:08:08 s/nullptr/null Because |browserState| can not be
shreyasv1 2015/07/10 17:06:22 Done.
+// CRWBrowsingDataStore is obtained from the active state of the
+// |web::ActiveStateManager| associated with |browserState|.
+- (instancetype)initWithBrowserState:(web::BrowserState*)browserState
+ NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
// Changes the mode to |ACTIVE|.
-// if there is no delegate present, the default behavior of this method is to
+// If there is no delegate present, the default behavior of this method is to
// restore browsing data from |browserState|'s stash path to the canonical path
// where web views read/write browsing data to.
// |completionHandler| is called on the main thread. This block has no return
@@ -68,21 +70,20 @@ typedef NS_ENUM(NSUInteger, BrowsingDataStoreMode) {
// |makeInactive| was enqueued after this call.
// Precondition: There must be no web views associated with the BrowserState.
- (void)makeActiveWithCompletionHandler:
- (void (^)(BOOL success))completionHandler;
+ (void (^)(BOOL success))completionHandler;
// Changes the mode to |INACTIVE|.
-// if there is no delegate present, the default behavior of this method is to
-// value and takes a single BOOL argument that indicates whether or not the
-// stash browsing data created by the web view in to |browserState|'s stash
+// If there is no delegate present, the default behavior of this method is to
+// stash browsing data created by the web view in to the |browserState|'s stash
// path.
// |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
+// The mode change to |INACTIVE| can fail if another |makeActive| or
// |makeInactive| was enqueued after this call.
// Precondition: There must be no web views associated with the BrowserState.
- (void)makeInactiveWithCompletionHandler:
- (void (^)(BOOL success))completionHandler;
+ (void (^)(BOOL success))completionHandler;
// Removes all browsing data of the provided |browsingDataTypes|.
// |completionHandler| is called on the main thread after the browsing data has
@@ -91,12 +92,6 @@ typedef NS_ENUM(NSUInteger, BrowsingDataStoreMode) {
- (void)removeDataOfTypes:(web::BrowsingDataTypes)browsingDataTypes
completionHandler:(ProceduralBlock)completionHandler;
-// Returns YES if there is still a pending operation that has not finished
-// running. Creating web views (UIWebViews and WKWebViews) with this
-// CRWBrowsingDataStore when there are pending operations is undefined
-// behavior.
-@property(nonatomic, assign, readonly) BOOL hasPendingOperations;
-
@end
#endif // IOS_WEB_CRW_BROWSING_DATA_STORE_H_

Powered by Google App Engine
This is Rietveld 408576698