OLD | NEW |
---|---|
1 # Blink IDL Extended Attributes | 1 # Blink IDL Extended Attributes |
2 | 2 |
3 [TOC] | 3 [TOC] |
4 | 4 |
5 ## Introduction | 5 ## Introduction |
6 | 6 |
7 The main interest in extended attributes are their _semantics_: Blink implements many more extended attributes than the Web IDL standard, to specify various beh avior. | 7 The main interest in extended attributes are their _semantics_: Blink implements many more extended attributes than the Web IDL standard, to specify various beh avior. |
8 | 8 |
9 The authoritative list of allowed extended attributes and values is [bindings/ID LExtendedAttributes.txt](https://code.google.com/p/chromium/codesearch#chromium/ src/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt). This is compl ete but not necessarily precise (there may be unused extended attributes or valu es), since validation is run on build, but coverage isn't checked. | 9 The authoritative list of allowed extended attributes and values is [bindings/ID LExtendedAttributes.txt](https://code.google.com/p/chromium/codesearch#chromium/ src/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt). This is compl ete but not necessarily precise (there may be unused extended attributes or valu es), since validation is run on build, but coverage isn't checked. |
10 | 10 |
(...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1566 v8::FunctionCallback callback) | 1566 v8::FunctionCallback callback) |
1567 { | 1567 { |
1568 v8::experimental::FastAccessorBuilder* fab = | 1568 v8::experimental::FastAccessorBuilder* fab = |
1569 v8::experimental::FastAccessorBuilder::New(isolate); | 1569 v8::experimental::FastAccessorBuilder::New(isolate); |
1570 fab->ReturnValue(fab->IntegerContant(123)); | 1570 fab->ReturnValue(fab->IntegerContant(123)); |
1571 return fab; | 1571 return fab; |
1572 } | 1572 } |
1573 | 1573 |
1574 ``` | 1574 ``` |
1575 | 1575 |
1576 | |
1577 ### [CachedAccessor] _(a)_ | |
1578 | |
1579 Summary: Caches accessor result to a private property. | |
1580 | |
haraken
2016/09/20 14:15:02
Add a webidl example.
| |
1581 | |
haraken
2016/09/20 14:15:02
Some description is needed to describe what [Cache
| |
1582 *** note | |
1583 The accessor cannot have any side effects since calls to the getter will be supp resed, being replaced by a cheap property load. | |
1584 It uses a **push approach**, so updates must be 'pushed' every single time, it * *WONT'T** invalidate/recalculate the values automatically. | |
1585 The original getter can still be used/called on certain circumstances. | |
1586 Useful for performance-critical use cases, where the accessor's result doesn't c hange often. | |
1587 | |
1588 Please add the required property to V8PrivateProperty.h. | |
1589 To update the cache (e.g. for window.document) proceed as follows: | |
1590 | |
1591 ```c++ | |
1592 V8PrivateProperty::getWindowDocument().set(context, object, newValue); | |
1593 ``` | |
1594 | |
1595 | |
1596 *** | |
1597 | |
1598 Usage: `[CachedAccessor]` takes no arguments, can be specified on attributes. | |
1599 | |
1600 | |
1576 ## Discouraged Blink-specific IDL Extended Attributes | 1601 ## Discouraged Blink-specific IDL Extended Attributes |
1577 | 1602 |
1578 These extended attributes are _discouraged_ - they are not deprecated, but they should be avoided and removed if possible. | 1603 These extended attributes are _discouraged_ - they are not deprecated, but they should be avoided and removed if possible. |
1579 | 1604 |
1580 ### [DoNotCheckConstants] _(i)_ | 1605 ### [DoNotCheckConstants] _(i)_ |
1581 | 1606 |
1582 Summary: `[DoNotCheckConstants]` indicates that constant values in an IDL file c an be different from constant values in Blink implementation. | 1607 Summary: `[DoNotCheckConstants]` indicates that constant values in an IDL file c an be different from constant values in Blink implementation. |
1583 | 1608 |
1584 Usage: `[DoNotCheckConstants]` can be specified on interfaces: | 1609 Usage: `[DoNotCheckConstants]` can be specified on interfaces: |
1585 | 1610 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1649 Copyright (C) 2009 Apple Inc. All rights reserved. | 1674 Copyright (C) 2009 Apple Inc. All rights reserved. |
1650 | 1675 |
1651 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | 1676 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
1652 | 1677 |
1653 1. Redistributions of source code must retain the above copyright notice, this l ist of conditions and the following disclaimer. | 1678 1. Redistributions of source code must retain the above copyright notice, this l ist of conditions and the following disclaimer. |
1654 | 1679 |
1655 2. Redistributions in binary form must reproduce the above copyright notice, thi s list of conditions and the following disclaimer in the documentation and/or ot her materials provided with the distribution. | 1680 2. Redistributions in binary form must reproduce the above copyright notice, thi s list of conditions and the following disclaimer in the documentation and/or ot her materials provided with the distribution. |
1656 | 1681 |
1657 THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS “AS IS” AND ANY EXP RESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIE S OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, I NCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMI TED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFI TS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHE THER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSI BILITY OF SUCH DAMAGE. | 1682 THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS “AS IS” AND ANY EXP RESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIE S OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, I NCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMI TED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFI TS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHE THER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSI BILITY OF SUCH DAMAGE. |
1658 *** | 1683 *** |
OLD | NEW |