summaryrefslogtreecommitdiffstats
path: root/macosx/HBSecurityAccessToken.h
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2017-01-25 11:03:00 +0100
committerDamiano Galassi <[email protected]>2017-01-25 11:03:00 +0100
commit178071e0ce842af53e8c51e6275e8956fc4aa27c (patch)
tree6337430f7ec1900ce562bf394954469cc68b80d2 /macosx/HBSecurityAccessToken.h
parent79c33c0ca996311224bbd3719c85238a3358cb5e (diff)
MacGui: improve management of security scoped resources. Fix external SRT in the sandboxed build.
Diffstat (limited to 'macosx/HBSecurityAccessToken.h')
-rw-r--r--macosx/HBSecurityAccessToken.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/macosx/HBSecurityAccessToken.h b/macosx/HBSecurityAccessToken.h
new file mode 100644
index 000000000..1ad0b3979
--- /dev/null
+++ b/macosx/HBSecurityAccessToken.h
@@ -0,0 +1,35 @@
+//
+// HBSecurityAccessToken.h
+// HandBrake
+//
+// Created by Damiano Galassi on 24/01/17.
+//
+//
+
+#import <Foundation/Foundation.h>
+
+@protocol HBSecurityScope <NSObject>
+
+/* Given an instance, make the resource referenced by the job accessible to the process.
+ */
+- (BOOL)startAccessingSecurityScopedResource;
+
+/* Revokes the access granted to the url by a prior successful call to startAccessingSecurityScopedResource.
+ */
+- (void)stopAccessingSecurityScopedResource;
+
+@end
+
+@interface NSURL (HBSecurityScope) <HBSecurityScope>
+
+- (BOOL)startAccessingSecurityScopedResource;
+- (void)stopAccessingSecurityScopedResource;
+
+@end
+
+@interface HBSecurityAccessToken : NSObject
+
++ (instancetype)tokenWithObject:(id<HBSecurityScope>)object;
+- (instancetype)initWithObject:(id<HBSecurityScope>)object;
+
+@end