1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // A comment for the functions namespace. 6 namespace functions { 7 callback SimpleCallback = void (); 8 9 callback PrimitiveCallback = void (int i); 10 11 callback DictCallback = void ([instanceOf=DictType] object dict); 12 13 dictionary DictType { 14 // A field. 15 int a; 16 17 // A parameter. 18 static void voidFunc(); 19 }; 20 21 interface Functions { 22 // Simple function. 23 static void voidFunc(); 24 25 // Function taking a non-optional argument. 26 static void argFunc(DOMString s); 27 28 // Function taking an optional argument. 29 static void optionalArgFunc(optional DOMString s); 30 31 // Function taking a non-optional dictionary argument. 32 static void dictArgFunc(DictType d); 33 34 // Function taking an optional dictionary argument. 35 static void optionalDictArgFunc(optional DictType d); 36 37 // Function taking an entry argument. 38 static void entryArgFunc([intanceOf=FileEntry] object entry); 39 40 // Function taking a simple callback. 41 static void callbackFunc(SimpleCallback c); 42 43 // Function taking an optional simple callback. 44 static void optionalCallbackFunc(optional SimpleCallback c); 45 46 // Function taking a primitive callback. 47 static void primitiveCallbackFunc(PrimitiveCallback c); 48 49 // Function taking a dictionary callback. 50 static void dictCallbackFunc(DictCallback c); 51 52 // Function returning a dictionary. 53 static DictType dictRetFunc(); 54 }; 55 }; 56