PBackgroundSessionStorageCache.ipdl (1771B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 include protocol PBackground; 6 include protocol PBackgroundSessionStorageManager; 7 include PBackgroundSharedTypes; 8 9 namespace mozilla { 10 namespace dom { 11 12 struct SSSetItemInfo 13 { 14 nsString key; 15 nsString value; 16 }; 17 18 struct SSRemoveItemInfo 19 { 20 nsString key; 21 }; 22 23 struct SSClearInfo 24 { 25 }; 26 27 /** 28 * Union of SessionStorage mutation types. 29 */ 30 union SSWriteInfo 31 { 32 SSSetItemInfo; 33 SSRemoveItemInfo; 34 SSClearInfo; 35 }; 36 37 struct SSCacheCopy { 38 nsCString originKey; 39 PrincipalInfo principalInfo; 40 SSSetItemInfo[] data; 41 }; 42 43 [ChildImpl=virtual, ParentImpl=virtual] 44 sync protocol PBackgroundSessionStorageCache 45 { 46 manager PBackgroundSessionStorageManager; 47 48 parent: 49 async DeleteMe(); 50 51 /** 52 * Copy SessionStorageCache from the parent process to the content process. 53 * See SessionStorageManager documentation for more details. 54 * 55 * This needs to be synchronous because SessionStorage's semantics are 56 * synchronous. Note that the BackgroundSessionStorageManager in the 57 * PBackground parent already has the answers to this request immediately 58 * available without needing to consult any other threads or perform any I/O. 59 */ 60 sync Load() 61 returns (SSSetItemInfo[] aData); 62 63 /** 64 * Send changes for SessionStorageCache from a content process to the parent 65 * process so that the data in the parent can be updated to be in sync with 66 * the content. See SessionStorageManager documentation for more details. 67 */ 68 async Checkpoint(SSWriteInfo[] aWriteInfos); 69 70 child: 71 async __delete__(); 72 }; 73 74 } // namespace dom 75 } // namespace mozilla