aboutsummaryrefslogtreecommitdiff
path: root/Foundation
diff options
context:
space:
mode:
authorGravatar Thomas Van Lenten <thomasvl@google.com>2016-04-29 13:59:11 -0400
committerGravatar Thomas Van Lenten <thomasvl@google.com>2016-04-29 13:59:11 -0400
commitb1656a461d5864c9c2662b9e329c29dfc8c9f777 (patch)
treedf5299ac367df7b0512d81af6d7a7ecca4fb6a8e /Foundation
parentc485d79b9289a4f6ff1402babbf44b6fba0aa6e7 (diff)
parent296d521919da2cebe0e5074cc8b6b2b5fdb85fd6 (diff)
Merge pull request #114 from thomasvl/update
Testing/Utils updates
Diffstat (limited to 'Foundation')
-rw-r--r--Foundation/GTMNSAppleScript+Handler.m15
1 files changed, 7 insertions, 8 deletions
diff --git a/Foundation/GTMNSAppleScript+Handler.m b/Foundation/GTMNSAppleScript+Handler.m
index e17ba91..850de58 100644
--- a/Foundation/GTMNSAppleScript+Handler.m
+++ b/Foundation/GTMNSAppleScript+Handler.m
@@ -22,7 +22,6 @@
#import "GTMNSAppleEventDescriptor+Handler.h"
#import "GTMFourCharCode.h"
#import "GTMMethodCheck.h"
-#import "GTMDebugThreadValidation.h"
// Keys for passing AppleScript calls from other threads to the main thread
// and back through gtm_internalExecuteAppleEvent:
@@ -326,7 +325,7 @@ GTM_METHOD_CHECK(NSAppleEventDescriptor, gtm_registerSelector:forTypes:count:);
}
- (NSAppleEventDescriptor*)gtm_valueDescriptorForProperty:(id)property {
- GTMAssertRunningOnMainThread();
+ _GTMDevAssert([NSThread isMainThread], @"Requires main thread.");
OSAError error = paramErr;
NSAppleEventDescriptor *desc = nil;
NSAppleEventDescriptor *propertyName
@@ -377,7 +376,7 @@ GTM_METHOD_CHECK(NSAppleEventDescriptor, gtm_registerSelector:forTypes:count:);
}
- (NSSet*)gtm_scriptHandlers {
- GTMAssertRunningOnMainThread();
+ _GTMDevAssert([NSThread isMainThread], @"Requires main thread.");
AEDescList names = { typeNull, NULL };
NSArray *array = nil;
ComponentInstance component = NULL;
@@ -396,7 +395,7 @@ GTM_METHOD_CHECK(NSAppleEventDescriptor, gtm_registerSelector:forTypes:count:);
}
- (NSSet*)gtm_scriptProperties {
- GTMAssertRunningOnMainThread();
+ _GTMDevAssert([NSThread isMainThread], @"Requires main thread.");
AEDescList names = { typeNull, NULL };
NSArray *array = nil;
ComponentInstance component = NULL;
@@ -415,7 +414,7 @@ GTM_METHOD_CHECK(NSAppleEventDescriptor, gtm_registerSelector:forTypes:count:);
}
- (OSAID)gtm_genericID:(OSAID)osaID forComponent:(ComponentInstance)component {
- GTMAssertRunningOnMainThread();
+ _GTMDevAssert([NSThread isMainThread], @"Requires main thread.");
ComponentInstance genericComponent = [NSAppleScript _defaultScriptingComponent];
OSAID exactID = osaID;
OSAError error = OSARealToGenericID(genericComponent, &exactID, component);
@@ -428,7 +427,7 @@ GTM_METHOD_CHECK(NSAppleEventDescriptor, gtm_registerSelector:forTypes:count:);
- (NSAppleEventDescriptor*)descForScriptID:(OSAID)osaID
component:(ComponentInstance)component {
- GTMAssertRunningOnMainThread();
+ _GTMDevAssert([NSThread isMainThread], @"Requires main thread.");
NSAppleEventDescriptor *desc = nil;
// If we have a script, return a typeGTMOSAID, otherwise convert it to
// it's default AEDesc using OSACoerceToDesc with typeWildCard.
@@ -468,7 +467,7 @@ GTM_METHOD_CHECK(NSAppleEventDescriptor, gtm_registerSelector:forTypes:count:);
}
- (OSAID)gtm_realIDAndComponent:(ComponentInstance*)component {
- GTMAssertRunningOnMainThread();
+ _GTMDevAssert([NSThread isMainThread], @"Requires main thread.");
if (![self isCompiled]) {
NSDictionary *error;
if (![self compileAndReturnError:&error]) {
@@ -487,7 +486,7 @@ GTM_METHOD_CHECK(NSAppleEventDescriptor, gtm_registerSelector:forTypes:count:);
}
- (void)gtm_internalExecuteAppleEvent:(NSMutableDictionary *)data {
- GTMAssertRunningOnMainThread();
+ _GTMDevAssert([NSThread isMainThread], @"Requires main thread.");
NSDictionary *error = nil;
if (![self isCompiled]) {
[self compileAndReturnError:&error];