mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
This replaces the old functionality of ensuring no files or directories have subscriptions in javascript. We allow this now, but we just don't allow leaked watches at the native layer.
25 lines
748 B
Objective-C
25 lines
748 B
Objective-C
#import "include/cef_base.h"
|
|
#import "include/cef_v8.h"
|
|
#import <Foundation/Foundation.h>
|
|
|
|
typedef void (^WatchCallback)(NSString *, NSString *);
|
|
|
|
@interface PathWatcher : NSObject {
|
|
int _kq;
|
|
CefRefPtr<CefV8Context> _context;
|
|
NSMutableDictionary *_callbacksByPath;
|
|
NSMutableDictionary *_fileDescriptorsByPath;
|
|
|
|
bool _keepWatching;
|
|
}
|
|
|
|
+ (PathWatcher *)pathWatcherForContext:(CefRefPtr<CefV8Context>)context;
|
|
+ (void)removePathWatcherForContext:(CefRefPtr<CefV8Context>)context;
|
|
|
|
- (id)initWithContext:(CefRefPtr<CefV8Context>)context;
|
|
- (NSString *)watchPath:(NSString *)path callback:(WatchCallback)callback;
|
|
- (void)unwatchPath:(NSString *)path callbackId:(NSString *)callbackId error:(NSError **)error;
|
|
- (NSArray *)watchedPaths;
|
|
|
|
@end
|