Title: [182572] trunk/Source/WebKit2
- Revision
- 182572
- Author
- [email protected]
- Date
- 2015-04-08 15:47:26 -0700 (Wed, 08 Apr 2015)
Log Message
Add encoding and decoding of ints to WKRemoteObjectCoder
https://bugs.webkit.org/show_bug.cgi?id=143538
Reviewed by Tim Horton.
* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(-[WKRemoteObjectEncoder encodeInt:forKey:]):
(-[WKRemoteObjectDecoder decodeIntForKey:]):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (182571 => 182572)
--- trunk/Source/WebKit2/ChangeLog 2015-04-08 22:21:30 UTC (rev 182571)
+++ trunk/Source/WebKit2/ChangeLog 2015-04-08 22:47:26 UTC (rev 182572)
@@ -1,5 +1,16 @@
2015-04-08 Anders Carlsson <[email protected]>
+ Add encoding and decoding of ints to WKRemoteObjectCoder
+ https://bugs.webkit.org/show_bug.cgi?id=143538
+
+ Reviewed by Tim Horton.
+
+ * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
+ (-[WKRemoteObjectEncoder encodeInt:forKey:]):
+ (-[WKRemoteObjectDecoder decodeIntForKey:]):
+
+2015-04-08 Anders Carlsson <[email protected]>
+
Delete ApplicationCache static member functions
https://bugs.webkit.org/show_bug.cgi?id=143534
Modified: trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm (182571 => 182572)
--- trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm 2015-04-08 22:21:30 UTC (rev 182571)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm 2015-04-08 22:47:26 UTC (rev 182572)
@@ -297,6 +297,11 @@
_currentDictionary->set(escapeKey(key), API::Boolean::create(value));
}
+- (void)encodeInt:(int)value forKey:(NSString *)key
+{
+ _currentDictionary->set(escapeKey(key), API::UInt64::create(value));
+}
+
- (void)encodeInt32:(int32_t)value forKey:(NSString *)key
{
_currentDictionary->set(escapeKey(key), API::UInt64::create(value));
@@ -596,6 +601,14 @@
return value->value();
}
+- (int)decodeIntForKey:(NSString *)key
+{
+ const API::UInt64* value = _currentDictionary->get<API::UInt64>(escapeKey(key));
+ if (!value)
+ return 0;
+ return static_cast<int>(value->value());
+}
+
- (int32_t)decodeInt32ForKey:(NSString *)key
{
const API::UInt64* value = _currentDictionary->get<API::UInt64>(escapeKey(key));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes