Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support bool argument for encoding/decoding invocations.
https://bugs.webkit.org/show_bug.cgi?id=126823

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2014-01-11
Reviewed by Sam Weinig.

For remote invocation method argument, current we support int, double and ObjC
object, this patch add support for bool type too.

* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(encodeInvocation):
(decodeInvocationArguments):

Canonical link: https://commits.webkit.org/144803@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161804 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Yongjun Zhang authored and webkit-commit-queue committed Jan 12, 2014
1 parent 14fc471 commit 1fa60ca
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,17 @@
2014-01-11 Yongjun Zhang <yongjun_zhang@apple.com>

Support bool argument for encoding/decoding invocations.
https://bugs.webkit.org/show_bug.cgi?id=126823

Reviewed by Sam Weinig.

For remote invocation method argument, current we support int, double and ObjC
object, this patch add support for bool type too.

* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(encodeInvocation):
(decodeInvocationArguments):

2014-01-11 Alexey Proskuryakov <ap@apple.com>

[Mac] [Windows] Stop scheduling network requests in WebCore
Expand Down
16 changes: 16 additions & 0 deletions Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm
Expand Up @@ -146,6 +146,15 @@ static void encodeInvocation(WKRemoteObjectEncoder *encoder, NSInvocation *invoc
break;
}

// bool
case 'B': {
BOOL value;
[invocation getArgument:&value atIndex:i];;

encodeToObjectStream(encoder, @(value));
break;
}

// Objective-C object
case '@': {
id value;
Expand Down Expand Up @@ -385,6 +394,13 @@ static void decodeInvocationArguments(WKRemoteObjectDecoder *decoder, NSInvocati
break;
}

// bool
case 'B': {
bool value = [decodeObjectFromObjectStream(decoder, [NSSet setWithObject:[NSNumber class]]) boolValue];
[invocation setArgument:&value atIndex:i];
break;
}

// Objective-C object
case '@': {
NSSet *allowedClasses = allowedArgumentClasses[i - 2].get();
Expand Down

0 comments on commit 1fa60ca

Please sign in to comment.