This article describes how to thoroughly understand the Security Domains of Flash Player. Reprinted and backed up. Original article address: http://kevincao.com/2010/11/application-domains/directory
- Application Domains (Application domain)
- Application Domain Placement (Application Domain location)
- Application Domain Inheritance (Application Domain Inheritance)
- Child Domains: Definition Versioning (subdomain: defined version management)
- Separate Domains: Preventing Conflicts (domain separation: avoid conflict)
- Same Domain: Runtime Shared Libraries (Same Domain: Runtime Shared Library)
- Getting Definitions Dynamically (dynamic definition acquisition)
- Same-definition Collisions (conflict with the Same definition)
- Conclusion (Summary)
Application Domains Application domain
Like the Security global, SWF in different security sandboxes has its own class definition. This subdomain is defined under the security domain and the management class definition (the definitions of functions, interfaces, and namespaces are similar ).Application domain. The application domain only exists in the security domain and can only belong to a unique security domain. However, the security domain can contain multiple application domains.
Application domains in the security domain
Although the security domain sandbox is used to protect data security, the application sandbox domain is used to divide definitions. However, they are all used to resolve definition conflicts and determine the inheritance relationships of codes.
Security domains are independent of each other. In contrast, the relationship between application domains is more complex. Application domains are linked together through hierarchical relationships similar to the display list in Flash. An application domain can contain any subdomain, and a subdomain can have only one parent domain. The subdomain inherits the definition from the parent domain, just like displaying the position of the parent object in the list and inheriting the zoom property quilt object.
The root node of the application domain is a system domain, which contains the native definition of the Flash Player API (Array, XML, flash. display. Sprite, etc ). The system domain corresponds to the security domain. When the security domain is initialized, this unique system domain is also created.
When a Flash Player instance is initialized, the SWF file is added to its corresponding security domain. At the same time, an application domain that contains all the compiled ActionScript definitions in this file is created. This application domain becomes the first subdomain of the System domain under the security domain. The native definition of the Flash Player API is open to all subdomains through this inheritance relationship.
A new SWF application domain is created in the system domain.
We willApplication domain inheritanceSection