diff --git a/mozilla/browser/EULA b/mozilla/browser/EULA deleted file mode 100644 index 86ce7c194fd..00000000000 --- a/mozilla/browser/EULA +++ /dev/null @@ -1,18 +0,0 @@ -FOR TRANSLATIONS OF THIS LICENSE INTO SELECTED LANGUAGES, PLEASE VISIT WWW.MOZILLA.ORG/LICENSING. - -MOZILLA FIREFOX END-USER SOFTWARE LICENSE AGREEMENT -Version 1.1 - -A SOURCE CODE VERSION OF CERTAIN FIREFOX BROWSER FUNCTIONALITY THAT YOU MAY USE, MODIFY AND DISTRIBUTE IS AVAILABLE TO YOU FREE-OF-CHARGE FROM WWW.MOZILLA.ORG UNDER THE MOZILLA PUBLIC LICENSE and other open source software licenses. -The accompanying executable code version of Mozilla Firefox and related documentation (the "Product") is made available to you under the terms of this MOZILLA FIREFOX END-USER SOFTWARE LICENSE AGREEMENT (THE "AGREEMENT"). BY CLICKING THE "ACCEPT" BUTTON, OR BY INSTALLING OR USING THE MOZILLA FIREFOX BROWSER, YOU ARE CONSENTING TO BE BOUND BY THE AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT, DO NOT CLICK THE "ACCEPT" BUTTON, AND DO NOT INSTALL OR USE ANY PART OF THE MOZILLA FIREFOX BROWSER. -DURING THE MOZILLA FIREFOX INSTALLATION PROCESS, AND AT LATER TIMES, YOU MAY BE GIVEN THE OPTION OF INSTALLING ADDITIONAL COMPONENTS FROM THIRD-PARTY SOFTWARE PROVIDERS. THE INSTALLATION AND USE OF THOSE THIRD-PARTY COMPONENTS MAY BE GOVERNED BY ADDITIONAL LICENSE AGREEMENTS. -1. LICENSE GRANT. The Mozilla Corporation grants you a non-exclusive license to use the executable code version of the Product. This Agreement will also govern any software upgrades provided by Mozilla that replace and/or supplement the original Product, unless such upgrades are accompanied by a separate license, in which case the terms of that license will govern. -2. TERMINATION. If you breach this Agreement your right to use the Product will terminate immediately and without notice, but all provisions of this Agreement except the License Grant (Paragraph 1) will survive termination and continue in effect. Upon termination, you must destroy all copies of the Product. -3. PROPRIETARY RIGHTS. Portions of the Product are available in source code form under the terms of the Mozilla Public License and other open source licenses (collectively, "Open Source Licenses") at http://www.mozilla.org. Nothing in this Agreement will be construed to limit any rights granted under the Open Source Licenses. Subject to the foregoing, Mozilla, for itself and on behalf of its licensors, hereby reserves all intellectual property rights in the Product, except for the rights expressly granted in this Agreement. You may not remove or alter any trademark, logo, copyright or other proprietary notice in or on the Product. This license does not grant you any right to use the trademarks, service marks or logos of Mozilla or its licensors. -4. DISCLAIMER OF WARRANTY. THE PRODUCT IS PROVIDED "AS IS" WITH ALL FAULTS. TO THE EXTENT PERMITTED BY LAW, MOZILLA AND MOZILLA'S DISTRIBUTORS, LICENSORS HEREBY DISCLAIM ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES THAT THE PRODUCT IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE AND NON-INFRINGING. YOU BEAR ENTIRE RISK AS TO SELECTING THE PRODUCT FOR YOUR PURPOSES AND AS TO THE QUALITY AND PERFORMANCE OF THE PRODUCT. THIS LIMITATION WILL APPLY NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES, SO THIS DISCLAIMER MAY NOT APPLY TO YOU. -5. LIMITATION OF LIABILITY. EXCEPT AS REQUIRED BY LAW, MOZILLA AND ITS DISTRIBUTORS, DIRECTORS, LICENSORS, CONTRIBUTORS AND AGENTS (COLLECTIVELY, THE "MOZILLA GROUP") WILL NOT BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES ARISING OUT OF OR IN ANY WAY RELATING TO THIS AGREEMENT OR THE USE OF OR INABILITY TO USE THE PRODUCT, INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOST PROFITS, LOSS OF DATA, AND COMPUTER FAILURE OR MALFUNCTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF THE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH SUCH CLAIM IS BASED. THE MOZILLA GROUP'S COLLECTIVE LIABILITY UNDER THIS AGREEMENT WILL NOT EXCEED THE GREATER OF $500 (FIVE HUNDRED DOLLARS) AND THE FEES PAID BY YOU UNDER THIS LICENSE (IF ANY). SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL, CONSEQUENTIAL OR SPECIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. -6. EXPORT CONTROLS. This license is subject to all applicable export restrictions. You must comply with all export and import laws and restrictions and regulations of any United States or foreign agency or authority relating to the Product and its use. -7. U.S. GOVERNMENT END-USERS. The Product is a "commercial item," as that term is defined in 48 C.F.R. 2.101, consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995) and 48 C.F.R. 227.7202 (June 1995). Consistent with 48 C.F.R. 12.212, 48 C.F.R. 27.405(b)(2) (June 1998) and 48 C.F.R. 227.7202, all U.S. Government End Users acquire the Product with only those rights as set forth herein. -8. MISCELLANEOUS. (a) This Agreement constitutes the entire agreement between Mozilla and you concerning the subject matter hereof, and it may only be modified by a written amendment signed by an authorized executive of Mozilla. (b) Except to the extent applicable law, if any, provides otherwise, this Agreement will be governed by the laws of the state of California, U.S.A., excluding its conflict of law provisions. (c) This Agreement will not be governed by the United Nations Convention on Contracts for the International Sale of Goods. (d) If any part of this Agreement is held invalid or unenforceable, that part will be construed to reflect the parties' original intent, and the remaining portions will remain in full force and effect. (e) A waiver by either party of any term or condition of this Agreement or any breach thereof, in any one instance, will not waive such term or condition or any subsequent breach thereof. (f) Except as required by law, the controlling language of this Agreement is English. (g) You may assign your rights under this Agreement to any party that consents to, and agrees to be bound by, its terms; the Mozilla Corporation may assign its rights under this Agreement without condition. (h) This Agreement will be binding upon and will inure to the benefit of the parties, their successors and permitted assigns. - - diff --git a/mozilla/browser/LICENSE b/mozilla/browser/LICENSE deleted file mode 100644 index 7a0b13bfc7b..00000000000 --- a/mozilla/browser/LICENSE +++ /dev/null @@ -1,571 +0,0 @@ -You are not granted rights or licenses to the trademarks of the -Mozilla Foundation or any party, including without limitation the -Firefox name or logo. - - MOZILLA PUBLIC LICENSE - Version 1.1 - - --------------- - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the - Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to - the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original - Code, prior Modifications used by a Contributor, and the Modifications - made by that particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the - combination of the Original Code and Modifications, in each case - including portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally - accepted in the software development community for the electronic - transfer of data. - - 1.5. "Executable" means Covered Code in any form other than Source - Code. - - 1.6. "Initial Developer" means the individual or entity identified - as the Initial Developer in the Source Code notice required by Exhibit - A. - - 1.7. "Larger Work" means a work which combines Covered Code or - portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum - extent possible, whether at the time of the initial grant or - subsequently acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the - substance or structure of either the Original Code or any previous - Modifications. When Covered Code is released as a series of files, a - Modification is: - A. Any addition to or deletion from the contents of a file - containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or - previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code - which is described in the Source Code notice required by Exhibit A as - Original Code, and which, at the time of its release under this - License is not already Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or - hereafter acquired, including without limitation, method, process, - and apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for - making modifications to it, including all modules it contains, plus - any associated interface definition files, scripts used to control - compilation and installation of an Executable, or source code - differential comparisons against either the Original Code or another - well known, available Covered Code of the Contributor's choice. The - Source Code can be in a compressed or archival form, provided the - appropriate decompression or de-archiving software is widely available - for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity - exercising rights under, and complying with all of the terms of, this - License or a future version of this License issued under Section 6.1. - For legal entities, "You" includes any entity which controls, is - controlled by, or is under common control with You. For purposes of - this definition, "control" means (a) the power, direct or indirect, - to cause the direction or management of such entity, whether by - contract or otherwise, or (b) ownership of more than fifty percent - (50%) of the outstanding shares or beneficial ownership of such - entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, - non-exclusive license, subject to third party intellectual property - claims: - (a) under intellectual property rights (other than patent or - trademark) Licensable by Initial Developer to use, reproduce, - modify, display, perform, sublicense and distribute the Original - Code (or portions thereof) with or without Modifications, and/or - as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or - selling of Original Code, to make, have made, use, practice, - sell, and offer for sale, and/or otherwise dispose of the - Original Code (or portions thereof). - - (c) the licenses granted in this Section 2.1(a) and (b) are - effective on the date Initial Developer first distributes - Original Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is - granted: 1) for code that You delete from the Original Code; 2) - separate from the Original Code; or 3) for infringements caused - by: i) the modification of the Original Code or ii) the - combination of the Original Code with other software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor - hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or - trademark) Licensable by Contributor, to use, reproduce, modify, - display, perform, sublicense and distribute the Modifications - created by such Contributor (or portions thereof) either on an - unmodified basis, with other Modifications, as Covered Code - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or - selling of Modifications made by that Contributor either alone - and/or in combination with its Contributor Version (or portions - of such combination), to make, use, sell, offer for sale, have - made, and/or otherwise dispose of: 1) Modifications made by that - Contributor (or portions thereof); and 2) the combination of - Modifications made by that Contributor with its Contributor - Version (or portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are - effective on the date Contributor first makes Commercial Use of - the Covered Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is - granted: 1) for any code that Contributor has deleted from the - Contributor Version; 2) separate from the Contributor Version; - 3) for infringements caused by: i) third party modifications of - Contributor Version or ii) the combination of Modifications made - by that Contributor with other software (except as part of the - Contributor Version) or other devices; or 4) under Patent Claims - infringed by Covered Code in the absence of Modifications made by - that Contributor. - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are - governed by the terms of this License, including without limitation - Section 2.2. The Source Code version of Covered Code may be - distributed only under the terms of this License or a future version - of this License released under Section 6.1, and You must include a - copy of this License with every copy of the Source Code You - distribute. You may not offer or impose any terms on any Source Code - version that alters or restricts the applicable version of this - License or the recipients' rights hereunder. However, You may include - an additional document offering the additional rights described in - Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be - made available in Source Code form under the terms of this License - either on the same media as an Executable version or via an accepted - Electronic Distribution Mechanism to anyone to whom you made an - Executable version available; and if made available via Electronic - Distribution Mechanism, must remain available for at least twelve (12) - months after the date it initially became available, or at least six - (6) months after a subsequent version of that particular Modification - has been made available to such recipients. You are responsible for - ensuring that the Source Code version remains available even if the - Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a - file documenting the changes You made to create that Covered Code and - the date of any change. You must include a prominent statement that - the Modification is derived, directly or indirectly, from Original - Code provided by the Initial Developer and including the name of the - Initial Developer in (a) the Source Code, and (b) in any notice in an - Executable version or related documentation in which You describe the - origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's - intellectual property rights is required to exercise the rights - granted by such Contributor under Sections 2.1 or 2.2, - Contributor must include a text file with the Source Code - distribution titled "LEGAL" which describes the claim and the - party making the claim in sufficient detail that a recipient will - know whom to contact. If Contributor obtains such knowledge after - the Modification is made available as described in Section 3.2, - Contributor shall promptly modify the LEGAL file in all copies - Contributor makes available thereafter and shall take other steps - (such as notifying appropriate mailing lists or newsgroups) - reasonably calculated to inform those who received the Covered - Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming - interface and Contributor has knowledge of patent licenses which - are reasonably necessary to implement that API, Contributor must - also include this information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to - Section 3.4(a) above, Contributor believes that Contributor's - Modifications are Contributor's original creation(s) and/or - Contributor has sufficient rights to grant the rights conveyed by - this License. - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source - Code. If it is not possible to put such notice in a particular Source - Code file due to its structure, then You must include such notice in a - location (such as a relevant directory) where a user would be likely - to look for such a notice. If You created one or more Modification(s) - You may add your name as a Contributor to the notice described in - Exhibit A. You must also duplicate this License in any documentation - for the Source Code where You describe recipients' rights or ownership - rights relating to Covered Code. You may choose to offer, and to - charge a fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Code. However, You - may do so only on Your own behalf, and not on behalf of the Initial - Developer or any Contributor. You must make it absolutely clear than - any such warranty, support, indemnity or liability obligation is - offered by You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred by the - Initial Developer or such Contributor as a result of warranty, - support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the - requirements of Section 3.1-3.5 have been met for that Covered Code, - and if You include a notice stating that the Source Code version of - the Covered Code is available under the terms of this License, - including a description of how and where You have fulfilled the - obligations of Section 3.2. The notice must be conspicuously included - in any notice in an Executable version, related documentation or - collateral in which You describe recipients' rights relating to the - Covered Code. You may distribute the Executable version of Covered - Code or ownership rights under a license of Your choice, which may - contain terms different from this License, provided that You are in - compliance with the terms of this License and that the license for the - Executable version does not attempt to limit or alter the recipient's - rights in the Source Code version from the rights set forth in this - License. If You distribute the Executable version under a different - license You must make it absolutely clear that any terms which differ - from this License are offered by You alone, not by the Initial - Developer or any Contributor. You hereby agree to indemnify the - Initial Developer and every Contributor for any liability incurred by - the Initial Developer or such Contributor as a result of any such - terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code - not governed by the terms of this License and distribute the Larger - Work as a single product. In such a case, You must make sure the - requirements of this License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this - License with respect to some or all of the Covered Code due to - statute, judicial order, or regulation then You must: (a) comply with - the terms of this License to the maximum extent possible; and (b) - describe the limitations and the code they affect. Such description - must be included in the LEGAL file described in Section 3.4 and must - be included with all distributions of the Source Code. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has - attached the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised - and/or new versions of the License from time to time. Each version - will be given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the - License, You may always continue to use it under the terms of that - version. You may also choose to use such Covered Code under the terms - of any subsequent version of the License published by Netscape. No one - other than Netscape has the right to modify the terms applicable to - Covered Code created under this License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may - only do in order to apply it to code which is not already Covered Code - governed by this License), You must (a) rename Your license so that - the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", - "MPL", "NPL" or any confusingly similar phrase do not appear in your - license (except to note that your license differs from this License) - and (b) otherwise make it clear that Your version of the license - contains terms which differ from the Mozilla Public License and - Netscape Public License. (Filling in the name of the Initial - Developer, Original Code or Contributor in the notice described in - Exhibit A shall not of themselves be deemed to be modifications of - this License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF - DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. - THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE - IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, - YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE - COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER - OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate - automatically if You fail to comply with terms herein and fail to cure - such breach within 30 days of becoming aware of the breach. All - sublicenses to the Covered Code which are properly granted shall - survive any termination of this License. Provisions which, by their - nature, must remain in effect beyond the termination of this License - shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement - claim (excluding declatory judgment actions) against Initial Developer - or a Contributor (the Initial Developer or Contributor against whom - You file such action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly - infringes any patent, then any and all rights granted by such - Participant to You under Sections 2.1 and/or 2.2 of this License - shall, upon 60 days notice from Participant terminate prospectively, - unless if within 60 days after receipt of notice You either: (i) - agree in writing to pay Participant a mutually agreeable reasonable - royalty for Your past and future use of Modifications made by such - Participant, or (ii) withdraw Your litigation claim with respect to - the Contributor Version against such Participant. If within 60 days - of notice, a reasonable royalty and payment arrangement are not - mutually agreed upon in writing by the parties or the litigation claim - is not withdrawn, the rights granted by Participant to You under - Sections 2.1 and/or 2.2 automatically terminate at the expiration of - the 60 day notice period specified above. - - (b) any software, hardware, or device, other than such Participant's - Contributor Version, directly or indirectly infringes any patent, then - any rights granted to You by such Participant under Sections 2.1(b) - and 2.2(b) are revoked effective as of the date You first made, used, - sold, distributed, or had made, Modifications made by that - Participant. - - 8.3. If You assert a patent infringement claim against Participant - alleging that such Participant's Contributor Version directly or - indirectly infringes any patent where such claim is resolved (such as - by license or settlement) prior to the initiation of patent - infringement litigation, then the reasonable value of the licenses - granted by such Participant under Sections 2.1 or 2.2 shall be taken - into account in determining the amount or value of any payment or - license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, - all end user license agreements (excluding distributors and resellers) - which have been validly granted by You or any distributor hereunder - prior to termination shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL - DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, - OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR - ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY - CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, - WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY - RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW - PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE - EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO - THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in - 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer - software" and "commercial computer software documentation," as such - terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 - C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), - all U.S. Government End Users acquire Covered Code with only those - rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. This License shall be governed by - California law provisions (except to the extent applicable law, if - any, provides otherwise), excluding its conflict-of-law provisions. - With respect to disputes in which at least one party is a citizen of, - or an entity chartered or registered to do business in the United - States of America, any litigation relating to this License shall be - subject to the jurisdiction of the Federal Courts of the Northern - District of California, with venue lying in Santa Clara County, - California, with the losing party responsible for costs, including - without limitation, court costs and reasonable attorneys' fees and - expenses. The application of the United Nations Convention on - Contracts for the International Sale of Goods is expressly excluded. - Any law or regulation which provides that the language of a contract - shall be construed against the drafter shall not apply to this - License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or indirectly, - out of its utilization of rights under this License and You agree to - work with Initial Developer and Contributors to distribute such - responsibility on an equitable basis. Nothing herein is intended or - shall be deemed to constitute any admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as - "Multiple-Licensed". "Multiple-Licensed" means that the Initial - Developer permits you to utilize portions of the Covered Code under - Your choice of the NPL or the alternative licenses, if any, specified - by the Initial Developer in the file described in Exhibit A. - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License - Version 1.1 (the "License"); you may not use this file except in - compliance with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - License for the specific language governing rights and limitations - under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. - Portions created by ______________________ are Copyright (C) ______ - _______________________. All Rights Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms - of the _____ license (the "[___] License"), in which case the - provisions of [______] License are applicable instead of those - above. If you wish to allow use of your version of this file only - under the terms of the [____] License and not to allow others to use - your version of this file under the MPL, indicate your decision by - deleting the provisions above and replace them with the notice and - other provisions required by the [___] License. If you do not delete - the provisions above, a recipient may use your version of this file - under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of - the notices in the Source Code files of the Original Code. You should - use the text of this Exhibit A rather than the text found in the - Original Code Source Code for Your Modifications.] - - ---------------------------------------------------------------------- - - AMENDMENTS - - The Netscape Public License Version 1.1 ("NPL") consists of the - Mozilla Public License Version 1.1 with the following Amendments, - including Exhibit A-Netscape Public License. Files identified with - "Exhibit A-Netscape Public License" are governed by the Netscape - Public License Version 1.1. - - Additional Terms applicable to the Netscape Public License. - I. Effect. - These additional terms described in this Netscape Public - License -- Amendments shall apply to the Mozilla Communicator - client code and to all Covered Code under this License. - - II. "Netscape's Branded Code" means Covered Code that Netscape - distributes and/or permits others to distribute under one or more - trademark(s) which are controlled by Netscape but which are not - licensed for use under this License. - - III. Netscape and logo. - This License does not grant any rights to use the trademarks - "Netscape", the "Netscape N and horizon" logo or the "Netscape - lighthouse" logo, "Netcenter", "Gecko", "Java" or "JavaScript", - "Smart Browsing" even if such marks are included in the Original - Code or Modifications. - - IV. Inability to Comply Due to Contractual Obligation. - Prior to licensing the Original Code under this License, Netscape - has licensed third party code for use in Netscape's Branded Code. - To the extent that Netscape is limited contractually from making - such third party code available under this License, Netscape may - choose to reintegrate such code into Covered Code without being - required to distribute such code in Source Code form, even if - such code would otherwise be considered "Modifications" under - this License. - - V. Use of Modifications and Covered Code by Initial Developer. - V.1. In General. - The obligations of Section 3 apply to Netscape, except to - the extent specified in this Amendment, Section V.2 and V.3. - - V.2. Other Products. - Netscape may include Covered Code in products other than the - Netscape's Branded Code which are released by Netscape - during the two (2) years following the release date of the - Original Code, without such additional products becoming - subject to the terms of this License, and may license such - additional products on different terms from those contained - in this License. - - V.3. Alternative Licensing. - Netscape may license the Source Code of Netscape's Branded - Code, including Modifications incorporated therein, without - such Netscape Branded Code becoming subject to the terms of - this License, and may license such Netscape Branded Code on - different terms from those contained in this License. - - VI. Litigation. - Notwithstanding the limitations of Section 11 above, the - provisions regarding litigation in Section 11(a), (b) and (c) of - the License shall apply to all disputes relating to this License. - - EXHIBIT A-Netscape Public License. - - "The contents of this file are subject to the Netscape Public - License Version 1.1 (the "License"); you may not use this file - except in compliance with the License. You may obtain a copy of - the License at http://www.mozilla.org/NPL/ - - Software distributed under the License is distributed on an "AS - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - implied. See the License for the specific language governing - rights and limitations under the License. - - The Original Code is Mozilla Communicator client code, released - March 31, 1998. - - The Initial Developer of the Original Code is Netscape - Communications Corporation. Portions created by Netscape are - Copyright (C) 1998-1999 Netscape Communications Corporation. All - Rights Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the - terms of the _____ license (the "[___] License"), in which case - the provisions of [______] License are applicable instead of - those above. If you wish to allow use of your version of this - file only under the terms of the [____] License and not to allow - others to use your version of this file under the NPL, indicate - your decision by deleting the provisions above and replace them - with the notice and other provisions required by the [___] - License. If you do not delete the provisions above, a recipient - may use your version of this file under either the NPL or the - [___] License." diff --git a/mozilla/browser/Makefile.in b/mozilla/browser/Makefile.in deleted file mode 100644 index 72445483304..00000000000 --- a/mozilla/browser/Makefile.in +++ /dev/null @@ -1,53 +0,0 @@ -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the Mozilla Browser code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2002 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Brian Ryner -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = .. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -DIRS = base components locales extensions themes app - -ifeq ($(OS_ARCH),WINNT) -ifdef MOZ_INSTALLER -DIRS += installer/windows -endif -endif - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/browser/app/Makefile.in b/mozilla/browser/app/Makefile.in deleted file mode 100644 index 47dcef18bfc..00000000000 --- a/mozilla/browser/app/Makefile.in +++ /dev/null @@ -1,344 +0,0 @@ -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications. -# Portions created by the Initial Developer are Copyright (C) 2001 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Brian Ryner -# Jonathan Wilson -# Dan Mosedale -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MOZILLA_INTERNAL_API = 1 - -DIRS = profile/extensions - -PREF_JS_EXPORTS = $(srcdir)/profile/firefox.js \ - $(srcdir)/profile/channel-prefs.js \ - $(NULL) - -# hardcode en-US for the moment -AB_CD = en-US - -DEFINES += -DAB_CD=$(AB_CD) - -ifeq ($(USE_SHORT_LIBNAME), 1) -PROGRAM = firefox$(BIN_SUFFIX) -else -PROGRAM = firefox-bin$(BIN_SUFFIX) -endif - -REQUIRES = \ - xpcom \ - $(NULL) - -CPPSRCS = nsBrowserApp.cpp - -LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre - -ifdef BUILD_STATIC_LIBS -STATIC_COMPONENTS_LINKER_PATH = -L$(DIST)/lib/components -endif - -ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) -TK_LIBS := -framework Cocoa $(TK_LIBS) -endif - -LIBS = \ - $(STATIC_COMPONENTS_LINKER_PATH) \ - $(EXTRA_DSO_LIBS) \ - $(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \ - $(MOZ_JS_LIBS) \ - $(XPCOM_LIBS) \ - $(NSPR_LIBS) \ - $(TK_LIBS) \ - $(NULL) - -# Add explicit X11 dependency when building against X11 toolkits -ifneq (,$(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT))) -LIBS += $(XLDFLAGS) $(XLIBS) -endif - -ifdef MOZ_JPROF -LIBS += -ljprof -endif - -ifndef MOZ_WINCONSOLE -ifdef MOZ_DEBUG -MOZ_WINCONSOLE = 1 -else -MOZ_WINCONSOLE = 0 -endif -endif - -NSDISTMODE = copy - -include $(topsrcdir)/config/config.mk -ifndef BUILD_STATIC_LIBS - -ifdef NS_TRACE_MALLOC -EXTRA_DSO_LIBS += tracemalloc -endif - -else -include $(topsrcdir)/config/static-config.mk - -EXTRA_DEPS += \ - $(STATIC_EXTRA_DEPS) \ - $(NULL) -DEFINES += $(STATIC_DEFINES) -CPPSRCS += $(STATIC_CPPSRCS) -EXTRA_DSO_LIBS += $(STATIC_EXTRA_DSO_LIBS) -REQUIRES += $(STATIC_REQUIRES) -EXTRA_LIBS += $(STATIC_EXTRA_LIBS) -endif - -ifeq ($(OS_ARCH),WINNT) -OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool gdi32) -RCINCLUDE = splash.rc -ifndef GNU_CC -RCFLAGS += -DMOZ_PHOENIX -I$(srcdir) -else -RCFLAGS += -DMOZ_PHOENIX --include-dir $(srcdir) -endif -ifdef BUILD_STATIC_LIBS -RCFLAGS += -DMOZ_STATIC_BUILD -endif -ifdef DEBUG -RCFLAGS += -DDEBUG -endif -endif - -ifeq ($(OS_ARCH),BeOS) -OS_LIBS += -ltracker -endif - -ifeq ($(OS_ARCH),OS2) -RESFILE=splashos2.res -RCFLAGS += -DMOZ_PHOENIX -ifdef BUILD_STATIC_LIBS -EXE_DEF_FILE = browser.def -RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include/widget -endif -ifdef DEBUG -RCFLAGS += -DDEBUG -endif -RCFLAGS += -DFIREFOX_ICO=\"$(DIST)/branding/firefox.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\" -endif - -include $(topsrcdir)/config/rules.mk - -DEFINES += -DFIREFOX_ICO=\"$(DIST)/branding/firefox.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\" - -ifdef BUILD_STATIC_LIBS -include $(topsrcdir)/config/static-rules.mk -endif - -APP_VERSION = $(shell cat $(srcdir)/../config/version.txt) -DEFINES += -DAPP_VERSION="$(APP_VERSION)" - -ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) -ifdef BUILD_STATIC_LIBS -LIBS += -framework QuickTime -framework IOKit -ifdef USE_PREBINDING -BIN_FLAGS += -Wl,-headerpad -Wl,5a0c -endif -endif -endif - -ifeq ($(MOZ_WIDGET_TOOLKIT),photon) -LIBS += -lphexlib -endif - -ifeq ($(OS_ARCH),WINNT) -# -# Control the default heap size. -# This is the heap returned by GetProcessHeap(). -# As we use the CRT heap, the default size is too large and wastes VM. -# -# The default heap size is 1MB on Win32. -# The heap will grow if need be. -# -# Set it to 256k. See bug 127069. -# -ifndef GNU_CC -LDFLAGS += /HEAP:0x40000 -endif -endif - -$(PROGRAM): $(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) - -ifeq ($(OS_ARCH),OS2) -ifdef BUILD_STATIC_LIBS -$(EXE_DEF_FILE): - rm -f $@ - @echo NAME mozilla >$(EXE_DEF_FILE) - @echo IMPORTS >>$(EXE_DEF_FILE) - @echo WinQueryProperty = PMMERGE.5450 >>$(EXE_DEF_FILE) - @echo WinRemoveProperty = PMMERGE.5451 >>$(EXE_DEF_FILE) - @echo WinSetProperty = PMMERGE.5452 >>$(EXE_DEF_FILE) - -LDFLAGS += -Zlinker /NOE -endif -endif - -ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH))) - -firefox:: mozilla.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk - cat $< | sed -e "s|%MOZAPPDIR%|$(mozappdir)|" \ - -e "s|%MOZ_USER_DIR%|.mozilla/firefox|" \ - -e "s|%MREDIR%|$(mredir)|" > $@ - chmod +x $@ - -libs:: firefox - $(INSTALL) $< $(DIST)/bin - -install:: firefox - $(SYSINSTALL) $< $(DESTDIR)$(bindir) - -GARBAGE += firefox -GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, firefox.js) - -endif - -ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT))) - -ICON_FILES = \ - $(DIST)/branding/mozicon128.png \ - $(DIST)/branding/mozicon50.xpm \ - $(DIST)/branding/mozicon16.xpm \ - $(DIST)/branding/document.png \ - $(NULL) - -libs:: $(ICON_FILES) - $(INSTALL) $^ $(DIST)/bin/icons - -install:: - $(SYSINSTALL) $(IFLAGS1) $(ICON_FILES) $(DESTDIR)$(mozappdir)/icons -endif - -ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) -libs:: - $(INSTALL) $(DIST)/branding/default.xpm $(DIST)/bin/chrome/icons/default - -install:: - $(SYSINSTALL) $(IFLAGS1) $(DIST)/branding/default.xpm $(DESTDIR)$(mozappdir)/icons -endif - -export:: -ifndef MOZ_BRANDING_DIRECTORY - $(NSINSTALL) -D $(DIST)/branding -ifeq ($(OS_ARCH),WINNT) - cp $(srcdir)/firefox.ico $(DIST)/branding/firefox.ico - cp $(srcdir)/firefox.ico $(DIST)/branding/app.ico - cp $(srcdir)/document.ico $(DIST)/branding/document.ico -endif -ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) - cp $(srcdir)/macbuild/firefox.icns $(DIST)/branding/firefox.icns - cp $(srcdir)/macbuild/document.icns $(DIST)/branding/document.icns - cp $(srcdir)/macbuild/dsstore $(DIST)/branding/dsstore - cp $(srcdir)/macbuild/background.png $(DIST)/branding/background.png - cp $(srcdir)/macbuild/disk.icns $(DIST)/branding/disk.icns - cp $(srcdir)/macbuild/license.r $(DIST)/branding/license.r -endif -ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT))) - cp $(srcdir)/mozicon128.png $(DIST)/branding/mozicon128.png - cp $(srcdir)/mozicon16.xpm $(DIST)/branding/mozicon16.xpm - cp $(srcdir)/mozicon50.xpm $(DIST)/branding/mozicon50.xpm - cp $(srcdir)/document.png $(DIST)/branding/document.png -endif -ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) - cp $(srcdir)/default.xpm $(DIST)/branding/default.xpm -endif -ifeq ($(OS_ARCH),OS2) - cp $(srcdir)/firefox-os2.ico $(DIST)/branding/firefox.ico - cp $(srcdir)/firefox-os2.ico $(DIST)/branding/app.ico - cp $(srcdir)/document-os2.ico $(DIST)/branding/document.ico -endif -endif - -libs:: - touch $(DIST)/bin/.autoreg - -ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) - -APP_NAME = $(MOZ_APP_DISPLAYNAME) - -ifdef MOZ_DEBUG -APP_NAME := $(APP_NAME)Debug -endif - -AB_CD = $(MOZ_UI_LOCALE) - -AB := $(firstword $(subst -, ,$(AB_CD))) - -clean clobber repackage:: - rm -rf $(DIST)/$(APP_NAME).app - -libs repackage:: $(PROGRAM) - mkdir -p $(DIST)/$(APP_NAME).app/Contents/MacOS - rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj - mkdir -p $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj - rsync -a --exclude CVS $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj - sed -e "s/APP_VERSION/$(APP_VERSION)/" -e "s/APP_NAME/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist - rsync -a $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/MacOS - rm -f $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS/mangle $(DIST)/$(APP_NAME).app/Contents/MacOS/shlibsign - rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS - mkdir -p $(DIST)/$(APP_NAME).app/Contents/Plug-Ins -# Bug 297227: the next line only exists to repair broken depend builds, it can -# go away once that bug has been closed for a while. - rm -rf $(DIST)/$(APP_NAME).app/Contents/Plug-Ins/PrintPDE.plugin - rsync -a --copy-unsafe-links $(DIST)/package/PrintPDE.plugin $(DIST)/$(APP_NAME).app/Contents/Plug-Ins - -cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(APP_NAME).app/Contents/MacOS - cp -RL $(DIST)/branding/firefox.icns $(DIST)/$(APP_NAME).app/Contents/Resources/firefox.icns - cp -RL $(DIST)/branding/document.icns $(DIST)/$(APP_NAME).app/Contents/Resources/document.icns - cp -RL $(DIST)/package/mozillaSuite.rsrc $(DIST)/$(APP_NAME).app/Contents/Resources/$(PROGRAM).rsrc - echo -n APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo -# remove CVS dirs from packaged app - find $(DIST)/$(APP_NAME).app -type d -name "CVS" -prune -exec rm -rf {} \; - -endif - -libs:: - $(INSTALL) $(topsrcdir)/LICENSE $(DIST)/bin - -libs:: $(srcdir)/profile/prefs.js - $(INSTALL) $^ $(DIST)/bin/defaults/profile - -install:: $(srcdir)/profile/prefs.js - $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/defaults/profile diff --git a/mozilla/browser/app/README.txt b/mozilla/browser/app/README.txt deleted file mode 100644 index 7b8e405c358..00000000000 --- a/mozilla/browser/app/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -For information about installing, running and configuring Firefox -including a list of known issues and troubleshooting information, -refer to: http://getfirefox.com/releases/ - diff --git a/mozilla/browser/app/default.xpm b/mozilla/browser/app/default.xpm deleted file mode 100644 index d240015018d..00000000000 --- a/mozilla/browser/app/default.xpm +++ /dev/null @@ -1,1144 +0,0 @@ -/* XPM */ -static char * mozicon50_xpm[] = { -"48 48 1093 2", -" c None", -". c #2099CF", -"+ c #2CA7D9", -"@ c #33AEDD", -"# c #34B2E1", -"$ c #35B8E5", -"% c #2FBAE8", -"& c #26B5E4", -"* c #199FD6", -"= c #177DB8", -"- c #2C8FC4", -"; c #43A0CE", -"> c #55ADD6", -", c #5CB5DD", -"' c #61C4E8", -") c #63CBED", -"! c #64CFF1", -"~ c #63D1F2", -"{ c #5ECCEF", -"] c #57C3E9", -"^ c #4EB8E1", -"/ c #3CABD9", -"( c #2A9ED1", -"_ c #1991C9", -": c #0F7CBA", -"< c #166EAC", -"[ c #3387BC", -"} c #4797C6", -"| c #51A0CC", -"1 c #56A7D2", -"2 c #5BAED7", -"3 c #60B6DD", -"4 c #67CDEE", -"5 c #69D3F2", -"6 c #6BD4F4", -"7 c #69D3F4", -"8 c #63CDEF", -"9 c #5AC0E6", -"0 c #51B6DF", -"a c #49ACD8", -"b c #42A2D1", -"c c #3898CA", -"d c #298CC2", -"e c #167EB9", -"f c #0B5A9C", -"g c #2674AE", -"h c #3D87BA", -"i c #4590C0", -"j c #4B97C6", -"k c #519FCB", -"l c #58A6D1", -"m c #5DADD5", -"n c #62B3DA", -"o c #69C3E6", -"p c #6ED4F2", -"q c #6FD6F4", -"r c #6ED5F4", -"s c #6AD3F2", -"t c #5FC3E7", -"u c #53B2DC", -"v c #4BA8D5", -"w c #439FCE", -"x c #3B95C7", -"y c #338BC0", -"z c #2B82B9", -"A c #1D76B1", -"B c #0C69A9", -"C c #10599A", -"D c #2D71AA", -"E c #377CB2", -"F c #3D84B8", -"G c #458DBE", -"H c #4B95C4", -"I c #529CC9", -"J c #59A4CF", -"K c #5FABD4", -"L c #65B1D8", -"M c #6BC2E4", -"N c #71D5F3", -"O c #73D6F3", -"P c #72D5F3", -"Q c #6DD1F0", -"R c #5FBBE2", -"S c #54ADD8", -"T c #4CA4D2", -"U c #439ACB", -"V c #3B91C4", -"W c #3487BD", -"X c #2D7EB7", -"Y c #2675AF", -"Z c #1E6CA9", -"` c #0F5FA0", -" . c #055296", -".. c #115394", -"+. c #2767A2", -"@. c #2F70A9", -"#. c #3679AF", -"$. c #3C81B5", -"%. c #448ABC", -"&. c #4A92C2", -"*. c #519AC7", -"=. c #58A2CD", -"-. c #5FA9D2", -";. c #65B0D7", -">. c #6EC8E9", -",. c #74D4F2", -"'. c #76D6F3", -"). c #75D6F3", -"!. c #71D3F1", -"~. c #62BCE1", -"{. c #54A9D5", -"]. c #4C9FCE", -"^. c #4396C8", -"/. c #3B8CC1", -"(. c #3483BA", -"_. c #2C7AB3", -":. c #2670AC", -"<. c #1F68A6", -"[. c #195F9F", -"}. c #0D5497", -"|. c #04488D", -"1. c #0F4A8D", -"2. c #1F5A98", -"3. c #2663A0", -"4. c #2D6DA6", -"5. c #3475AD", -"6. c #3B7EB3", -"7. c #4287B9", -"8. c #4990C1", -"9. c #51A4CF", -"0. c #569FCA", -"a. c #5DA6CF", -"b. c #66B5DB", -"c. c #6FD1F0", -"d. c #75D4F1", -"e. c #79D5F2", -"f. c #75D3F1", -"g. c #63BBE0", -"h. c #54A4D1", -"i. c #4B9BCB", -"j. c #4391C4", -"k. c #3B88BD", -"l. c #337FB6", -"m. c #2C76B0", -"n. c #266CA9", -"o. c #1F64A3", -"p. c #1A5B9C", -"q. c #145396", -"r. c #0A498E", -"s. c #034C8F", -"t. c #085293", -"u. c #164D8E", -"v. c #1D5695", -"w. c #24609C", -"x. c #2A69A3", -"y. c #3271AA", -"z. c #387AAF", -"A. c #429FCC", -"B. c #4CBFE4", -"C. c #52C4E8", -"D. c #57AFD7", -"E. c #5DB3DA", -"F. c #65C5E7", -"G. c #6DD0EE", -"H. c #72D2EF", -"I. c #78D4F0", -"J. c #7BD5F1", -"K. c #76D2EF", -"L. c #6AC5E6", -"M. c #55A5D1", -"N. c #4A95C6", -"O. c #428CC0", -"P. c #3A83B9", -"Q. c #337AB3", -"R. c #2C71AD", -"S. c #2568A6", -"T. c #1F5F9F", -"U. c #1D65A3", -"V. c #269ACA", -"W. c #1C84BA", -"X. c #0D7DB5", -"Y. c #0298CC", -"Z. c #0296CA", -"`. c #0C5998", -" + c #14498A", -".+ c #1B609C", -"++ c #2498C8", -"@+ c #2977AF", -"#+ c #2F75AC", -"$+ c #3575AC", -"%+ c #40ABD5", -"&+ c #49BFE4", -"*+ c #50C3E7", -"=+ c #56C5E8", -"-+ c #5DC8EA", -";+ c #63CBEB", -">+ c #69CEED", -",+ c #6ED0EE", -"'+ c #73D2EF", -")+ c #77D3EF", -"!+ c #72CEEC", -"~+ c #5AA7D1", -"{+ c #4F99C9", -"]+ c #4891C3", -"^+ c #4087BC", -"/+ c #387EB5", -"(+ c #3277B1", -"_+ c #2B70AB", -":+ c #2463A2", -"<+ c #1E5B9C", -"[+ c #185395", -"}+ c #165496", -"|+ c #10498D", -"1+ c #105F9E", -"2+ c #0A9ECF", -"3+ c #0088C0", -"4+ c #038DC3", -"5+ c #0A4A8C", -"6+ c #114E8E", -"7+ c #1989BD", -"8+ c #22AAD7", -"9+ c #28A2D0", -"0+ c #2C71A9", -"a+ c #3380B5", -"b+ c #3EB9E1", -"c+ c #45BDE3", -"d+ c #4CC0E5", -"e+ c #53C3E7", -"f+ c #59C6E8", -"g+ c #5EC9EA", -"h+ c #64CBEB", -"i+ c #69CDEC", -"j+ c #6ECFED", -"k+ c #70D0ED", -"l+ c #64BDE1", -"m+ c #55A6D1", -"n+ c #3D82B8", -"o+ c #3D8BBE", -"p+ c #49AFD8", -"q+ c #378DBF", -"r+ c #225F9E", -"s+ c #1D5698", -"t+ c #174E92", -"u+ c #12468B", -"v+ c #0E3F85", -"w+ c #115F9D", -"x+ c #15A2D1", -"y+ c #0395C9", -"z+ c #0088C1", -"A+ c #0190C6", -"B+ c #079ACC", -"C+ c #0FA0D0", -"D+ c #169ECF", -"E+ c #1D99CC", -"F+ c #25AAD7", -"G+ c #2BA0CE", -"H+ c #32AED8", -"I+ c #3AB7DF", -"J+ c #41BBE1", -"K+ c #47BEE3", -"L+ c #4EC1E5", -"M+ c #53C4E7", -"N+ c #5FC8E9", -"O+ c #63CAEA", -"P+ c #67CBEB", -"Q+ c #69CBEA", -"R+ c #62BCE0", -"S+ c #5AAFD7", -"T+ c #478DBF", -"U+ c #4084B9", -"V+ c #3A7CB4", -"W+ c #3E8CBF", -"X+ c #4DBADF", -"Y+ c #3383B8", -"Z+ c #215B9B", -"`+ c #1B5295", -" @ c #164A8E", -".@ c #114288", -"+@ c #0D3A82", -"@@ c #0E4C8E", -"#@ c #1380B7", -"$@ c #0D96C9", -"%@ c #0089C1", -"&@ c #007BB8", -"*@ c #0085BE", -"=@ c #008CC4", -"-@ c #0496C9", -";@ c #0B9DCF", -">@ c #1168AB", -",@ c #174F99", -"'@ c #21AAD7", -")@ c #28AED9", -"!@ c #2FB1DB", -"~@ c #36B5DE", -"{@ c #3CB8E0", -"]@ c #42BBE2", -"^@ c #49BEE4", -"/@ c #54C3E6", -"(@ c #59C5E7", -"_@ c #5DC7E8", -":@ c #5FC5E7", -"<@ c #53A9D3", -"[@ c #4B96C6", -"}@ c #478FC2", -"|@ c #4186BB", -"1@ c #3C7FB5", -"2@ c #3676AF", -"3@ c #306EA9", -"4@ c #3889BD", -"5@ c #44AFD8", -"6@ c #2F84B9", -"7@ c #194D91", -"8@ c #15458A", -"9@ c #144D90", -"0@ c #0C367E", -"a@ c #0C4086", -"b@ c #1797C8", -"c@ c #1295C8", -"d@ c #0487C0", -"e@ c #0079B6", -"f@ c #0081BC", -"g@ c #0E9ACC", -"h@ c #1597CA", -"i@ c #1CA7D5", -"j@ c #23ABD8", -"k@ c #2AAFDA", -"l@ c #31B2DC", -"m@ c #37B5DE", -"n@ c #3DB8E0", -"o@ c #43BBE2", -"p@ c #49BEE3", -"q@ c #4EC0E4", -"r@ c #53C2E5", -"s@ c #57C4E6", -"t@ c #4EAAD4", -"u@ c #4696C5", -"v@ c #438FC0", -"w@ c #4088BC", -"x@ c #3C80B6", -"y@ c #3778B1", -"z@ c #3270AB", -"A@ c #2C68A5", -"B@ c #3D9AC8", -"C@ c #46BADF", -"D@ c #3DB0D8", -"E@ c #287CB2", -"F@ c #164D90", -"G@ c #299ECC", -"H@ c #1B79B0", -"I@ c #1A8CBF", -"J@ c #199BCC", -"K@ c #1392C6", -"L@ c #0A86BE", -"M@ c #0079B7", -"N@ c #006AAC", -"O@ c #0074B3", -"P@ c #007CB9", -"Q@ c #0083BE", -"R@ c #008BC2", -"S@ c #0393C8", -"T@ c #099CCD", -"U@ c #10A1D1", -"V@ c #17A4D3", -"W@ c #1EA8D6", -"X@ c #25ABD8", -"Y@ c #2BAFDA", -"Z@ c #37B5DD", -"`@ c #3DB8DF", -" # c #42BAE1", -".# c #48BCE2", -"+# c #4CBEE3", -"@# c #50C0E4", -"## c #48A8D3", -"$# c #3F8EC0", -"%# c #3C87BC", -"&# c #3A81B7", -"*# c #3679B1", -"=# c #3171AC", -"-# c #2D6AA6", -";# c #2862A0", -"># c #40A5D1", -",# c #43B8DE", -"'# c #3DB5DC", -")# c #38B1DA", -"!# c #2D9ECC", -"~# c #2B9FCE", -"{# c #246AAA", -"]# c #1F96C7", -"^# c #1996C9", -"/# c #138DC3", -"(# c #0E84BC", -"_# c #0175B4", -":# c #0068AC", -"<# c #0070B1", -"[# c #0077B5", -"}# c #007FBA", -"|# c #0086BF", -"1# c #018DC4", -"2# c #0596C9", -"3# c #0B9DCE", -"4# c #12A1D1", -"5# c #1897C8", -"6# c #1E96C7", -"7# c #25A0CE", -"8# c #2B90C2", -"9# c #31A4D0", -"0# c #37B4DD", -"a# c #3CB7DF", -"b# c #41B9E0", -"c# c #45BBE0", -"d# c #49BCE1", -"e# c #4BBBE0", -"f# c #419FCC", -"g# c #3C91C2", -"h# c #337AB1", -"i# c #3072AC", -"j# c #2C6BA7", -"k# c #2864A1", -"l# c #255F9E", -"m# c #3FAAD4", -"n# c #40B6DC", -"o# c #3AB3DB", -"p# c #35B0D8", -"q# c #2F86BD", -"r# c #29599F", -"s# c #237DB7", -"t# c #1E99CA", -"u# c #1892C5", -"v# c #1389C0", -"w# c #0E7FBA", -"x# c #0473B2", -"y# c #0065AA", -"z# c #0064A9", -"A# c #006BAD", -"B# c #0072B2", -"C# c #0080BC", -"D# c #0082BC", -"E# c #028DC4", -"F# c #0796C9", -"G# c #0D88BD", -"H# c #1372AB", -"I# c #1982B8", -"J# c #1F79B0", -"K# c #247BB1", -"L# c #2A86B9", -"M# c #31B1DA", -"N# c #36B3DC", -"O# c #3AB5DD", -"P# c #3FB7DE", -"Q# c #42B9DF", -"R# c #45BAE0", -"S# c #48BBE0", -"T# c #47B6DD", -"U# c #3689BC", -"V# c #2D72AB", -"W# c #2C73AC", -"X# c #2F7DB3", -"Y# c #399BC9", -"Z# c #3FB4DB", -"`# c #3CB3DA", -" $ c #37B0D9", -".$ c #32AED7", -"+$ c #2CA8D3", -"@$ c #277EB8", -"#$ c #229CCC", -"$$ c #1D95C8", -"%$ c #188DC2", -"&$ c #1384BD", -"*$ c #0D7AB6", -"=$ c #066FB0", -"-$ c #0057A0", -";$ c #005FA5", -">$ c #0066AA", -",$ c #006DAF", -"'$ c #006EAC", -")$ c #004C8E", -"!$ c #005595", -"~$ c #025999", -"{$ c #085D9B", -"]$ c #0D64A0", -"^$ c #1369A4", -"/$ c #196EA7", -"($ c #1E73AA", -"_$ c #2376AD", -":$ c #2AA0CE", -"<$ c #2FAFD9", -"[$ c #34B1DB", -"}$ c #38B3DC", -"|$ c #3BB5DC", -"1$ c #3EB6DD", -"2$ c #40B7DD", -"3$ c #42B7DD", -"4$ c #43B7DE", -"5$ c #43B7DD", -"6$ c #40B5DC", -"7$ c #3DB4DB", -"8$ c #3AB2DA", -"9$ c #33AED6", -"0$ c #2EABD5", -"a$ c #29A5D2", -"b$ c #259ECD", -"c$ c #2094C6", -"d$ c #1C8DC2", -"e$ c #1787BE", -"f$ c #127EB9", -"g$ c #0D75B3", -"h$ c #076AAC", -"i$ c #005FA6", -"j$ c #00539D", -"k$ c #005AA2", -"l$ c #0060A6", -"m$ c #0068AB", -"n$ c #0063A5", -"o$ c #004487", -"p$ c #004386", -"q$ c #004789", -"r$ c #004B8D", -"s$ c #045192", -"t$ c #095997", -"u$ c #0E5F9C", -"v$ c #1365A0", -"w$ c #1869A4", -"x$ c #1D6EA7", -"y$ c #2274AB", -"z$ c #28A6D2", -"A$ c #2DAED8", -"B$ c #31AFD9", -"C$ c #34B1DA", -"D$ c #37B2DB", -"E$ c #39B3DB", -"F$ c #3BB4DB", -"G$ c #3CB4DB", -"H$ c #3BB3DA", -"I$ c #38B1D9", -"J$ c #35AFD8", -"K$ c #32ADD6", -"L$ c #2EAAD4", -"M$ c #2BA5D1", -"N$ c #2795C5", -"O$ c #2374AA", -"P$ c #1E5691", -"Q$ c #1A4C89", -"R$ c #156AA5", -"S$ c #1078B5", -"T$ c #0B6FAF", -"U$ c #0665A9", -"V$ c #004A97", -"W$ c #004D9A", -"X$ c #00509A", -"Y$ c #00579F", -"Z$ c #0062A7", -"`$ c #00468A", -" % c #00387C", -".% c #003C7F", -"+% c #004083", -"@% c #044D8E", -"#% c #095493", -"$% c #0E5A98", -"%% c #13609C", -"&% c #18659F", -"*% c #1C6BA4", -"=% c #219FCD", -"-% c #25AAD5", -";% c #29ABD6", -">% c #2DADD7", -",% c #30AED8", -"'% c #32AFD8", -")% c #34B0D8", -"!% c #34AED7", -"~% c #30ABD4", -"{% c #2DA8D2", -"]% c #2BA3CF", -"^% c #289DCC", -"/% c #2494C5", -"(% c #20659E", -"_% c #1C4684", -":% c #183D7C", -"<% c #133B7A", -"[% c #0F5695", -"}% c #0A5FA1", -"|% c #055FA5", -"1% c #00559F", -"2% c #004D99", -"3% c #004896", -"4% c #002E74", -"5% c #003C82", -"6% c #004E94", -"7% c #003377", -"8% c #003175", -"9% c #003578", -"0% c #003B7F", -"a% c #003F82", -"b% c #014285", -"c% c #044889", -"d% c #094E8E", -"e% c #0D5493", -"f% c #125997", -"g% c #167FB4", -"h% c #1A96C7", -"i% c #1EA5D2", -"j% c #22A7D3", -"k% c #25A9D4", -"l% c #28AAD5", -"m% c #2AAAD5", -"n% c #2CABD6", -"o% c #2DACD6", -"p% c #2EACD5", -"q% c #2DA9D3", -"r% c #2CA6D1", -"s% c #299FCD", -"t% c #279ACA", -"u% c #2495C7", -"v% c #218FC3", -"w% c #1D86BC", -"x% c #1A4683", -"y% c #163574", -"z% c #112C6C", -"A% c #0D2464", -"B% c #082D6F", -"C% c #044E94", -"D% c #004F9A", -"E% c #004292", -"F% c #00347D", -"G% c #002266", -"H% c #002669", -"I% c #00286C", -"J% c #002B6F", -"K% c #002E72", -"L% c #003478", -"M% c #00377B", -"N% c #003A7E", -"O% c #013D80", -"P% c #044285", -"Q% c #084889", -"R% c #0D4D8D", -"S% c #115492", -"T% c #15609B", -"U% c #189ACB", -"V% c #1CA0CF", -"W% c #1FA2CF", -"X% c #21A3D1", -"Y% c #24A4D1", -"Z% c #25A5D1", -"`% c #27A4D1", -" & c #28A4D1", -".& c #28A0CE", -"+& c #289ECC", -"@& c #2596C8", -"#& c #2392C5", -"$& c #208DC2", -"%& c #1D87BD", -"&& c #1A75AE", -"*& c #173978", -"=& c #132E6D", -"-& c #0F2565", -";& c #0B1D5D", -">& c #071555", -",& c #021151", -"'& c #001F61", -")& c #00276D", -"!& c #003D8E", -"~& c #003B89", -"{& c #001E62", -"]& c #002063", -"^& c #002569", -"/& c #002D72", -"(& c #003074", -"_& c #003579", -":& c #033C7F", -"<& c #074183", -"[& c #0B4787", -"}& c #0F5392", -"|& c #1391C5", -"1& c #1695C8", -"2& c #1998CA", -"3& c #1C99CA", -"4& c #1E9ACB", -"5& c #209BCB", -"6& c #219BCB", -"7& c #229ACA", -"8& c #2399C9", -"9& c #2397C8", -"0& c #2394C6", -"a& c #2291C4", -"b& c #1E89C0", -"c& c #1C84BC", -"d& c #1A5B97", -"e& c #174C89", -"f& c #142D6C", -"g& c #102665", -"h& c #0C1E5D", -"i& c #081756", -"j& c #040F4F", -"k& c #000847", -"l& c #000541", -"m& c #00033D", -"n& c #00368A", -"o& c #00256E", -"p& c #00185A", -"q& c #001A5D", -"r& c #001D60", -"s& c #001F63", -"t& c #002568", -"u& c #00276B", -"v& c #00296D", -"w& c #002B70", -"x& c #003276", -"y& c #023579", -"z& c #063A7D", -"A& c #0A5997", -"B& c #0D87BF", -"C& c #108AC1", -"D& c #138CC3", -"E& c #168EC4", -"F& c #188FC4", -"G& c #1A90C4", -"H& c #1C90C4", -"I& c #1D8FC4", -"J& c #1D8EC3", -"K& c #1D8CC2", -"L& c #1D8AC0", -"M& c #1C87BE", -"N& c #1B83BC", -"O& c #1A7FB9", -"P& c #1864A0", -"Q& c #164987", -"R& c #132C6A", -"S& c #102564", -"T& c #0D1E5D", -"U& c #091756", -"V& c #06104E", -"W& c #020947", -"X& c #000441", -"Y& c #00023C", -"Z& c #000038", -"`& c #003086", -" * c #001A5E", -".* c #001354", -"+* c #001658", -"@* c #001D5F", -"#* c #001F62", -"$* c #002164", -"%* c #002367", -"&* c #002D71", -"** c #014C8E", -"=* c #0474B2", -"-* c #077CB9", -";* c #0B80BA", -">* c #0E82BB", -",* c #1083BC", -"'* c #1285BD", -")* c #1485BE", -"!* c #1686BD", -"~* c #1785BD", -"{* c #1884BC", -"]* c #1882BB", -"^* c #1880B9", -"/* c #187DB7", -"(* c #177AB6", -"_* c #1571AF", -":* c #143676", -"<* c #122968", -"[* c #0F2362", -"}* c #0D1D5C", -"|* c #0A1755", -"1* c #030A47", -"2* c #000239", -"3* c #002A82", -"4* c #00175D", -"5* c #00104F", -"6* c #001252", -"7* c #001454", -"8* c #001657", -"9* c #00195C", -"0* c #001C5E", -"a* c #001D61", -"b* c #002165", -"c* c #002366", -"d* c #002468", -"e* c #006CAE", -"f* c #006FB0", -"g* c #0271B1", -"h* c #0574B3", -"i* c #0877B4", -"j* c #0B78B5", -"k* c #0F7AB6", -"l* c #107AB7", -"m* c #127AB6", -"n* c #1279B5", -"o* c #1377B4", -"p* c #1375B3", -"q* c #1372B1", -"r* c #126FAF", -"s* c #115797", -"t* c #0F2766", -"u* c #0D2160", -"v* c #0B1B5A", -"w* c #091554", -"x* c #06104D", -"y* c #030A46", -"z* c #000540", -"A* c #000036", -"B* c #00237E", -"C* c #002980", -"D* c #002372", -"E* c #001A60", -"F* c #001659", -"G* c #001358", -"H* c #001A5F", -"I* c #002064", -"J* c #001B5E", -"K* c #005397", -"L* c #0065A9", -"M* c #0067AB", -"N* c #0069AC", -"O* c #026AAD", -"P* c #046CAE", -"Q* c #0768AB", -"R* c #0965A9", -"S* c #0A6EAF", -"T* c #0C6EAE", -"U* c #0D6DAE", -"V* c #0D6CAD", -"W* c #0D6AAB", -"X* c #0D67AA", -"Y* c #0D64A7", -"Z* c #0C498C", -"`* c #0A1E5E", -" = c #091856", -".= c #071350", -"+= c #050D4B", -"@= c #020844", -"#= c #00043F", -"$= c #00023B", -"%= c #000037", -"&= c #000035", -"*= c #000034", -"== c #001A77", -"-= c #00237D", -";= c #002881", -">= c #002D84", -",= c #00287F", -"'= c #000B6C", -")= c #00388A", -"!= c #003785", -"~= c #001556", -"{= c #001759", -"]= c #00195B", -"^= c #001C5F", -"/= c #001C60", -"(= c #004B91", -"_= c #004287", -":= c #00569C", -"<= c #0061A7", -"[= c #023187", -"}= c #033388", -"|= c #0563A7", -"1= c #0662A7", -"2= c #0762A7", -"3= c #0860A6", -"4= c #085EA4", -"5= c #085CA3", -"6= c #084388", -"7= c #071B5B", -"8= c #061453", -"9= c #04104D", -"0= c #030B48", -"a= c #010742", -"b= c #00033E", -"c= c #00013A", -"d= c #000033", -"e= c #000032", -"f= c #001C79", -"g= c #00217C", -"h= c #002780", -"i= c #002B83", -"j= c #003589", -"k= c #001D63", -"l= c #000F4F", -"m= c #000F4E", -"n= c #001050", -"o= c #001152", -"p= c #001353", -"q= c #001455", -"r= c #002F74", -"s= c #00529A", -"t= c #0058A1", -"u= c #00529D", -"v= c #0156A0", -"w= c #02569F", -"x= c #02549E", -"y= c #03529D", -"z= c #034F9A", -"A= c #032062", -"B= c #020F4E", -"C= c #010C49", -"D= c #000845", -"E= c #00033C", -"F= c #000138", -"G= c #000135", -"H= c #001474", -"I= c #001F7B", -"J= c #00247E", -"K= c #002D83", -"L= c #001051", -"M= c #000A46", -"N= c #000B48", -"O= c #000C4A", -"P= c #000D4B", -"Q= c #000E4D", -"R= c #001151", -"S= c #001253", -"T= c #00377E", -"U= c #004E9A", -"V= c #004C98", -"W= c #00408C", -"X= c #000946", -"Y= c #00053F", -"Z= c #000137", -"`= c #000031", -" - c #000030", -".- c #001373", -"+- c #001876", -"@- c #001D79", -"#- c #00267F", -"$- c #000D4D", -"%- c #000741", -"&- c #000843", -"*- c #000945", -"=- c #000A47", -"-- c #000B49", -";- c #000D4C", -">- c #002F77", -",- c #00327A", -"'- c #002267", -")- c #002166", -"!- c #00256A", -"~- c #003D89", -"{- c #004393", -"]- c #003F90", -"^- c #003C8D", -"/- c #003382", -"(- c #003587", -"_- c #002069", -":- c #00033A", -"<- c #000136", -"[- c #00002F", -"}- c #000C6E", -"|- c #001171", -"1- c #001574", -"2- c #001E7A", -"3- c #00196A", -"4- c #00053E", -"5- c #000640", -"6- c #000742", -"7- c #00185B", -"8- c #003787", -"9- c #00398C", -"0- c #00378B", -"a- c #003388", -"b- c #002779", -"c- c #00063F", -"d- c #00002D", -"e- c #00096C", -"f- c #000D6F", -"g- c #001271", -"h- c #001675", -"i- c #001872", -"j- c #000338", -"k- c #00043A", -"l- c #00043B", -"m- c #00053D", -"n- c #000844", -"o- c #000944", -"p- c #002573", -"q- c #002E85", -"r- c #002C83", -"s- c #001E71", -"t- c #00002E", -"u- c #00002C", -"v- c #000266", -"w- c #00066A", -"x- c #000A6D", -"y- c #000E70", -"z- c #000C58", -"A- c #000643", -"B- c #000337", -"C- c #000236", -"D- c #000339", -"E- c #00053C", -"F- c #00063E", -"G- c #00073F", -"H- c #00145A", -"I- c #001C78", -"J- c #000743", -"K- c #00002A", -"L- c #00005F", -"M- c #000267", -"N- c #000A6C", -"O- c #000952", -"P- c #000131", -"Q- c #000132", -"R- c #000133", -"S- c #000134", -"T- c #000235", -"U- c #00196E", -"V- c #001D7A", -"W- c #001B78", -"X- c #001977", -"Y- c #001775", -"Z- c #001473", -"`- c #000E66", -" ; c #00002B", -".; c #000029", -"+; c #000053", -"@; c #00005E", -"#; c #000265", -"$; c #000464", -"%; c #000130", -"&; c #001160", -"*; c #001164", -"=; c #001674", -"-; c #001272", -";; c #001071", -">; c #000E6F", -",; c #000B6E", -"'; c #00086C", -"); c #00045F", -"!; c #000152", -"~; c #000046", -"{; c #000051", -"]; c #00005A", -"^; c #00012F", -"/; c #000542", -"(; c #00106E", -"_; c #001070", -":; c #000F70", -"<; c #00086B", -"[; c #000367", -"}; c #000163", -"|; c #00005B", -"1; c #000052", -"2; c #000047", -"3; c #000041", -"4; c #000028", -"5; c #000021", -"6; c #000025", -"7; c #00003E", -"8; c #00003A", -"9; c #00075A", -"0; c #00076B", -"a; c #000569", -"b; c #000368", -"c; c #000162", -"d; c #00005C", -"e; c #000054", -"f; c #00004C", -"g; c #000042", -"h; c #000039", -"i; c #000026", -"j; c #000023", -"k; c #000017", -"l; c #00001C", -"m; c #00004D", -"n; c #000055", -"o; c #000027", -"p; c #00003D", -"q; c #000058", -"r; c #00004E", -"s; c #000048", -"t; c #000019", -"u; c #000012", -"v; c #00001D", -"w; c #00001F", -"x; c #000044", -"y; c #000008", -"z; c #000018", -"A; c #000024", -"B; c #000015", -"C; c #000022", -"D; c #00000F", -"E; c #000004", -"F; c #000007", -"G; c #000009", -"H; c #00000C", -"I; c #00000D", -"J; c #00000E", -"K; c #00000A", -"L; c #000003", -"M; c #000000", -"N; c #000001", -"O; c #000005", -"P; c #00000B", -" ", -" ", -" . + @ # $ % & * ", -" = - ; > , ' ) ! ~ { ] ^ / ( _ : ", -" < [ } | 1 2 3 4 5 6 7 8 9 0 a b c d e ", -" f g h i j k l m n o p q r s t u v w x y z A B ", -" C D E F G H I J K L M N O P Q R S T U V W X Y Z ` . ", -" ..+.@.#.$.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|. ", -" 1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s. ", -" t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y. ", -" Z.`. +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+ ", -" 3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+k+l+m+]+n+o+p+q+r+s+t+u+v+w+x+y+ ", -" z+A+B+C+D+E+F+G+H+I+J+K+L+M+f+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@ ", -" &@*@=@-@;@>@,@'@)@!@~@{@]@^@L+/@(@_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@b@c@d@ ", -" e@f@z+A+B+g@h@i@j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@L@M@ ", -" N@O@P@Q@R@S@T@U@V@W@X@Y@l@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#_# ", -" :#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y# ", -" z#A#B#M@C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$z# ", -" -$;$>$,$O@'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$2$3$4$5$3$6$7$8$ $9$0$a$b$c$d$e$f$g$h$i$ ", -" j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$F$G$G$H$8$I$J$K$L$M$N$O$P$Q$R$S$T$U$k$V$ ", -" W$X$Y$Z$`$ %.%+%p$q$@%#%$%%%&%*%=%-%;%>%,%'%)%p#p#J$!%K$~%{%]%^%/%(%_%:%<%[%}%|%1%2% ", -" 3%4%5%6%7%8%9% %0%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%0$q%r%]%s%t%u%v%w%x%y%z%A%B%C%D%3% ", -" E%F%G%H%I%J%K%8%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% &9+.&+&V.@&#&$&%&&&*&=&-&;&>&,&'&)& ", -" !&~&{&]&G%^&I%J%/&(&7%_& %:&<&[&}&|&1&2&3&4&5&6&7&8&9&0&a&$&b&c&d&e&f&g&h&i&j&k&l&m& ", -" n&o&p&q&r&s&G%t&u&v&w&K%(&x&y&z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z& ", -" `& *.*+*p&q&@*#*$*%*^&u&v&J%&***=*-*;*>*,*'*)*!*~*{*]*^*/*(*_*:*<*[*}*|*V&1*l&Y&Z&2* ", -" 3*4*5*6*7*8*p&9*0*a*s&b*c*d*v&e*f*g*h*i*j**$k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*Y&Z&A*z* ", -" B*C*D*E*F*G*H*I*+*p&9*J*r&{&x&K*L*M*N*O*P*Q*R*S*T*U*V*W*X*Y*Z*`* =.=+=@=#=$=%=&=*= ", -" ==-=;=>=,='=)=!=J*.*~=+*{=]=^=/=(=_=:=l$<=[=}=|=1=2=3=4=5=6=7=8=9=0=a=b=c=%=&=d=e= ", -" f=g=h=i=3*j=k=l=m=n=o=p=q=~=8*r=^=b*s=t=j$u=-$v=w=x=y=z=A=B=C=D=z*E=F=A*&=d=e=G= ", -" H===I=J=;=K=L=M=N=O=P=Q=l=n=R=6*S=.*T=D%D%D%U=2%V=V$3%W=J*L=X=Y=$=Z=&=*=e=`= - ", -" .-+-@-g=#-$-%-&-*-M==---O=P=;-Q=m=>-,-'-)-!-~-{-E%]-^-/-(-_-:-<-*=d=e=`=[-[- ", -" }-|-1-==2-3-4-4-5-%-6-&-*-X==-=-N=q&;-O=O=O=7-8-9-0-j=a-`&b-c-d=e=`= -[-d-$= ", -" e-f-g-h-i-4-j-k-l-m-4-c-5-%-6-6-&-&-n-o-o-*-M=p-q-r-3*h=s-X=`= -[-t-u-u- ", -" v-w-x-y-g-z-A-B-C-j-D-:-l-l-E-m-4-F-F-c-c-c-G-H-#-J=g=I=I-J-t-t-d-u-K- ", -" L-M-w-N-f-O-P-Q-R-S-T-C-C-B-j-D-D-:-k-l-k-D=U-V-W-X-Y-Z-`-[- ; ;.;u- ", -" +;@;#;$; ;u-d-t-[- -%;P-Q-R-R-S-B-z*&;*;Y-=;H=-;;;>;,;';);!;%=d- ", -" ~;{;];u-.;K- ; ;u-d-d-d-t-t-^;/;(;_;;;:;f-}-x-<;w-[;};|;1;2; ", -" A*%=3;4;5;6;u-7;8;u-K- ; ; ; ;^;9;<;0;w-a;b;v-c;d;e;f;g;h; ", -" i;j;k;l;d=m;1;n;d= ;i;o;o;o;o;p;@;d;q;+;r;s;3;h;`=K- ", -" t;u;k;o;e=Z&%=5;*=l;v;v;v;w; ;x;3;p;Z&d=d-i;w; ", -" y;u;z;v;5;A;A;B;u;u;u;j; ;.;i;C;v;z;u;D; ", -" E;E;F;G;H;I;I;I;H;D;J;H;K;F;E;K; ", -" y;L;M;M;N;N;M;N;O;P; ", -" ", -" ", -" ", -" "}; diff --git a/mozilla/browser/app/document-os2.ico b/mozilla/browser/app/document-os2.ico deleted file mode 100644 index 214e92cef45..00000000000 Binary files a/mozilla/browser/app/document-os2.ico and /dev/null differ diff --git a/mozilla/browser/app/document.ico b/mozilla/browser/app/document.ico deleted file mode 100644 index 31111632477..00000000000 Binary files a/mozilla/browser/app/document.ico and /dev/null differ diff --git a/mozilla/browser/app/document.png b/mozilla/browser/app/document.png deleted file mode 100644 index be4a022e668..00000000000 Binary files a/mozilla/browser/app/document.png and /dev/null differ diff --git a/mozilla/browser/app/firefox-os2.ico b/mozilla/browser/app/firefox-os2.ico deleted file mode 100644 index 560d198b326..00000000000 Binary files a/mozilla/browser/app/firefox-os2.ico and /dev/null differ diff --git a/mozilla/browser/app/firefox.exe.manifest b/mozilla/browser/app/firefox.exe.manifest deleted file mode 100644 index e85268abea4..00000000000 --- a/mozilla/browser/app/firefox.exe.manifest +++ /dev/null @@ -1,22 +0,0 @@ - - - -Firefox - - - - - - diff --git a/mozilla/browser/app/firefox.ico b/mozilla/browser/app/firefox.ico deleted file mode 100644 index 0518438a040..00000000000 Binary files a/mozilla/browser/app/firefox.ico and /dev/null differ diff --git a/mozilla/browser/app/macbuild/Contents/Info.plist.in b/mozilla/browser/app/macbuild/Contents/Info.plist.in deleted file mode 100644 index 86af0792b2d..00000000000 --- a/mozilla/browser/app/macbuild/Contents/Info.plist.in +++ /dev/null @@ -1,144 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - html - htm - shtml - xht - xhtml - - CFBundleTypeIconFile - document.icns - CFBundleTypeName - HTML Document - CFBundleTypeOSTypes - - HTML - - CFBundleTypeRole - Viewer - - - CFBundleTypeExtensions - - text - txt - js - log - css - xul - rdf - - CFBundleTypeIconFile - document.icns - CFBundleTypeName - Text Document - CFBundleTypeOSTypes - - TEXT - utxt - - CFBundleTypeRole - Viewer - - - CFBundleTypeExtensions - - jpeg - jpg - png - gif - - CFBundleTypeIconFile - fileBookmark.icns - CFBundleTypeName - document.icns - CFBundleTypeOSTypes - - GIFf - JPEG - PNGf - - CFBundleTypeRole - Viewer - - - CFBundleExecutable - firefox-bin - CFBundleGetInfoString - Firefox APP_VERSION, © 1998-2006 Contributors - CFBundleIconFile - firefox - CFBundleIdentifier - org.mozilla.firefox - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - APP_NAME - CFBundlePackageType - APPL - CFBundleShortVersionString - APP_VERSION - CFBundleSignature - MOZB - CFBundleURLTypes - - - CFBundleURLIconFile - document.icns - CFBundleURLName - http URL - CFBundleURLSchemes - - http - - - - CFBundleURLIconFile - document.icns - CFBundleURLName - https URL - CFBundleURLSchemes - - https - - - - CFBundleURLName - ftp URL - CFBundleURLSchemes - - ftp - - - - CFBundleURLName - gopher URL - CFBundleURLSchemes - - gopher - - - - CFBundleURLName - file URL - CFBundleURLSchemes - - file - - - - CFBundleVersion - APP_VERSION - NSAppleScriptEnabled - - - diff --git a/mozilla/browser/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings b/mozilla/browser/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings deleted file mode 100644 index 154c8a4bcef..00000000000 Binary files a/mozilla/browser/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/mozilla/browser/app/macbuild/background.png b/mozilla/browser/app/macbuild/background.png deleted file mode 100644 index e52f31d0510..00000000000 Binary files a/mozilla/browser/app/macbuild/background.png and /dev/null differ diff --git a/mozilla/browser/app/macbuild/disk.icns b/mozilla/browser/app/macbuild/disk.icns deleted file mode 100644 index e97e4905852..00000000000 Binary files a/mozilla/browser/app/macbuild/disk.icns and /dev/null differ diff --git a/mozilla/browser/app/macbuild/document.icns b/mozilla/browser/app/macbuild/document.icns deleted file mode 100644 index f5af7a70fc7..00000000000 Binary files a/mozilla/browser/app/macbuild/document.icns and /dev/null differ diff --git a/mozilla/browser/app/macbuild/dsstore b/mozilla/browser/app/macbuild/dsstore deleted file mode 100755 index 00b8f9a3053..00000000000 Binary files a/mozilla/browser/app/macbuild/dsstore and /dev/null differ diff --git a/mozilla/browser/app/macbuild/firefox.icns b/mozilla/browser/app/macbuild/firefox.icns deleted file mode 100644 index 000d24f91be..00000000000 Binary files a/mozilla/browser/app/macbuild/firefox.icns and /dev/null differ diff --git a/mozilla/browser/app/macbuild/license.r b/mozilla/browser/app/macbuild/license.r deleted file mode 100644 index 52a2e363946..00000000000 --- a/mozilla/browser/app/macbuild/license.r +++ /dev/null @@ -1,133 +0,0 @@ -// See /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h for language IDs. -data 'LPic' (5000) { - // Default language ID, 0 = English - $"0000" - // Number of entries in list - $"0001" - - // Entry 1 - // Language ID, 0 = English - $"0000" - // Resource ID, 0 = STR#/TEXT/styl 5000 - $"0000" - // Multibyte language, 0 = no - $"0000" -}; - -resource 'STR#' (5000, "English") { - { - // Language (unused?) = English - "English", - // Agree - "Agree", - // Disagree - "Disagree", - // Print, ellipsis is 0xC9 - "PrintÉ", - // Save As, ellipsis is 0xC9 - "Save AsÉ", - // Descriptive text, curly quotes are 0xD2 and 0xD3 - "You are about to install Deer Park.\n" - "\n" - "Please read the license agreement. If you agree to its terms and accept, click ÒAgreeÓ to access the software. Otherwise, click ÒDisagreeÓ to cancel." - }; -}; - -// Beware of 1024(?) byte (character?) line length limitation. Split up long -// lines. -// If straight quotes are used ("), remember to escape them (\"). -// Newline is \n, to leave a blank line, use two of them. -// 0xD2 and 0xD3 are curly double-quotes ("), 0xD4 and 0xD5 are curly -// single quotes ('), 0xD5 is also the apostrophe. -data 'TEXT' (5000, "English") { - "FOR TRANSLATIONS OF THIS LICENSE INTO SELECTED LANGUAGES, PLEASE VISIT WWW.MOZILLA.ORG/LICENSING.\n" - "\n" - "MOZILLA FOUNDATION\n" - "DEER PARK END-USER SOFTWARE LICENSE AGREEMENT\n" - "\n" - "A SOURCE CODE VERSION OF CERTAIN DEER PARK BROWSER FUNCTIONALITY THAT YOU MAY USE, MODIFY AND DISTRIBUTE IS AVAILABLE TO YOU FREE-OF-CHARGE FROM WWW.MOZILLA.ORG UNDER THE MOZILLA PUBLIC LICENSE and other open source software licenses.\n" - "\n" - "The accompanying executable code version of Deer Park and related documentation (the ÒProductÓ) is made available to you under the terms of this DEER PARK END-USER SOFTWARE LICENSE AGREEMENT (THE ÒAGREEMENTÓ). BY CLICKING THE ÒACCEPTÓ BUTTON, OR BY INSTALLING OR USING THE DEER PARK BROWSER, YOU ARE CONSENTING TO BE BOUND BY THE AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT, DO NOT CLICK THE ÒACCEPTÓ BUTTON, AND DO NOT INSTALL OR USE ANY PART OF THE DEER PARK BROWSER.\n" - "\n" - "DURING THE DEER PARK INSTALLATION PROCESS, AND AT LATER TIMES, YOU MAY BE GIVEN THE OPTION OF INSTALLING ADDITIONAL COMPONENTS FROM THIRD-PARTY SOFTWARE PROVIDERS. THE INSTALLATION AND USE OF THOSE THIRD-PARTY COMPONENTS MAY BE GOVERNED BY ADDITIONAL LICENSE AGREEMENTS.\n" - "\n" - "1. LICENSE GRANT. The Mozilla Foundation grants you a non-exclusive license to use the executable code version of the Product. This Agreement will also govern any software upgrades provided by Mozilla that replace and/or supplement the original Product, unless such upgrades are accompanied by a separate license, in which case the terms of that license will govern.\n" - "\n" - "2. TERMINATION. If you breach this Agreement your right to use the Product will terminate immediately and without notice, but all provisions of this Agreement except the License Grant (Paragraph 1) will survive termination and continue in effect. Upon termination, you must destroy all copies of the Product.\n" - "\n" - "3. PROPRIETARY RIGHTS. Portions of the Product are available in source code form under the terms of the Mozilla Public License and other open source licenses (collectively, ÒOpen Source LicensesÓ) at http://www.mozilla.org. Nothing in this Agreement will be construed to limit any rights granted under the Open Source Licenses. Subject to the foregoing, Mozilla, for itself and on behalf of its licensors, hereby reserves all intellectual property rights in the Product, except for the rights expressly granted in this Agreement. You may not remove or alter any trademark, logo, copyright or other proprietary notice in or on the Product. This license does not grant you any right to use the trademarks, service marks or logos of Mozilla or its licensors.\n" - "\n" - "4. DISCLAIMER OF WARRANTY. THE PRODUCT IS PROVIDED ÒAS ISÓ WITH ALL FAULTS. TO THE EXTENT PERMITTED BY LAW, MOZILLA AND MOZILLAÕS LICENSORS HEREBY DISCLAIM ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES THAT THE PRODUCT IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE AND NON-INFRINGING. YOU BEAR ENTIRE RISK AS TO SELECTING THE PRODUCT FOR YOUR PURPOSES AND AS TO THE QUALITY AND PERFORMANCE OF THE PRODUCT. THIS LIMITATION WILL APPLY NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES, SO THIS DISCLAIMER MAY NOT APPLY TO YOU.\n" - "\n" - "5. LIMITATION OF LIABILITY. EXCEPT AS REQUIRED BY LAW, MOZILLA AND ITS DIRECTORS, LICENSORS, CONTRIBUTORS AND AGENTS (COLLECTIVELY, THE ÒMOZILLA GROUPÓ) WILL NOT BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES ARISING OUT OF OR IN ANY WAY RELATING TO THIS AGREEMENT OR THE USE OF OR INABILITY TO USE THE PRODUCT, INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOST PROFITS, LOSS OF DATA, AND COMPUTER FAILURE OR MALFUNCTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF THE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH SUCH CLAIM IS BASED. THE MOZILLA GROUPÕS COLLECTIVE LIABILITY UNDER THIS AGREEMENT WILL NOT EXCEED THE GREATER OF $500 (FIVE HUNDRED DOLLARS) AND THE FEES PAID BY YOU UNDER THIS LICENSE (IF ANY). SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL, CONSEQUENTIAL OR SPECIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.\n" - "\n" - "6. EXPORT CONTROLS. This license is subject to all applicable export restrictions. You must comply with all export and import laws and restrictions and regulations of any United States or foreign agency or authority relating to the Product and its use.\n" - "\n" - "7. U.S. GOVERNMENT END-USERS. The Product is a Òcommercial item,Ó as that term is defined in 48 C.F.R. 2.101, consisting of Òcommercial computer softwareÓ and Òcommercial computer software documentation,Ó as such terms are used in 48 C.F.R. 12.212 (Sept. 1995) and 48 C.F.R. 227.7202 (June 1995). Consistent with 48 C.F.R. 12.212, 48 C.F.R. 27.405(b)(2) (June 1998) and 48 C.F.R. 227.7202, all U.S. Government End Users acquire the Product with only those rights as set forth herein.\n" - "\n" - "8. MISCELLANEOUS. (a) This Agreement constitutes the entire agreement between Mozilla and you concerning the subject matter hereof, and it may only be modified by a written amendment signed by an authorized executive of Mozilla. (b) Except to the extent applicable law, if any, provides otherwise, this Agreement will be governed by the laws of the state of California, U.S.A., excluding its conflict of law provisions. (c) This Agreement will not be governed by the United Nations Convention on Contracts for the International Sale of Goods. " - "(d) If any part of this Agreement is held invalid or unenforceable, that part will be construed to reflect the partiesÕ original intent, and the remaining portions will remain in full force and effect. (e) A waiver by either party of any term or condition of this Agreement or any breach thereof, in any one instance, will not waive such term or condition or any subsequent breach thereof. (f) Except as required by law, the controlling language of this Agreement is English. " - "(g) You may assign your rights under this Agreement to any party that consents to, and agrees to be bound by, its terms; the Mozilla Foundation may assign its rights under this Agreement without condition. (h) This Agreement will be binding upon and will inure to the benefit of the parties, their successors and permitted assigns." -}; - -data 'styl' (5000, "English") { - // Number of styles following = 3 - $"0003" - - // Style 1. This is used to display the message about translations. - // Start character = 0 - $"0000 0000" - // Height = 16 - $"0010" - // Ascent = 12 - $"000C" - // Font family = 1024 (Lucida Grande) - $"0400" - // Style bitfield, 0x1=bold 0x2=italic 0x4=underline 0x8=outline - // 0x10=shadow 0x20=condensed 0x40=extended - $"00" - // Style, unused? - $"02" - // Size = 12 point - $"000C" - // Color, RGB - $"0000 0000 0000" - - // Style 2. This is used to display the header lines in bold text. - // Start character = 99 - $"0000 0063" - // Height = 16 - $"0010" - // Ascent = 12 - $"000C" - // Font family = 1024 (Lucida Grande) - $"0400" - // Style bitfield, 0x1=bold 0x2=italic 0x4=underline 0x8=outline - // 0x10=shadow 0x20=condensed 0x40=extended - $"01" - // Style, unused? - $"02" - // Size = 12 point - $"000C" - // Color, RGB - $"0000 0000 0000" - - // Style 3. This is used to display the body. - // Start character = 164 - $"0000 00A4" - // Height = 16 - $"0010" - // Ascent = 12 - $"000C" - // Font family = 1024 (Lucida Grande) - $"0400" - // Style bitfield, 0x1=bold 0x2=italic 0x4=underline 0x8=outline - // 0x10=shadow 0x20=condensed 0x40=extended - $"00" - // Style, unused? - $"02" - // Size = 12 point - $"000C" - // Color, RGB - $"0000 0000 0000" -}; diff --git a/mozilla/browser/app/module.ver b/mozilla/browser/app/module.ver deleted file mode 100644 index eef059ce288..00000000000 --- a/mozilla/browser/app/module.ver +++ /dev/null @@ -1,8 +0,0 @@ -WIN32_MODULE_COMPANYNAME=Mozilla Corporation -WIN32_MODULE_COPYRIGHT=©Firefox and Mozilla Developers, according to the MPL 1.1/GPL 2.0/LGPL 2.1 licenses, as applicable. -WIN32_MODULE_PRODUCTVERSION=1,5,0,1 -WIN32_MODULE_PRODUCTVERSION_STRING=1.5.0.1 -WIN32_MODULE_TRADEMARKS=Firefox is a Trademark of The Mozilla Foundation. -WIN32_MODULE_DESCRIPTION=Firefox -WIN32_MODULE_PRODUCTNAME=Firefox -WIN32_MODULE_NAME=Firefox diff --git a/mozilla/browser/app/mozicon128.png b/mozilla/browser/app/mozicon128.png deleted file mode 100644 index 1b3ccc1324c..00000000000 Binary files a/mozilla/browser/app/mozicon128.png and /dev/null differ diff --git a/mozilla/browser/app/mozicon16.xpm b/mozilla/browser/app/mozicon16.xpm deleted file mode 100644 index f3c8a433c28..00000000000 --- a/mozilla/browser/app/mozicon16.xpm +++ /dev/null @@ -1,156 +0,0 @@ -/* XPM */ -static char * mozicon16_xpm[] = { -"16 16 137 2", -" c None", -". c #388BBF", -"+ c #59ADD6", -"@ c #68CEEF", -"# c #62CCEE", -"$ c #45AAD7", -"% c #3578AF", -"& c #4A93C3", -"* c #5EA9D2", -"= c #72D1EF", -"- c #6DCCEC", -"; c #4B9FCE", -"> c #3483BA", -", c #1E67A5", -"' c #1B6BA5", -") c #2F7AB0", -"! c #48B9E0", -"~ c #5CC2E5", -"{ c #6ED0EE", -"] c #6FC9E9", -"^ c #4994C5", -"/ c #3783B9", -"( c #1E5D9D", -"_ c #1463A1", -": c #028DC4", -"< c #128DC3", -"[ c #27ABD7", -"} c #3CB8E0", -"| c #4EC0E5", -"1 c #5BC3E6", -"2 c #50A2CE", -"3 c #3B7EB5", -"4 c #3C93C4", -"5 c #2164A1", -"6 c #145A9A", -"7 c #0E8FC4", -"8 c #007EBA", -"9 c #0694C8", -"0 c #1896C7", -"a c #2B99C9", -"b c #3CB7DE", -"c c #48B9DF", -"d c #3E95C5", -"e c #2E71AB", -"f c #399DCA", -"g c #34A9D4", -"h c #2387BE", -"i c #1388C0", -"j c #0059A1", -"k c #005C9E", -"l c #00498B", -"m c #095897", -"n c #1869A3", -"o c #289CCA", -"p c #34B1DA", -"q c #3BB3DB", -"r c #3BB3DA", -"s c #35AFD7", -"t c #2BA2CF", -"u c #1E6AA2", -"v c #106AA7", -"w c #0258A0", -"x c #00357F", -"y c #002D71", -"z c #003175", -"A c #013A7E", -"B c #084889", -"C c #1577AF", -"D c #1FA1CF", -"E c #26A3D1", -"F c #28A2CF", -"G c #269ACA", -"H c #2088BE", -"I c #174784", -"J c #0B1F5F", -"K c #012568", -"L c #00206A", -"M c #00185A", -"N c #001F62", -"O c #002569", -"P c #002C70", -"Q c #0567A7", -"R c #0D81BB", -"S c #1485BD", -"T c #1883BC", -"U c #177DB7", -"V c #144A88", -"W c #0C1D5C", -"X c #030B47", -"Y c #00023B", -"Z c #00207A", -"` c #002072", -" . c #00236B", -".. c #001556", -"+. c #001B5E", -"@. c #003D81", -"#. c #01599E", -"$. c #04559E", -"%. c #0761A6", -"&. c #085499", -"*. c #061958", -"=. c #020843", -"-. c #000137", -";. c #001C79", -">. c #00155D", -",. c #000945", -"'. c #000B49", -"). c #000E4C", -"!. c #002367", -"~. c #002A6F", -"{. c #003E8B", -"]. c #003787", -"^. c #00175C", -"/. c #000035", -"(. c #000030", -"_. c #000E67", -":. c #00043B", -"<. c #000339", -"[. c #00043C", -"}. c #00053E", -"|. c #00063F", -"1. c #000E4F", -"2. c #00247E", -"3. c #00166A", -"4. c #00002E", -"5. c #00014F", -"6. c #000029", -"7. c #00012F", -"8. c #000953", -"9. c #000E6E", -"0. c #000A6C", -"a. c #000563", -"b. c #00002F", -"c. c #00001D", -"d. c #000025", -"e. c #000040", -"f. c #000033", -" ", -" . + @ # $ ", -" % & * = - ; > , ", -" ' ) ! ~ { ] ^ / ( _ ", -" : < [ } | 1 2 3 4 5 6 7 ", -" 8 9 0 a b c d e f g h i ", -" j k l m n o p q r s t u v w ", -" x y z A B C D E F G H I J K ", -" L M N O P Q R S T U V W X Y ", -" Z ` ...+.@.#.$.%.&.*.=.-. ", -" ;.>.,.'.).!.~.{.].^./.(. ", -" _.:.<.[.}.|.1.2.3.4. ", -" 5.6.(.4.7.8.9.0.a. ", -" b.b.c.d.e.f. ", -" ", -" "}; diff --git a/mozilla/browser/app/mozicon50.xpm b/mozilla/browser/app/mozicon50.xpm deleted file mode 100644 index d240015018d..00000000000 --- a/mozilla/browser/app/mozicon50.xpm +++ /dev/null @@ -1,1144 +0,0 @@ -/* XPM */ -static char * mozicon50_xpm[] = { -"48 48 1093 2", -" c None", -". c #2099CF", -"+ c #2CA7D9", -"@ c #33AEDD", -"# c #34B2E1", -"$ c #35B8E5", -"% c #2FBAE8", -"& c #26B5E4", -"* c #199FD6", -"= c #177DB8", -"- c #2C8FC4", -"; c #43A0CE", -"> c #55ADD6", -", c #5CB5DD", -"' c #61C4E8", -") c #63CBED", -"! c #64CFF1", -"~ c #63D1F2", -"{ c #5ECCEF", -"] c #57C3E9", -"^ c #4EB8E1", -"/ c #3CABD9", -"( c #2A9ED1", -"_ c #1991C9", -": c #0F7CBA", -"< c #166EAC", -"[ c #3387BC", -"} c #4797C6", -"| c #51A0CC", -"1 c #56A7D2", -"2 c #5BAED7", -"3 c #60B6DD", -"4 c #67CDEE", -"5 c #69D3F2", -"6 c #6BD4F4", -"7 c #69D3F4", -"8 c #63CDEF", -"9 c #5AC0E6", -"0 c #51B6DF", -"a c #49ACD8", -"b c #42A2D1", -"c c #3898CA", -"d c #298CC2", -"e c #167EB9", -"f c #0B5A9C", -"g c #2674AE", -"h c #3D87BA", -"i c #4590C0", -"j c #4B97C6", -"k c #519FCB", -"l c #58A6D1", -"m c #5DADD5", -"n c #62B3DA", -"o c #69C3E6", -"p c #6ED4F2", -"q c #6FD6F4", -"r c #6ED5F4", -"s c #6AD3F2", -"t c #5FC3E7", -"u c #53B2DC", -"v c #4BA8D5", -"w c #439FCE", -"x c #3B95C7", -"y c #338BC0", -"z c #2B82B9", -"A c #1D76B1", -"B c #0C69A9", -"C c #10599A", -"D c #2D71AA", -"E c #377CB2", -"F c #3D84B8", -"G c #458DBE", -"H c #4B95C4", -"I c #529CC9", -"J c #59A4CF", -"K c #5FABD4", -"L c #65B1D8", -"M c #6BC2E4", -"N c #71D5F3", -"O c #73D6F3", -"P c #72D5F3", -"Q c #6DD1F0", -"R c #5FBBE2", -"S c #54ADD8", -"T c #4CA4D2", -"U c #439ACB", -"V c #3B91C4", -"W c #3487BD", -"X c #2D7EB7", -"Y c #2675AF", -"Z c #1E6CA9", -"` c #0F5FA0", -" . c #055296", -".. c #115394", -"+. c #2767A2", -"@. c #2F70A9", -"#. c #3679AF", -"$. c #3C81B5", -"%. c #448ABC", -"&. c #4A92C2", -"*. c #519AC7", -"=. c #58A2CD", -"-. c #5FA9D2", -";. c #65B0D7", -">. c #6EC8E9", -",. c #74D4F2", -"'. c #76D6F3", -"). c #75D6F3", -"!. c #71D3F1", -"~. c #62BCE1", -"{. c #54A9D5", -"]. c #4C9FCE", -"^. c #4396C8", -"/. c #3B8CC1", -"(. c #3483BA", -"_. c #2C7AB3", -":. c #2670AC", -"<. c #1F68A6", -"[. c #195F9F", -"}. c #0D5497", -"|. c #04488D", -"1. c #0F4A8D", -"2. c #1F5A98", -"3. c #2663A0", -"4. c #2D6DA6", -"5. c #3475AD", -"6. c #3B7EB3", -"7. c #4287B9", -"8. c #4990C1", -"9. c #51A4CF", -"0. c #569FCA", -"a. c #5DA6CF", -"b. c #66B5DB", -"c. c #6FD1F0", -"d. c #75D4F1", -"e. c #79D5F2", -"f. c #75D3F1", -"g. c #63BBE0", -"h. c #54A4D1", -"i. c #4B9BCB", -"j. c #4391C4", -"k. c #3B88BD", -"l. c #337FB6", -"m. c #2C76B0", -"n. c #266CA9", -"o. c #1F64A3", -"p. c #1A5B9C", -"q. c #145396", -"r. c #0A498E", -"s. c #034C8F", -"t. c #085293", -"u. c #164D8E", -"v. c #1D5695", -"w. c #24609C", -"x. c #2A69A3", -"y. c #3271AA", -"z. c #387AAF", -"A. c #429FCC", -"B. c #4CBFE4", -"C. c #52C4E8", -"D. c #57AFD7", -"E. c #5DB3DA", -"F. c #65C5E7", -"G. c #6DD0EE", -"H. c #72D2EF", -"I. c #78D4F0", -"J. c #7BD5F1", -"K. c #76D2EF", -"L. c #6AC5E6", -"M. c #55A5D1", -"N. c #4A95C6", -"O. c #428CC0", -"P. c #3A83B9", -"Q. c #337AB3", -"R. c #2C71AD", -"S. c #2568A6", -"T. c #1F5F9F", -"U. c #1D65A3", -"V. c #269ACA", -"W. c #1C84BA", -"X. c #0D7DB5", -"Y. c #0298CC", -"Z. c #0296CA", -"`. c #0C5998", -" + c #14498A", -".+ c #1B609C", -"++ c #2498C8", -"@+ c #2977AF", -"#+ c #2F75AC", -"$+ c #3575AC", -"%+ c #40ABD5", -"&+ c #49BFE4", -"*+ c #50C3E7", -"=+ c #56C5E8", -"-+ c #5DC8EA", -";+ c #63CBEB", -">+ c #69CEED", -",+ c #6ED0EE", -"'+ c #73D2EF", -")+ c #77D3EF", -"!+ c #72CEEC", -"~+ c #5AA7D1", -"{+ c #4F99C9", -"]+ c #4891C3", -"^+ c #4087BC", -"/+ c #387EB5", -"(+ c #3277B1", -"_+ c #2B70AB", -":+ c #2463A2", -"<+ c #1E5B9C", -"[+ c #185395", -"}+ c #165496", -"|+ c #10498D", -"1+ c #105F9E", -"2+ c #0A9ECF", -"3+ c #0088C0", -"4+ c #038DC3", -"5+ c #0A4A8C", -"6+ c #114E8E", -"7+ c #1989BD", -"8+ c #22AAD7", -"9+ c #28A2D0", -"0+ c #2C71A9", -"a+ c #3380B5", -"b+ c #3EB9E1", -"c+ c #45BDE3", -"d+ c #4CC0E5", -"e+ c #53C3E7", -"f+ c #59C6E8", -"g+ c #5EC9EA", -"h+ c #64CBEB", -"i+ c #69CDEC", -"j+ c #6ECFED", -"k+ c #70D0ED", -"l+ c #64BDE1", -"m+ c #55A6D1", -"n+ c #3D82B8", -"o+ c #3D8BBE", -"p+ c #49AFD8", -"q+ c #378DBF", -"r+ c #225F9E", -"s+ c #1D5698", -"t+ c #174E92", -"u+ c #12468B", -"v+ c #0E3F85", -"w+ c #115F9D", -"x+ c #15A2D1", -"y+ c #0395C9", -"z+ c #0088C1", -"A+ c #0190C6", -"B+ c #079ACC", -"C+ c #0FA0D0", -"D+ c #169ECF", -"E+ c #1D99CC", -"F+ c #25AAD7", -"G+ c #2BA0CE", -"H+ c #32AED8", -"I+ c #3AB7DF", -"J+ c #41BBE1", -"K+ c #47BEE3", -"L+ c #4EC1E5", -"M+ c #53C4E7", -"N+ c #5FC8E9", -"O+ c #63CAEA", -"P+ c #67CBEB", -"Q+ c #69CBEA", -"R+ c #62BCE0", -"S+ c #5AAFD7", -"T+ c #478DBF", -"U+ c #4084B9", -"V+ c #3A7CB4", -"W+ c #3E8CBF", -"X+ c #4DBADF", -"Y+ c #3383B8", -"Z+ c #215B9B", -"`+ c #1B5295", -" @ c #164A8E", -".@ c #114288", -"+@ c #0D3A82", -"@@ c #0E4C8E", -"#@ c #1380B7", -"$@ c #0D96C9", -"%@ c #0089C1", -"&@ c #007BB8", -"*@ c #0085BE", -"=@ c #008CC4", -"-@ c #0496C9", -";@ c #0B9DCF", -">@ c #1168AB", -",@ c #174F99", -"'@ c #21AAD7", -")@ c #28AED9", -"!@ c #2FB1DB", -"~@ c #36B5DE", -"{@ c #3CB8E0", -"]@ c #42BBE2", -"^@ c #49BEE4", -"/@ c #54C3E6", -"(@ c #59C5E7", -"_@ c #5DC7E8", -":@ c #5FC5E7", -"<@ c #53A9D3", -"[@ c #4B96C6", -"}@ c #478FC2", -"|@ c #4186BB", -"1@ c #3C7FB5", -"2@ c #3676AF", -"3@ c #306EA9", -"4@ c #3889BD", -"5@ c #44AFD8", -"6@ c #2F84B9", -"7@ c #194D91", -"8@ c #15458A", -"9@ c #144D90", -"0@ c #0C367E", -"a@ c #0C4086", -"b@ c #1797C8", -"c@ c #1295C8", -"d@ c #0487C0", -"e@ c #0079B6", -"f@ c #0081BC", -"g@ c #0E9ACC", -"h@ c #1597CA", -"i@ c #1CA7D5", -"j@ c #23ABD8", -"k@ c #2AAFDA", -"l@ c #31B2DC", -"m@ c #37B5DE", -"n@ c #3DB8E0", -"o@ c #43BBE2", -"p@ c #49BEE3", -"q@ c #4EC0E4", -"r@ c #53C2E5", -"s@ c #57C4E6", -"t@ c #4EAAD4", -"u@ c #4696C5", -"v@ c #438FC0", -"w@ c #4088BC", -"x@ c #3C80B6", -"y@ c #3778B1", -"z@ c #3270AB", -"A@ c #2C68A5", -"B@ c #3D9AC8", -"C@ c #46BADF", -"D@ c #3DB0D8", -"E@ c #287CB2", -"F@ c #164D90", -"G@ c #299ECC", -"H@ c #1B79B0", -"I@ c #1A8CBF", -"J@ c #199BCC", -"K@ c #1392C6", -"L@ c #0A86BE", -"M@ c #0079B7", -"N@ c #006AAC", -"O@ c #0074B3", -"P@ c #007CB9", -"Q@ c #0083BE", -"R@ c #008BC2", -"S@ c #0393C8", -"T@ c #099CCD", -"U@ c #10A1D1", -"V@ c #17A4D3", -"W@ c #1EA8D6", -"X@ c #25ABD8", -"Y@ c #2BAFDA", -"Z@ c #37B5DD", -"`@ c #3DB8DF", -" # c #42BAE1", -".# c #48BCE2", -"+# c #4CBEE3", -"@# c #50C0E4", -"## c #48A8D3", -"$# c #3F8EC0", -"%# c #3C87BC", -"&# c #3A81B7", -"*# c #3679B1", -"=# c #3171AC", -"-# c #2D6AA6", -";# c #2862A0", -"># c #40A5D1", -",# c #43B8DE", -"'# c #3DB5DC", -")# c #38B1DA", -"!# c #2D9ECC", -"~# c #2B9FCE", -"{# c #246AAA", -"]# c #1F96C7", -"^# c #1996C9", -"/# c #138DC3", -"(# c #0E84BC", -"_# c #0175B4", -":# c #0068AC", -"<# c #0070B1", -"[# c #0077B5", -"}# c #007FBA", -"|# c #0086BF", -"1# c #018DC4", -"2# c #0596C9", -"3# c #0B9DCE", -"4# c #12A1D1", -"5# c #1897C8", -"6# c #1E96C7", -"7# c #25A0CE", -"8# c #2B90C2", -"9# c #31A4D0", -"0# c #37B4DD", -"a# c #3CB7DF", -"b# c #41B9E0", -"c# c #45BBE0", -"d# c #49BCE1", -"e# c #4BBBE0", -"f# c #419FCC", -"g# c #3C91C2", -"h# c #337AB1", -"i# c #3072AC", -"j# c #2C6BA7", -"k# c #2864A1", -"l# c #255F9E", -"m# c #3FAAD4", -"n# c #40B6DC", -"o# c #3AB3DB", -"p# c #35B0D8", -"q# c #2F86BD", -"r# c #29599F", -"s# c #237DB7", -"t# c #1E99CA", -"u# c #1892C5", -"v# c #1389C0", -"w# c #0E7FBA", -"x# c #0473B2", -"y# c #0065AA", -"z# c #0064A9", -"A# c #006BAD", -"B# c #0072B2", -"C# c #0080BC", -"D# c #0082BC", -"E# c #028DC4", -"F# c #0796C9", -"G# c #0D88BD", -"H# c #1372AB", -"I# c #1982B8", -"J# c #1F79B0", -"K# c #247BB1", -"L# c #2A86B9", -"M# c #31B1DA", -"N# c #36B3DC", -"O# c #3AB5DD", -"P# c #3FB7DE", -"Q# c #42B9DF", -"R# c #45BAE0", -"S# c #48BBE0", -"T# c #47B6DD", -"U# c #3689BC", -"V# c #2D72AB", -"W# c #2C73AC", -"X# c #2F7DB3", -"Y# c #399BC9", -"Z# c #3FB4DB", -"`# c #3CB3DA", -" $ c #37B0D9", -".$ c #32AED7", -"+$ c #2CA8D3", -"@$ c #277EB8", -"#$ c #229CCC", -"$$ c #1D95C8", -"%$ c #188DC2", -"&$ c #1384BD", -"*$ c #0D7AB6", -"=$ c #066FB0", -"-$ c #0057A0", -";$ c #005FA5", -">$ c #0066AA", -",$ c #006DAF", -"'$ c #006EAC", -")$ c #004C8E", -"!$ c #005595", -"~$ c #025999", -"{$ c #085D9B", -"]$ c #0D64A0", -"^$ c #1369A4", -"/$ c #196EA7", -"($ c #1E73AA", -"_$ c #2376AD", -":$ c #2AA0CE", -"<$ c #2FAFD9", -"[$ c #34B1DB", -"}$ c #38B3DC", -"|$ c #3BB5DC", -"1$ c #3EB6DD", -"2$ c #40B7DD", -"3$ c #42B7DD", -"4$ c #43B7DE", -"5$ c #43B7DD", -"6$ c #40B5DC", -"7$ c #3DB4DB", -"8$ c #3AB2DA", -"9$ c #33AED6", -"0$ c #2EABD5", -"a$ c #29A5D2", -"b$ c #259ECD", -"c$ c #2094C6", -"d$ c #1C8DC2", -"e$ c #1787BE", -"f$ c #127EB9", -"g$ c #0D75B3", -"h$ c #076AAC", -"i$ c #005FA6", -"j$ c #00539D", -"k$ c #005AA2", -"l$ c #0060A6", -"m$ c #0068AB", -"n$ c #0063A5", -"o$ c #004487", -"p$ c #004386", -"q$ c #004789", -"r$ c #004B8D", -"s$ c #045192", -"t$ c #095997", -"u$ c #0E5F9C", -"v$ c #1365A0", -"w$ c #1869A4", -"x$ c #1D6EA7", -"y$ c #2274AB", -"z$ c #28A6D2", -"A$ c #2DAED8", -"B$ c #31AFD9", -"C$ c #34B1DA", -"D$ c #37B2DB", -"E$ c #39B3DB", -"F$ c #3BB4DB", -"G$ c #3CB4DB", -"H$ c #3BB3DA", -"I$ c #38B1D9", -"J$ c #35AFD8", -"K$ c #32ADD6", -"L$ c #2EAAD4", -"M$ c #2BA5D1", -"N$ c #2795C5", -"O$ c #2374AA", -"P$ c #1E5691", -"Q$ c #1A4C89", -"R$ c #156AA5", -"S$ c #1078B5", -"T$ c #0B6FAF", -"U$ c #0665A9", -"V$ c #004A97", -"W$ c #004D9A", -"X$ c #00509A", -"Y$ c #00579F", -"Z$ c #0062A7", -"`$ c #00468A", -" % c #00387C", -".% c #003C7F", -"+% c #004083", -"@% c #044D8E", -"#% c #095493", -"$% c #0E5A98", -"%% c #13609C", -"&% c #18659F", -"*% c #1C6BA4", -"=% c #219FCD", -"-% c #25AAD5", -";% c #29ABD6", -">% c #2DADD7", -",% c #30AED8", -"'% c #32AFD8", -")% c #34B0D8", -"!% c #34AED7", -"~% c #30ABD4", -"{% c #2DA8D2", -"]% c #2BA3CF", -"^% c #289DCC", -"/% c #2494C5", -"(% c #20659E", -"_% c #1C4684", -":% c #183D7C", -"<% c #133B7A", -"[% c #0F5695", -"}% c #0A5FA1", -"|% c #055FA5", -"1% c #00559F", -"2% c #004D99", -"3% c #004896", -"4% c #002E74", -"5% c #003C82", -"6% c #004E94", -"7% c #003377", -"8% c #003175", -"9% c #003578", -"0% c #003B7F", -"a% c #003F82", -"b% c #014285", -"c% c #044889", -"d% c #094E8E", -"e% c #0D5493", -"f% c #125997", -"g% c #167FB4", -"h% c #1A96C7", -"i% c #1EA5D2", -"j% c #22A7D3", -"k% c #25A9D4", -"l% c #28AAD5", -"m% c #2AAAD5", -"n% c #2CABD6", -"o% c #2DACD6", -"p% c #2EACD5", -"q% c #2DA9D3", -"r% c #2CA6D1", -"s% c #299FCD", -"t% c #279ACA", -"u% c #2495C7", -"v% c #218FC3", -"w% c #1D86BC", -"x% c #1A4683", -"y% c #163574", -"z% c #112C6C", -"A% c #0D2464", -"B% c #082D6F", -"C% c #044E94", -"D% c #004F9A", -"E% c #004292", -"F% c #00347D", -"G% c #002266", -"H% c #002669", -"I% c #00286C", -"J% c #002B6F", -"K% c #002E72", -"L% c #003478", -"M% c #00377B", -"N% c #003A7E", -"O% c #013D80", -"P% c #044285", -"Q% c #084889", -"R% c #0D4D8D", -"S% c #115492", -"T% c #15609B", -"U% c #189ACB", -"V% c #1CA0CF", -"W% c #1FA2CF", -"X% c #21A3D1", -"Y% c #24A4D1", -"Z% c #25A5D1", -"`% c #27A4D1", -" & c #28A4D1", -".& c #28A0CE", -"+& c #289ECC", -"@& c #2596C8", -"#& c #2392C5", -"$& c #208DC2", -"%& c #1D87BD", -"&& c #1A75AE", -"*& c #173978", -"=& c #132E6D", -"-& c #0F2565", -";& c #0B1D5D", -">& c #071555", -",& c #021151", -"'& c #001F61", -")& c #00276D", -"!& c #003D8E", -"~& c #003B89", -"{& c #001E62", -"]& c #002063", -"^& c #002569", -"/& c #002D72", -"(& c #003074", -"_& c #003579", -":& c #033C7F", -"<& c #074183", -"[& c #0B4787", -"}& c #0F5392", -"|& c #1391C5", -"1& c #1695C8", -"2& c #1998CA", -"3& c #1C99CA", -"4& c #1E9ACB", -"5& c #209BCB", -"6& c #219BCB", -"7& c #229ACA", -"8& c #2399C9", -"9& c #2397C8", -"0& c #2394C6", -"a& c #2291C4", -"b& c #1E89C0", -"c& c #1C84BC", -"d& c #1A5B97", -"e& c #174C89", -"f& c #142D6C", -"g& c #102665", -"h& c #0C1E5D", -"i& c #081756", -"j& c #040F4F", -"k& c #000847", -"l& c #000541", -"m& c #00033D", -"n& c #00368A", -"o& c #00256E", -"p& c #00185A", -"q& c #001A5D", -"r& c #001D60", -"s& c #001F63", -"t& c #002568", -"u& c #00276B", -"v& c #00296D", -"w& c #002B70", -"x& c #003276", -"y& c #023579", -"z& c #063A7D", -"A& c #0A5997", -"B& c #0D87BF", -"C& c #108AC1", -"D& c #138CC3", -"E& c #168EC4", -"F& c #188FC4", -"G& c #1A90C4", -"H& c #1C90C4", -"I& c #1D8FC4", -"J& c #1D8EC3", -"K& c #1D8CC2", -"L& c #1D8AC0", -"M& c #1C87BE", -"N& c #1B83BC", -"O& c #1A7FB9", -"P& c #1864A0", -"Q& c #164987", -"R& c #132C6A", -"S& c #102564", -"T& c #0D1E5D", -"U& c #091756", -"V& c #06104E", -"W& c #020947", -"X& c #000441", -"Y& c #00023C", -"Z& c #000038", -"`& c #003086", -" * c #001A5E", -".* c #001354", -"+* c #001658", -"@* c #001D5F", -"#* c #001F62", -"$* c #002164", -"%* c #002367", -"&* c #002D71", -"** c #014C8E", -"=* c #0474B2", -"-* c #077CB9", -";* c #0B80BA", -">* c #0E82BB", -",* c #1083BC", -"'* c #1285BD", -")* c #1485BE", -"!* c #1686BD", -"~* c #1785BD", -"{* c #1884BC", -"]* c #1882BB", -"^* c #1880B9", -"/* c #187DB7", -"(* c #177AB6", -"_* c #1571AF", -":* c #143676", -"<* c #122968", -"[* c #0F2362", -"}* c #0D1D5C", -"|* c #0A1755", -"1* c #030A47", -"2* c #000239", -"3* c #002A82", -"4* c #00175D", -"5* c #00104F", -"6* c #001252", -"7* c #001454", -"8* c #001657", -"9* c #00195C", -"0* c #001C5E", -"a* c #001D61", -"b* c #002165", -"c* c #002366", -"d* c #002468", -"e* c #006CAE", -"f* c #006FB0", -"g* c #0271B1", -"h* c #0574B3", -"i* c #0877B4", -"j* c #0B78B5", -"k* c #0F7AB6", -"l* c #107AB7", -"m* c #127AB6", -"n* c #1279B5", -"o* c #1377B4", -"p* c #1375B3", -"q* c #1372B1", -"r* c #126FAF", -"s* c #115797", -"t* c #0F2766", -"u* c #0D2160", -"v* c #0B1B5A", -"w* c #091554", -"x* c #06104D", -"y* c #030A46", -"z* c #000540", -"A* c #000036", -"B* c #00237E", -"C* c #002980", -"D* c #002372", -"E* c #001A60", -"F* c #001659", -"G* c #001358", -"H* c #001A5F", -"I* c #002064", -"J* c #001B5E", -"K* c #005397", -"L* c #0065A9", -"M* c #0067AB", -"N* c #0069AC", -"O* c #026AAD", -"P* c #046CAE", -"Q* c #0768AB", -"R* c #0965A9", -"S* c #0A6EAF", -"T* c #0C6EAE", -"U* c #0D6DAE", -"V* c #0D6CAD", -"W* c #0D6AAB", -"X* c #0D67AA", -"Y* c #0D64A7", -"Z* c #0C498C", -"`* c #0A1E5E", -" = c #091856", -".= c #071350", -"+= c #050D4B", -"@= c #020844", -"#= c #00043F", -"$= c #00023B", -"%= c #000037", -"&= c #000035", -"*= c #000034", -"== c #001A77", -"-= c #00237D", -";= c #002881", -">= c #002D84", -",= c #00287F", -"'= c #000B6C", -")= c #00388A", -"!= c #003785", -"~= c #001556", -"{= c #001759", -"]= c #00195B", -"^= c #001C5F", -"/= c #001C60", -"(= c #004B91", -"_= c #004287", -":= c #00569C", -"<= c #0061A7", -"[= c #023187", -"}= c #033388", -"|= c #0563A7", -"1= c #0662A7", -"2= c #0762A7", -"3= c #0860A6", -"4= c #085EA4", -"5= c #085CA3", -"6= c #084388", -"7= c #071B5B", -"8= c #061453", -"9= c #04104D", -"0= c #030B48", -"a= c #010742", -"b= c #00033E", -"c= c #00013A", -"d= c #000033", -"e= c #000032", -"f= c #001C79", -"g= c #00217C", -"h= c #002780", -"i= c #002B83", -"j= c #003589", -"k= c #001D63", -"l= c #000F4F", -"m= c #000F4E", -"n= c #001050", -"o= c #001152", -"p= c #001353", -"q= c #001455", -"r= c #002F74", -"s= c #00529A", -"t= c #0058A1", -"u= c #00529D", -"v= c #0156A0", -"w= c #02569F", -"x= c #02549E", -"y= c #03529D", -"z= c #034F9A", -"A= c #032062", -"B= c #020F4E", -"C= c #010C49", -"D= c #000845", -"E= c #00033C", -"F= c #000138", -"G= c #000135", -"H= c #001474", -"I= c #001F7B", -"J= c #00247E", -"K= c #002D83", -"L= c #001051", -"M= c #000A46", -"N= c #000B48", -"O= c #000C4A", -"P= c #000D4B", -"Q= c #000E4D", -"R= c #001151", -"S= c #001253", -"T= c #00377E", -"U= c #004E9A", -"V= c #004C98", -"W= c #00408C", -"X= c #000946", -"Y= c #00053F", -"Z= c #000137", -"`= c #000031", -" - c #000030", -".- c #001373", -"+- c #001876", -"@- c #001D79", -"#- c #00267F", -"$- c #000D4D", -"%- c #000741", -"&- c #000843", -"*- c #000945", -"=- c #000A47", -"-- c #000B49", -";- c #000D4C", -">- c #002F77", -",- c #00327A", -"'- c #002267", -")- c #002166", -"!- c #00256A", -"~- c #003D89", -"{- c #004393", -"]- c #003F90", -"^- c #003C8D", -"/- c #003382", -"(- c #003587", -"_- c #002069", -":- c #00033A", -"<- c #000136", -"[- c #00002F", -"}- c #000C6E", -"|- c #001171", -"1- c #001574", -"2- c #001E7A", -"3- c #00196A", -"4- c #00053E", -"5- c #000640", -"6- c #000742", -"7- c #00185B", -"8- c #003787", -"9- c #00398C", -"0- c #00378B", -"a- c #003388", -"b- c #002779", -"c- c #00063F", -"d- c #00002D", -"e- c #00096C", -"f- c #000D6F", -"g- c #001271", -"h- c #001675", -"i- c #001872", -"j- c #000338", -"k- c #00043A", -"l- c #00043B", -"m- c #00053D", -"n- c #000844", -"o- c #000944", -"p- c #002573", -"q- c #002E85", -"r- c #002C83", -"s- c #001E71", -"t- c #00002E", -"u- c #00002C", -"v- c #000266", -"w- c #00066A", -"x- c #000A6D", -"y- c #000E70", -"z- c #000C58", -"A- c #000643", -"B- c #000337", -"C- c #000236", -"D- c #000339", -"E- c #00053C", -"F- c #00063E", -"G- c #00073F", -"H- c #00145A", -"I- c #001C78", -"J- c #000743", -"K- c #00002A", -"L- c #00005F", -"M- c #000267", -"N- c #000A6C", -"O- c #000952", -"P- c #000131", -"Q- c #000132", -"R- c #000133", -"S- c #000134", -"T- c #000235", -"U- c #00196E", -"V- c #001D7A", -"W- c #001B78", -"X- c #001977", -"Y- c #001775", -"Z- c #001473", -"`- c #000E66", -" ; c #00002B", -".; c #000029", -"+; c #000053", -"@; c #00005E", -"#; c #000265", -"$; c #000464", -"%; c #000130", -"&; c #001160", -"*; c #001164", -"=; c #001674", -"-; c #001272", -";; c #001071", -">; c #000E6F", -",; c #000B6E", -"'; c #00086C", -"); c #00045F", -"!; c #000152", -"~; c #000046", -"{; c #000051", -"]; c #00005A", -"^; c #00012F", -"/; c #000542", -"(; c #00106E", -"_; c #001070", -":; c #000F70", -"<; c #00086B", -"[; c #000367", -"}; c #000163", -"|; c #00005B", -"1; c #000052", -"2; c #000047", -"3; c #000041", -"4; c #000028", -"5; c #000021", -"6; c #000025", -"7; c #00003E", -"8; c #00003A", -"9; c #00075A", -"0; c #00076B", -"a; c #000569", -"b; c #000368", -"c; c #000162", -"d; c #00005C", -"e; c #000054", -"f; c #00004C", -"g; c #000042", -"h; c #000039", -"i; c #000026", -"j; c #000023", -"k; c #000017", -"l; c #00001C", -"m; c #00004D", -"n; c #000055", -"o; c #000027", -"p; c #00003D", -"q; c #000058", -"r; c #00004E", -"s; c #000048", -"t; c #000019", -"u; c #000012", -"v; c #00001D", -"w; c #00001F", -"x; c #000044", -"y; c #000008", -"z; c #000018", -"A; c #000024", -"B; c #000015", -"C; c #000022", -"D; c #00000F", -"E; c #000004", -"F; c #000007", -"G; c #000009", -"H; c #00000C", -"I; c #00000D", -"J; c #00000E", -"K; c #00000A", -"L; c #000003", -"M; c #000000", -"N; c #000001", -"O; c #000005", -"P; c #00000B", -" ", -" ", -" . + @ # $ % & * ", -" = - ; > , ' ) ! ~ { ] ^ / ( _ : ", -" < [ } | 1 2 3 4 5 6 7 8 9 0 a b c d e ", -" f g h i j k l m n o p q r s t u v w x y z A B ", -" C D E F G H I J K L M N O P Q R S T U V W X Y Z ` . ", -" ..+.@.#.$.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|. ", -" 1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s. ", -" t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y. ", -" Z.`. +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+ ", -" 3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+k+l+m+]+n+o+p+q+r+s+t+u+v+w+x+y+ ", -" z+A+B+C+D+E+F+G+H+I+J+K+L+M+f+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@ ", -" &@*@=@-@;@>@,@'@)@!@~@{@]@^@L+/@(@_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@b@c@d@ ", -" e@f@z+A+B+g@h@i@j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@L@M@ ", -" N@O@P@Q@R@S@T@U@V@W@X@Y@l@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#_# ", -" :#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y# ", -" z#A#B#M@C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$z# ", -" -$;$>$,$O@'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$2$3$4$5$3$6$7$8$ $9$0$a$b$c$d$e$f$g$h$i$ ", -" j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$F$G$G$H$8$I$J$K$L$M$N$O$P$Q$R$S$T$U$k$V$ ", -" W$X$Y$Z$`$ %.%+%p$q$@%#%$%%%&%*%=%-%;%>%,%'%)%p#p#J$!%K$~%{%]%^%/%(%_%:%<%[%}%|%1%2% ", -" 3%4%5%6%7%8%9% %0%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%0$q%r%]%s%t%u%v%w%x%y%z%A%B%C%D%3% ", -" E%F%G%H%I%J%K%8%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% &9+.&+&V.@&#&$&%&&&*&=&-&;&>&,&'&)& ", -" !&~&{&]&G%^&I%J%/&(&7%_& %:&<&[&}&|&1&2&3&4&5&6&7&8&9&0&a&$&b&c&d&e&f&g&h&i&j&k&l&m& ", -" n&o&p&q&r&s&G%t&u&v&w&K%(&x&y&z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z& ", -" `& *.*+*p&q&@*#*$*%*^&u&v&J%&***=*-*;*>*,*'*)*!*~*{*]*^*/*(*_*:*<*[*}*|*V&1*l&Y&Z&2* ", -" 3*4*5*6*7*8*p&9*0*a*s&b*c*d*v&e*f*g*h*i*j**$k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*Y&Z&A*z* ", -" B*C*D*E*F*G*H*I*+*p&9*J*r&{&x&K*L*M*N*O*P*Q*R*S*T*U*V*W*X*Y*Z*`* =.=+=@=#=$=%=&=*= ", -" ==-=;=>=,='=)=!=J*.*~=+*{=]=^=/=(=_=:=l$<=[=}=|=1=2=3=4=5=6=7=8=9=0=a=b=c=%=&=d=e= ", -" f=g=h=i=3*j=k=l=m=n=o=p=q=~=8*r=^=b*s=t=j$u=-$v=w=x=y=z=A=B=C=D=z*E=F=A*&=d=e=G= ", -" H===I=J=;=K=L=M=N=O=P=Q=l=n=R=6*S=.*T=D%D%D%U=2%V=V$3%W=J*L=X=Y=$=Z=&=*=e=`= - ", -" .-+-@-g=#-$-%-&-*-M==---O=P=;-Q=m=>-,-'-)-!-~-{-E%]-^-/-(-_-:-<-*=d=e=`=[-[- ", -" }-|-1-==2-3-4-4-5-%-6-&-*-X==-=-N=q&;-O=O=O=7-8-9-0-j=a-`&b-c-d=e=`= -[-d-$= ", -" e-f-g-h-i-4-j-k-l-m-4-c-5-%-6-6-&-&-n-o-o-*-M=p-q-r-3*h=s-X=`= -[-t-u-u- ", -" v-w-x-y-g-z-A-B-C-j-D-:-l-l-E-m-4-F-F-c-c-c-G-H-#-J=g=I=I-J-t-t-d-u-K- ", -" L-M-w-N-f-O-P-Q-R-S-T-C-C-B-j-D-D-:-k-l-k-D=U-V-W-X-Y-Z-`-[- ; ;.;u- ", -" +;@;#;$; ;u-d-t-[- -%;P-Q-R-R-S-B-z*&;*;Y-=;H=-;;;>;,;';);!;%=d- ", -" ~;{;];u-.;K- ; ;u-d-d-d-t-t-^;/;(;_;;;:;f-}-x-<;w-[;};|;1;2; ", -" A*%=3;4;5;6;u-7;8;u-K- ; ; ; ;^;9;<;0;w-a;b;v-c;d;e;f;g;h; ", -" i;j;k;l;d=m;1;n;d= ;i;o;o;o;o;p;@;d;q;+;r;s;3;h;`=K- ", -" t;u;k;o;e=Z&%=5;*=l;v;v;v;w; ;x;3;p;Z&d=d-i;w; ", -" y;u;z;v;5;A;A;B;u;u;u;j; ;.;i;C;v;z;u;D; ", -" E;E;F;G;H;I;I;I;H;D;J;H;K;F;E;K; ", -" y;L;M;M;N;N;M;N;O;P; ", -" ", -" ", -" ", -" "}; diff --git a/mozilla/browser/app/mozilla.in b/mozilla/browser/app/mozilla.in deleted file mode 100755 index 14efc63d6a3..00000000000 --- a/mozilla/browser/app/mozilla.in +++ /dev/null @@ -1,190 +0,0 @@ -#!/bin/sh -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org Code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -## $Id: mozilla.in,v 1.12.8.1 2005-09-20 21:13:03 dbaron%dbaron.org Exp $ -## -## Usage: -## -## $ mozilla [args] -## -## This script is meant to run the mozilla-bin binary from either -## mozilla/xpfe/bootstrap or mozilla/dist/bin. -## -## The script will setup all the environment voodoo needed to make -## the mozilla-bin binary to work. -## - -moz_pis_startstop_scripts() -{ - MOZ_USER_DIR="%MOZ_USER_DIR%" - # MOZ_PIS_ is the name space for "Mozilla Plugable Init Scripts" - # These variables and there meaning are specified in - # mozilla/xpfe/bootstrap/init.d/README - MOZ_PIS_API=2 - MOZ_PIS_MOZBINDIR="${dist_bin}" - MOZ_PIS_SESSION_PID="$$" - MOZ_PIS_USER_DIR="${MOZ_USER_DIR}" - export MOZ_PIS_API MOZ_PIS_MOZBINDIR MOZ_PIS_SESSION_PID MOZ_PIS_USER_DIR - - case "${1}" in - "start") - for curr_pis in "${dist_bin}/init.d"/S* "${HOME}/${MOZ_USER_DIR}/init.d"/S* ; do - if [ -x "${curr_pis}" ] ; then - case "${curr_pis}" in - *.sh) . "${curr_pis}" ;; - *) "${curr_pis}" "start" ;; - esac - fi - done - ;; - "stop") - for curr_pis in "${HOME}/${MOZ_USER_DIR}/init.d"/K* "${dist_bin}/init.d"/K* ; do - if [ -x "${curr_pis}" ] ; then - case "${curr_pis}" in - *.sh) . "${curr_pis}" ;; - *) "${curr_pis}" "stop" ;; - esac - fi - done - ;; - *) - echo 1>&2 "$0: Internal error in moz_pis_startstop_scripts." - exit 1 - ;; - esac -} - -#uncomment for debugging -#set -x - -moz_libdir=%MOZAPPDIR% -MRE_HOME=%MREDIR% - -# Use run-mozilla.sh in the current dir if it exists -# If not, then start resolving symlinks until we find run-mozilla.sh -found=0 -progname="$0" -curdir=`dirname "$progname"` -progbase=`basename "$progname"` -run_moz="$curdir/run-mozilla.sh" -if test -x "$run_moz"; then - dist_bin="$curdir" - found=1 -else - here=`/bin/pwd` - while [ -h "$progname" ]; do - bn=`basename "$progname"` - cd `dirname "$progname"` - progname=`/bin/ls -l "$bn" | sed -e 's/^.* -> //' ` - if [ ! -x "$progname" ]; then - break - fi - curdir=`dirname "$progname"` - run_moz="$curdir/run-mozilla.sh" - if [ -x "$run_moz" ]; then - cd "$curdir" - dist_bin=`pwd` - run_moz="$dist_bin/run-mozilla.sh" - found=1 - break - fi - done - cd "$here" -fi -if [ $found = 0 ]; then - # Check default compile-time libdir - if [ -x "$moz_libdir/run-mozilla.sh" ]; then - dist_bin="$moz_libdir" - else - echo "Cannot find mozilla runtime directory. Exiting." - exit 1 - fi -fi - -script_args="" -debugging=0 -MOZILLA_BIN="${progbase}-bin" - -if [ "$OSTYPE" = "beos" ]; then - mimeset -F "$MOZILLA_BIN" -fi - -pass_arg_count=0 -while [ $# -gt $pass_arg_count ] -do - case "$1" in - -p | --pure | -pure) - MOZILLA_BIN="${MOZILLA_BIN}.pure" - shift - ;; - -g | --debug) - script_args="$script_args -g" - debugging=1 - shift - ;; - -d | --debugger) - script_args="$script_args -d $2" - shift 2 - ;; - *) - # Move the unrecognized argument to the end of the list. - arg="$1" - shift - set -- "$@" "$arg" - pass_arg_count=`expr $pass_arg_count + 1` - ;; - esac -done - -export MRE_HOME - -## Start addon scripts -moz_pis_startstop_scripts "start" - -if [ $debugging = 1 ] -then - echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@" -fi -"$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@" -exitcode=$? - -## Stop addon scripts -moz_pis_startstop_scripts "stop" - -exit $exitcode -# EOF. diff --git a/mozilla/browser/app/nsBrowserApp.cpp b/mozilla/browser/app/nsBrowserApp.cpp deleted file mode 100644 index c8d8715e36f..00000000000 --- a/mozilla/browser/app/nsBrowserApp.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Brian Ryner - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsXULAppAPI.h" -#ifdef XP_WIN -#include -#include -#endif -#include "nsBuildID.h" - -static const nsXREAppData kAppData = { - sizeof(nsXREAppData), - nsnull, - "Mozilla", - "Firefox", - NS_STRINGIFY(APP_VERSION), - NS_STRINGIFY(BUILD_ID), - "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}", - "Copyright (c) 1998 - 2006 mozilla.org", - NS_XRE_ENABLE_PROFILE_MIGRATOR | - NS_XRE_ENABLE_EXTENSION_MANAGER -}; - -int main(int argc, char* argv[]) -{ - return XRE_main(argc, argv, &kAppData); -} - -#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__) -// We need WinMain in order to not be a console app. This function is -// unused if we are a console application. -int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR args, int ) -{ - // Do the real work. - return main( __argc, __argv ); -} -#endif diff --git a/mozilla/browser/app/profile/channel-prefs.js b/mozilla/browser/app/profile/channel-prefs.js deleted file mode 100755 index c6eeca43953..00000000000 --- a/mozilla/browser/app/profile/channel-prefs.js +++ /dev/null @@ -1,2 +0,0 @@ -#filter substitution -pref("app.update.channel", "@MOZ_UPDATE_CHANNEL@"); diff --git a/mozilla/browser/app/profile/extensions/Extensions.rdf b/mozilla/browser/app/profile/extensions/Extensions.rdf deleted file mode 100644 index 5b98f5dacef..00000000000 --- a/mozilla/browser/app/profile/extensions/Extensions.rdf +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - diff --git a/mozilla/browser/app/profile/extensions/Makefile.in b/mozilla/browser/app/profile/extensions/Makefile.in deleted file mode 100644 index 044061f853f..00000000000 --- a/mozilla/browser/app/profile/extensions/Makefile.in +++ /dev/null @@ -1,47 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2001 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -DIRS = {972ce4c6-7e08-4474-a285-3208198ce6fd} - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/browser/app/profile/extensions/installed-extensions.txt b/mozilla/browser/app/profile/extensions/installed-extensions.txt deleted file mode 100644 index 8be93ed2518..00000000000 --- a/mozilla/browser/app/profile/extensions/installed-extensions.txt +++ /dev/null @@ -1 +0,0 @@ -theme,{972ce4c6-7e08-4474-a285-3208198ce6fd} diff --git a/mozilla/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in b/mozilla/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in deleted file mode 100644 index 9fc0e576dd8..00000000000 --- a/mozilla/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in +++ /dev/null @@ -1,57 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2001 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk -include $(topsrcdir)/config/rules.mk - -DEFINES += -DFIREFOX_VERSION=$(FIREFOX_VERSION) - -FILES := \ - install.rdf \ - $(NULL) - -libs:: - $(PERL) $(MOZILLA_DIR)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $(srcdir)/install.rdf.in > install.rdf - $(INSTALL) $(FILES) $(DIST)/bin/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd} - -install:: - $(SYSINSTALL) $(IFLAGS1) $(FILES) $(DESTDIR)$(mozappdir)/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd} diff --git a/mozilla/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in b/mozilla/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in deleted file mode 100644 index 64aa38e8550..00000000000 --- a/mozilla/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf.in +++ /dev/null @@ -1,44 +0,0 @@ - - -#filter substitution - - - - - {972ce4c6-7e08-4474-a285-3208198ce6fd} - 2.0 - - - - - {ec8030f7-c20a-464f-9b0e-13a3a9e97384} - @FIREFOX_VERSION@ - @FIREFOX_VERSION@ - - - - - Firefox (default) - The default theme - - - true - - true - - - - Gerich and Horlander - Mozilla Contributors - - classic/1.0 - - - diff --git a/mozilla/browser/app/profile/firefox.js b/mozilla/browser/app/profile/firefox.js deleted file mode 100644 index f49be2cbcdb..00000000000 --- a/mozilla/browser/app/profile/firefox.js +++ /dev/null @@ -1,417 +0,0 @@ -/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -// XXX Toolkit-specific preferences should be moved into toolkit.js - -#filter substitution - -# SYNTAX HINTS: dashes are delimiters. Use underscores instead. -# The first character after a period must be alphabetic. - -#ifdef XP_UNIX -#ifndef XP_MACOSX -#define UNIX_BUT_NOT_MAC -#endif -#endif - -pref("startup.homepage_override_url","chrome://browser-region/locale/region.properties"); -pref("general.startup.browser", true); - -pref("browser.chromeURL","chrome://browser/content/"); -pref("browser.hiddenWindowChromeURL", "chrome://browser/content/hiddenWindow.xul"); -pref("xpinstall.dialog.confirm", "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul"); -pref("xpinstall.dialog.progress.skin", "chrome://mozapps/content/extensions/extensions.xul?type=themes"); -pref("xpinstall.dialog.progress.chrome", "chrome://mozapps/content/extensions/extensions.xul?type=extensions"); -pref("xpinstall.dialog.progress.type.skin", "Extension:Manager-themes"); -pref("xpinstall.dialog.progress.type.chrome", "Extension:Manager-extensions"); - -pref("extensions.getMoreExtensionsURL", "chrome://mozapps/locale/extensions/extensions.properties"); -pref("extensions.getMoreThemesURL", "chrome://mozapps/locale/extensions/extensions.properties"); -// Developers can set this to |true| if they are constantly changing files in their -// extensions directory so that the extension system does not constantly think that -// their extensions are being updated and thus reregistered every time the app is -// started. -pref("extensions.ignoreMTimeChanges", false); -// Enables some extra Extension System Logging (can reduce performance) -pref("extensions.logging.enabled", false); - -// App-specific update preferences - -// Whether or not app updates are enabled -pref("app.update.enabled", true); - -// This preference turns on app.update.mode and allows automatic download and -// install to take place. We use a separate boolean toggle for this to make -// the UI easier to construct. -pref("app.update.auto", true); - -// Defines how the Application Update Service notifies the user about updates: -// -// AUM Set to: Minor Releases: Major Releases: -// 0 download no prompt download no prompt -// 1 download no prompt download no prompt if no incompatibilities -// 2 download no prompt prompt -// -// See chart in nsUpdateService.js.in for more details -// -pref("app.update.mode", 1); - -// If set to true, the Update Service will present no UI for any event. -pref("app.update.silent", false); - -// Update service URL: -pref("app.update.url", "https://aus2.mozilla.org/update/1/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/update.xml"); -// URL user can browse to manually if for some reason all update installation -// attempts fail. TODO: Change this URL -pref("app.update.url.manual", "http://www.mozilla.org/products/firefox/"); -// A default value for the "More information about this update" link -// supplied in the "An update is available" page of the update wizard. -pref("app.update.url.details", "chrome://browser-region/locale/region.properties"); - -// User-settable override to app.update.url for testing purposes. -//pref("app.update.url.override", ""); - -// Interval: Time between checks for a new version (in seconds) -// default=1 day -pref("app.update.interval", 86400); -// Interval: Time before prompting the user to download a new version that -// is available (in seconds) default=1 day -pref("app.update.nagTimer.download", 86400); -// Interval: Time before prompting the user to restart to install the latest -// download (in seconds) default=30 minutes -pref("app.update.nagTimer.restart", 1800); -// Interval: When all registered timers should be checked (in milliseconds) -// default=5 seconds -pref("app.update.timer", 600000); - -// Whether or not we show a dialog box informing the user that the update was -// successfully applied. This is off in Firefox by default since we show a -// upgrade start page instead! Other apps may wish to show this UI, and supply -// a whatsNewURL field in their brand.properties that contains a link to a page -// which tells users what's new in this new update. -pref("app.update.showInstalledUI", false); - -// 0 = suppress prompting for incompatibilities if there are updates available -// to newer versions of installed addons that resolve them. -// 1 = suppress prompting for incompatibilities only if there are VersionInfo -// updates available to installed addons that resolve them, not newer -// versions. -pref("app.update.incompatible.mode", 0); - -// Symmetric (can be overridden by individual extensions) update preferences. -// e.g. -// extensions.{GUID}.update.enabled -// extensions.{GUID}.update.url -// extensions.{GUID}.update.interval -// .. etc .. -// -pref("extensions.update.enabled", true); -pref("extensions.update.url", "chrome://mozapps/locale/extensions/extensions.properties"); -pref("extensions.update.interval", 86400); // Check for updates to Extensions and - // Themes every week -// Non-symmetric (not shared by extensions) extension-specific [update] preferences -pref("extensions.getMoreExtensionsURL", "chrome://mozapps/locale/extensions/extensions.properties"); -pref("extensions.getMoreThemesURL", "chrome://mozapps/locale/extensions/extensions.properties"); -pref("extensions.dss.enabled", false); // Dynamic Skin Switching -pref("extensions.dss.switchPending", false); // Non-dynamic switch pending after next - // restart. - -pref("xpinstall.whitelist.add", "update.mozilla.org"); -pref("xpinstall.whitelist.add.103", "addons.mozilla.org"); - -pref("keyword.enabled", true); -pref("keyword.URL", "http://www.google.com/search?btnI=I%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q="); - -pref("general.useragent.locale", "@AB_CD@"); -pref("general.skins.selectedSkin", "classic/1.0"); -pref("general.useragent.extra.firefox", "Firefox/@APP_VERSION@"); - -pref("general.smoothScroll", false); -#ifdef UNIX_BUT_NOT_MAC -pref("general.autoScroll", false); -#else -pref("general.autoScroll", true); -#endif - -// Whether or not the application should check at startup each time if it -// is the default browser. -pref("browser.shell.checkDefaultBrowser", true); - -// 0 = blank, 1 = home (browser.startup.homepage), 2 = last -// XXXBlake Remove this stupid pref -pref("browser.startup.page", 1); -pref("browser.startup.homepage", "resource:/browserconfig.properties"); - -pref("browser.cache.disk.capacity", 50000); -pref("browser.enable_automatic_image_resizing", true); -pref("browser.urlbar.matchOnlyTyped", false); -pref("browser.chrome.site_icons", true); -pref("browser.chrome.favicons", true); -pref("browser.formfill.enable", true); - -pref("browser.download.useDownloadDir", true); -pref("browser.download.folderList", 0); -#ifdef XP_WIN -pref("browser.download.manager.showAlertOnComplete", true); -#else -pref("browser.download.manager.showAlertOnComplete", false); -#endif -pref("browser.download.manager.showAlertInterval", 2000); -pref("browser.download.manager.retention", 2); -pref("browser.download.manager.showWhenStarting", true); -pref("browser.download.manager.useWindow", true); -pref("browser.download.manager.closeWhenDone", false); -pref("browser.download.manager.openDelay", 0); -pref("browser.download.manager.focusWhenStarting", false); -pref("browser.download.manager.flashCount", 2); - -// pointer to the default engine name -pref("browser.search.defaultenginename", "chrome://browser-region/locale/region.properties"); -// pointer to the Web Search url (content area context menu) -pref("browser.search.defaulturl", "chrome://browser-region/locale/region.properties"); -// Ordering of Search Engines in the Engine list. -pref("browser.search.order.1", "chrome://browser-region/locale/region.properties"); -pref("browser.search.order.2", "chrome://browser-region/locale/region.properties"); - -pref("browser.search.param.Google.1.default", "chrome://branding/content/searchconfig.properties"); -pref("browser.search.param.Google.1.custom", "chrome://branding/content/searchconfig.properties"); -pref("browser.search.order.Yahoo.1", "chrome://branding/content/searchconfig.properties"); -pref("browser.search.order.Yahoo.2", "chrome://branding/content/searchconfig.properties"); -pref("browser.search.order.Yahoo", "chrome://branding/content/searchconfig.properties"); - -// basic search popup constraint: minimum sherlock plugin version displayed -// (note: must be a string representation of a float or it'll default to 0.0) -pref("browser.search.basic.min_ver", "0.0"); - -// send ping to the server to update -pref("browser.search.update", true); - -pref("browser.history.grouping", "day"); -pref("browser.sessionhistory.max_entries", 50); - -// handle external links -// 0=default window, 1=current window/tab, 2=new window, 3=new tab in most recent window -pref("browser.link.open_external", 3); - -// handle links targeting new windows -pref("browser.link.open_newwindow", 2); - -// 0: no restrictions - divert everything -// 1: don't divert window.open at all -// 2: don't divert window.open with features -pref("browser.link.open_newwindow.restriction", 2); - -// Tab browser preferences. -pref("browser.tabs.loadInBackground", true); -pref("browser.tabs.loadFolderAndReplace", true); -pref("browser.tabs.opentabfor.middleclick", true); -pref("browser.tabs.opentabfor.urlbar", true); -pref("browser.tabs.loadDivertedInBackground", false); -pref("browser.tabs.loadBookmarksInBackground", false); - -// Smart Browsing prefs -pref("browser.related.enabled", true); -pref("browser.related.autoload", 1); // 0 = Always, 1 = After first use, 2 = Never -pref("browser.related.provider", "http://www-rl.netscape.com/wtgn?"); -pref("browser.related.disabledForDomains", ""); -pref("browser.goBrowsing.enabled", true); - -// Default bookmark sorting -pref("browser.bookmarks.sort.direction", "descending"); -pref("browser.bookmarks.sort.resource", "rdf:http://home.netscape.com/NC-rdf#Name"); - -// Scripts & Windows prefs -pref("dom.disable_open_during_load", true); -pref("javascript.options.showInConsole", false); -// Make the status bar reliably present and unaffected by pages -pref("dom.disable_window_open_feature.status", true); -// This is the pref to control the location bar, change this to true to -// force this instead of or in addition to the status bar - this makes -// the origin of popup windows more obvious to avoid spoofing but we -// cannot do it by default because it affects UE for web applications. -pref("dom.disable_window_open_feature.location", false); -pref("dom.disable_window_status_change", true); -// allow JS to move and resize existing windows -pref("dom.disable_window_move_resize", false); -// prevent JS from monkeying with window focus, etc -pref("dom.disable_window_flip", false); - -pref("browser.trim_user_and_password", true); - -// popups.policy 1=allow,2=reject -pref("privacy.popups.policy", 1); -pref("privacy.popups.usecustom", true); -pref("privacy.popups.firstTime", true); -pref("privacy.popups.showBrowserMessage", true); - -pref("privacy.item.history", true); -pref("privacy.item.formdata", true); -pref("privacy.item.passwords", false); -pref("privacy.item.downloads", true); -pref("privacy.item.cookies", false); -pref("privacy.item.cache", true); -pref("privacy.item.siteprefs", false); -pref("privacy.item.sessions", true); - -pref("privacy.sanitize.sanitizeOnShutdown", false); -pref("privacy.sanitize.promptOnSanitize", true); - -pref("network.proxy.share_proxy_settings", false); // use the same proxy settings for all protocols - -pref("network.cookie.cookieBehavior", 0); // cookies enabled -pref("network.cookie.enableForCurrentSessionOnly", false); -pref("network.cookie.denyRemovedCookies", false); - -// l12n and i18n -pref("intl.accept_languages", "chrome://global/locale/intl.properties"); -// collationOption is only set on linux for japanese. see bug 18338 and 62015 -// we need to check if this pref is still useful. -pref("intl.collationOption", "chrome://global-platform/locale/intl.properties"); -pref("intl.charsetmenu.browser.static", "chrome://global/locale/intl.properties"); -pref("intl.charsetmenu.browser.more1", "chrome://global/locale/intl.properties"); -pref("intl.charsetmenu.browser.more2", "chrome://global/locale/intl.properties"); -pref("intl.charsetmenu.browser.more3", "chrome://global/locale/intl.properties"); -pref("intl.charsetmenu.browser.more4", "chrome://global/locale/intl.properties"); -pref("intl.charsetmenu.browser.more5", "chrome://global/locale/intl.properties"); -pref("intl.charsetmenu.browser.unicode", "chrome://global/locale/intl.properties"); -pref("intl.charset.detector", "chrome://global/locale/intl.properties"); -pref("intl.charset.default", "chrome://global-platform/locale/intl.properties"); -pref("font.language.group", "chrome://global/locale/intl.properties"); -pref("intl.menuitems.alwaysappendaccesskeys","chrome://global/locale/intl.properties"); -pref("intl.menuitems.insertseparatorbeforeaccesskeys","chrome://global/locale/intl.properties"); - -// 0=lines, 1=pages, 2=history , 3=text size -#ifdef XP_MACOSX -// On OS X, if the wheel has one axis only, shift+wheel comes through as a -// horizontal scroll event. Thus, we can't assign anything other than normal -// scrolling to shift+wheel. -pref("mousewheel.withmetakey.action",3); -pref("mousewheel.withmetakey.sysnumlines",false); -pref("mousewheel.withcontrolkey.action",2); -pref("mousewheel.withcontrolkey.sysnumlines",false); -#else -pref("mousewheel.withcontrolkey.action",3); -pref("mousewheel.withcontrolkey.sysnumlines",false); -pref("mousewheel.withshiftkey.action",2); -pref("mousewheel.withshiftkey.sysnumlines",false); -#endif -pref("mousewheel.withaltkey.action",0); -pref("mousewheel.withaltkey.sysnumlines",false); - -pref("profile.allow_automigration", false); // setting to false bypasses automigration in the profile code - -// Customizable toolbar stuff -pref("custtoolbar.personal_toolbar_folder", ""); -pref("browser.throbber.url","chrome://browser-region/locale/region.properties"); - -// pref to control the alert notification -pref("alerts.slideIncrement", 1); -pref("alerts.slideIncrementTime", 10); -pref("alerts.totalOpenTime", 4000); -pref("alerts.height", 50); - -pref("browser.xul.error_pages.enabled", true); - -pref("signon.rememberSignons", true); -pref("signon.expireMasterPassword", false); -pref("signon.SignonFileName", "signons.txt"); - -// We want to make sure mail URLs are handled externally... -pref("network.protocol-handler.external.mailto", true); // for mail -pref("network.protocol-handler.external.news", true); // for news -pref("network.protocol-handler.external.snews", true); // for secure news -pref("network.protocol-handler.external.nntp", true); // also news -// ...without warning dialogs -pref("network.protocol-handler.warn-external.mailto", false); -pref("network.protocol-handler.warn-external.news", false); -pref("network.protocol-handler.warn-external.snews", false); -pref("network.protocol-handler.warn-external.nntp", false); - -// By default, all protocol handlers are exposed. This means that -// the browser will respond to openURL commands for all URL types. -// It will also try to open link clicks inside the browser before -// failing over to the system handlers. -pref("network.protocol-handler.expose-all", true); -pref("network.protocol-handler.expose.mailto", false); -pref("network.protocol-handler.expose.news", false); -pref("network.protocol-handler.expose.snews", false); -pref("network.protocol-handler.expose.nntp", false); - -// Default security warning dialogs to show once. -pref("security.warn_entering_secure.show_once", true); -pref("security.warn_entering_weak.show_once", true); -pref("security.warn_leaving_secure.show_once", true); -pref("security.warn_viewing_mixed.show_once", true); -pref("security.warn_submit_insecure.show_once", true); - -#ifdef XP_UNIX -pref("browser.urlbar.clickSelectsAll", false); -#else -pref("browser.urlbar.clickSelectsAll", true); -#endif - -pref("accessibility.typeaheadfind", false); -pref("accessibility.typeaheadfind.timeout", 5000); -pref("accessibility.typeaheadfind.linksonly", false); -pref("accessibility.typeaheadfind.flashBar", 1); - -// Disable the default plugin for firefox -pref("plugin.default_plugin_disabled", true); - -// plugin finder service url -pref("pfs.datasource.url", "https://pfs.mozilla.org/plugins/PluginFinderService.php?mimetype=%PLUGIN_MIMETYPE%&appID=%APP_ID%&appVersion=%APP_VERSION%&clientOS=%CLIENT_OS%&chromeLocale=%CHROME_LOCALE%"); - -#ifdef XP_WIN -pref("browser.preferences.instantApply", false); -#else -pref("browser.preferences.instantApply", true); -#endif -#ifdef XP_MACOSX -pref("browser.preferences.animateFadeIn", true); -#else -pref("browser.preferences.animateFadeIn", false); -#endif -#ifndef XP_OS2 -pref("browser.display.screen_resolution", 96); -#endif - -pref("browser.download.show_plugins_in_list", true); -pref("browser.download.hide_plugins_without_extensions", true); - -// Setting this pref to |true| forces BiDi UI menu items and keyboard shortcuts -// to be exposed. By default, only expose it for bidi-associated system locales. -pref("bidi.browser.ui", false); diff --git a/mozilla/browser/app/profile/pagethemes.rdf b/mozilla/browser/app/profile/pagethemes.rdf deleted file mode 100644 index 969ea23fa41..00000000000 --- a/mozilla/browser/app/profile/pagethemes.rdf +++ /dev/null @@ -1,39 +0,0 @@ - - - - - diff --git a/mozilla/browser/app/profile/prefs.js b/mozilla/browser/app/profile/prefs.js deleted file mode 100644 index cff73a4bb3c..00000000000 --- a/mozilla/browser/app/profile/prefs.js +++ /dev/null @@ -1,10 +0,0 @@ -# Mozilla User Preferences - -/* Do not edit this file. - * - * If you make changes to this file while the browser is running, - * the changes will be overwritten when the browser exits. - * - * To make a manual change to preferences, you can visit the URL about:config - * For more information, see http://www.mozilla.org/unix/customizing.html#prefs - */ diff --git a/mozilla/browser/app/splash.rc b/mozilla/browser/app/splash.rc deleted file mode 100644 index 38470a0196a..00000000000 --- a/mozilla/browser/app/splash.rc +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Bill Law law@netscape.com - * Jonathan Wilson - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include -#include "nsNativeAppSupportWin.h" - -1 24 "firefox.exe.manifest" - -IDI_APPICON ICON FIREFOX_ICO -IDI_DOCUMENT ICON DOCUMENT_ICO -IDI_APPLICATION ICON FIREFOX_ICO - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STARTMENU_APPNAME, "Firefox" -END - -#ifdef MOZ_STATIC_BUILD - -// XXX This code is copied from resource.h and widget.rc. It's a work-around -// for the limitation that only one resource file can be used in an .exe. We -// should develop a method, for static builds only, to combine multiple .rc -// files into a single .rc file, and then use that to build the single .res -// file for the .exe. - -// We need this cursor for versions of Windows that don't support IDC_HAND, -// namely Win95 and NT4. -#define IDC_SELECTANCHOR 4100 -#define IDC_GRAB 4101 -#define IDC_GRABBING 4102 -#define IDC_CELL 4103 -#define IDC_COPY 4104 -#define IDC_ALIAS 4105 -#define IDC_ZOOMIN 4106 -#define IDC_ZOOMOUT 4107 -#define IDC_COLRESIZE 4108 -#define IDC_ROWRESIZE 4109 -#define IDC_VERTICALTEXT 4110 - -IDC_SELECTANCHOR CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\select.cur" -IDC_GRAB CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\grab.cur" -IDC_GRABBING CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\grabbing.cur" -IDC_CELL CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\cell.cur" -IDC_COPY CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\copy.cur" -IDC_ALIAS CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\aliasb.cur" -IDC_ZOOMIN CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\zoom_in.cur" -IDC_ZOOMOUT CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\zoom_out.cur" -IDC_COLRESIZE CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\col_resize.cur" -IDC_ROWRESIZE CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\row_resize.cur" -IDC_VERTICALTEXT CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\vertical_text.cur" - -#endif diff --git a/mozilla/browser/app/splashos2.rc b/mozilla/browser/app/splashos2.rc deleted file mode 100644 index ef28454557d..00000000000 --- a/mozilla/browser/app/splashos2.rc +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Bill Law law@netscape.com - * IBM Corp. - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include - -// Splash screen dialog ID. -#define IDD_SPLASH 100 - -// Splash screen bitmap ID. -#define IDB_SPLASH 101 - -ICON 1 FIREFOX_ICO - -DLGTEMPLATE IDD_SPLASH DISCARDABLE -BEGIN - DIALOG "", IDD_SPLASH, 0, 0, 390, 261, , FCF_BORDER - BEGIN - END -END - -//BITMAP IDB_SPLASH "splash.bmp" - -#ifdef MOZ_STATIC_BUILD -#include "wdgtos2rc.h" - -POINTER IDC_SELECTANCHOR "..\\..\\widget\\src\\os2\\res\\select.ptr" -POINTER IDC_GRAB "..\\..\\widget\\src\\os2\\res\\grab.ptr" -POINTER IDC_GRABBING "..\\..\\widget\\src\\os2\\res\\grabbing.ptr" -POINTER IDC_CELL "..\\..\\widget\\src\\os2\\res\\cell.ptr" -POINTER IDC_COPY "..\\..\\widget\\src\\os2\\res\\copy.ptr" -POINTER IDC_ALIAS "..\\..\\widget\\src\\os2\\res\\aliasb.ptr" -POINTER IDC_ZOOMIN "..\\..\\widget\\src\\os2\\res\\zoom_in.ptr" -POINTER IDC_ZOOMOUT "..\\..\\widget\\src\\os2\\res\\zoom_out.ptr" - -POINTER IDC_ARROWWAIT "..\\..\\widget\\src\\os2\\res\\arrow_wait.ptr" -POINTER IDC_CROSS "..\\..\\widget\\src\\os2\\res\\crosshair.ptr" -POINTER IDC_HELP "..\\..\\widget\\src\\os2\\res\\help.ptr" - -ICON IDC_DNDURL "..\\..\\widget\\src\\os2\\res\\dndurl.ico" -ICON IDC_DNDTEXT "..\\..\\widget\\src\\os2\\res\\dndtext.ico" -#endif diff --git a/mozilla/browser/base/Makefile.in b/mozilla/browser/base/Makefile.in deleted file mode 100644 index 32f172fb95b..00000000000 --- a/mozilla/browser/base/Makefile.in +++ /dev/null @@ -1,69 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -include $(topsrcdir)/config/config.mk - -include $(topsrcdir)/config/rules.mk - -DEFINES += -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) - -ifndef MOZ_BRANDING_DIRECTORY -DEFINES += -DMOZ_USE_GENERIC_BRANDING -endif - -ifneq (,$(filter windows gtk2 mac cocoa, $(MOZ_WIDGET_TOOLKIT))) -DEFINES += -DHAVE_SHELL_SERVICE=1 -endif - -ifndef MOZ_BRANDING_DIRECTORY -libs locale:: - $(INSTALL) $(srcdir)/content/browserconfig.properties $(DIST)/bin - -install:: - $(SYSINSTALL) $(srcdir)/content/browserconfig.properties $(DESTDIR)$(mozappdir) -endif - -ifneq (,$(filter windows mac cocoa, $(MOZ_WIDGET_TOOLKIT))) -DEFINES += -DCONTEXT_COPY_IMAGE_CONTENTS=1 -endif diff --git a/mozilla/browser/base/branding/about.png b/mozilla/browser/base/branding/about.png deleted file mode 100644 index 0009036df42..00000000000 Binary files a/mozilla/browser/base/branding/about.png and /dev/null differ diff --git a/mozilla/browser/base/branding/aboutCredits.png b/mozilla/browser/base/branding/aboutCredits.png deleted file mode 100644 index 33abd54daa5..00000000000 Binary files a/mozilla/browser/base/branding/aboutCredits.png and /dev/null differ diff --git a/mozilla/browser/base/branding/aboutFooter.png b/mozilla/browser/base/branding/aboutFooter.png deleted file mode 100644 index 94d9124a350..00000000000 Binary files a/mozilla/browser/base/branding/aboutFooter.png and /dev/null differ diff --git a/mozilla/browser/base/branding/icon64.png b/mozilla/browser/base/branding/icon64.png deleted file mode 100644 index 34a8eec2667..00000000000 Binary files a/mozilla/browser/base/branding/icon64.png and /dev/null differ diff --git a/mozilla/browser/base/branding/searchconfig.properties b/mozilla/browser/base/branding/searchconfig.properties deleted file mode 100644 index 3431e057e63..00000000000 --- a/mozilla/browser/base/branding/searchconfig.properties +++ /dev/null @@ -1,6 +0,0 @@ -# Do NOT localize or otherwise change these values -browser.search.param.Google.1.custom=client=firefox -browser.search.param.Google.1.default=client=firefox -browser.search.param.Google.release=rls=%S:%S:unofficial - -browser.search.param.Yahoo.release=rls=%S:%S:unofficial \ No newline at end of file diff --git a/mozilla/browser/base/branding/uninstall.properties b/mozilla/browser/base/branding/uninstall.properties deleted file mode 100644 index d6df59cf92c..00000000000 --- a/mozilla/browser/base/branding/uninstall.properties +++ /dev/null @@ -1,6 +0,0 @@ -# These values are used to construct the registry keys for the Add/Remove -# Programs dialog under Windows. They must be kept in sync with the values -# used by the installer. -fileUninstall=UninstallDeerPark.exe -URLInfoAbout=http://www.mozilla.org/ -URLUpdateInfo=http://www.mozilla.org/products/firefox/ diff --git a/mozilla/browser/base/content/aboutDialog.css b/mozilla/browser/base/content/aboutDialog.css deleted file mode 100644 index 202b06f8663..00000000000 --- a/mozilla/browser/base/content/aboutDialog.css +++ /dev/null @@ -1,58 +0,0 @@ - #aboutDialog { - padding: 0px 0px 10px 0px; - width: 299px; - } - - #clientBox { - background-image: url("chrome://branding/content/about.png"); - background-repeat: no-repeat; - background-color: #FFFFFF; - padding-top: 203px; - color: #000000; - } - - #brandName { - font-weight: bold; font-size: larger; - } - - #detailsBox { - padding: 8px 10px 0px 8px; - } - - #userAgent { - margin: 3px 10px 0px 5px; - background-color: #FFFFFF; - color: #000000; - padding: 1px 0px 0px 3px; - -moz-appearance: none; - overflow: hidden; - border: 0px; - } - - #groove { - margin-top: 0px; - } - - #creditsIframe { - cursor: default; - -moz-user-select: none; - border: 0px; - } - - #version { - font-weight: bold; - color: #909090; - margin: 1em 0px 10px 17px; - } - - #copyright { - margin: 0px 0px 3px 16px; - } - - button[dlgtype="extra2"] { - margin-left: 13px; - } - - button[dlgtype="accept"] { - margin-right: 13px; - } diff --git a/mozilla/browser/base/content/aboutDialog.js b/mozilla/browser/base/content/aboutDialog.js deleted file mode 100644 index aa0278f22ee..00000000000 --- a/mozilla/browser/base/content/aboutDialog.js +++ /dev/null @@ -1,86 +0,0 @@ -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is Mozilla Firebird about dialog. -# -# The Initial Developer of the Original Code is -# Blake Ross (blaker@netscape.com). -# Portions created by the Initial Developer are Copyright (C) 2002 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the LGPL or the GPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** --> - -var gSelectedPage = 0; - -function init(aEvent) -{ - if (aEvent.target != document) - return; - var userAgentField = document.getElementById("userAgent"); - userAgentField.value = navigator.userAgent; - - var button = document.documentElement.getButton("extra2"); - button.setAttribute("label", document.documentElement.getAttribute("creditslabel")); - button.addEventListener("command", switchPage, false); - - document.documentElement.getButton("accept").focus(); -#ifdef XP_MACOSX - // it may not be sized at this point, and we need its width to calculate its position - window.sizeToContent(); - window.moveTo((screen.availWidth / 2) - (window.outerWidth / 2), screen.availHeight / 5); -#endif -} - -function uninit(aEvent) -{ - if (aEvent.target != document) - return; - var iframe = document.getElementById("creditsIframe"); - iframe.setAttribute("src", ""); -} - -function switchPage(aEvent) -{ - var button = aEvent.target; - if (button.localName != "button") - return; - - var iframe = document.getElementById("creditsIframe"); - if (gSelectedPage == 0) { - iframe.setAttribute("src", "chrome://browser/content/credits.xhtml"); - button.setAttribute("label", document.documentElement.getAttribute("aboutlabel")); - gSelectedPage = 1; - } - else { - iframe.setAttribute("src", ""); - button.setAttribute("label", document.documentElement.getAttribute("creditslabel")); - gSelectedPage = 0; - } - var modes = document.getElementById("modes"); - modes.setAttribute("selectedIndex", gSelectedPage); -} - diff --git a/mozilla/browser/base/content/aboutDialog.xul b/mozilla/browser/base/content/aboutDialog.xul deleted file mode 100644 index f15f1047a3b..00000000000 --- a/mozilla/browser/base/content/aboutDialog.xul +++ /dev/null @@ -1,96 +0,0 @@ - - -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is Mozilla Firebird about dialog. -# -# The Initial Developer of the Original Code is -# Blake Ross (blaker@netscape.com). -# Portions created by the Initial Developer are Copyright (C) 2002 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the LGPL or the GPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** --> - - - - - -%brandDTD; - -%aboutDialogDTD; -]> - -#ifdef XP_MACOSX - -#endif - - - - - - - -
- -
- -
-

&brandFullName;™ -
&brandMotto;
-

- -
-
    -
  • Josh Aas
  • -
  • Robert Accettura
  • -
  • Christopher Aillon
  • -
  • Marc Attinasi
  • -
  • Arvid Axelsson
  • -
  • Mitchell Baker
  • -
  • David Baron
  • -
  • Chris Beard
  • -
  • Mike Beltzner
  • -
  • Uri Bernstein
  • -
  • Daniel Burka
  • -
  • Andrew Cave
  • -
  • Pierre Chanial
  • -
  • Bob Clary
  • -
  • Chris Cooper
  • -
  • Mike Connor
  • -
  • Catherine Corre
  • -
  • Chris Crews
  • -
  • André Dahlqvist
  • -
  • Bart Decrem
  • -
  • Sébastien Delahaye
  • -
  • Stephen Desroches
  • -
  • Jeremy Dolan
  • -
  • Asa Dotzler
  • -
  • Ali Ebrahim
  • -
  • Rafael Ebron
  • -
  • Brendan Eich
  • -
  • Darin Fisher
  • -
  • Erik Fornoff
  • -
  • Simon Fraser
  • -
  • Steven Garrity
  • -
  • Kevin Gerich
  • -
  • Ben Goodger
  • -
  • Jonathan Granrose
  • -
  • Jasper Hauser
  • -
  • Steven Hellings
  • -
  • Joe Hewitt
  • -
  • Jon Hicks
  • -
  • Ian Hickson
  • -
  • Chris Hofmann
  • -
  • Stephen Horlander
  • -
  • Ed Hume
  • -
  • David Hyatt
  • -
  • Logan Ingalls
  • -
  • David P. James
  • -
  • Glen Johnson
  • -
  • Blake Kaplan
  • -
  • Michael Kaply
  • -
  • R.J. Keller
  • -
  • John Keiser
  • -
  • Jason Kersey
  • -
  • Marcia Knous
  • -
  • Aaron Leventhal
  • -
  • Will Levine
  • -
  • Sarah Liberman
  • -
  • Scott MacGregor
  • -
  • Daniel Matejka
  • -
  • Nigel McFarlane
  • -
  • Myk Melez
  • -
  • Mark Mentovai
  • -
  • Steven Michaud
  • -
  • Bernd Mielke
  • -
  • Simon Montagu
  • -
  • Masayuki Nakano
  • -
  • Noririty
  • -
  • Leaf Nunes
  • -
  • Robert O'Callahan
  • -
  • Mats Palmgren
  • -
  • Simon Paquet
  • -
  • Jay Patel
  • -
  • Igor Pavlov, 7-Zip
  • -
  • Chase Phillips
  • -
  • Mike Pinkerton
  • -
  • Eric Pollmann
  • -
  • Rick Potts
  • -
  • Asaf Romano
  • -
  • Doron Rosenberg
  • -
  • Blake Ross
  • -
  • Jesse Ruderman
  • -
  • Brian Ryner
  • -
  • Andrew Schultz
  • -
  • Gavin Sharp
  • -
  • Mike Shaver
  • -
  • Dave Shea
  • -
  • Jungshik Shin
  • -
  • Jonas Sicking
  • -
  • Benjamin Smedberg
  • -
  • Seth Spitzer
  • -
  • Alan Starr
  • -
  • Johnny Stenback
  • -
  • Luke Stone
  • -
  • Robert Strong
  • -
  • David Tenser
  • -
  • Dean Tessman
  • -
  • Namachivayam Thirumazhusai
  • -
  • Ben Turner
  • -
  • Peter Van der Beken
  • -
  • Peter van der Woude
  • -
  • Jan Varga
  • -
  • Daniel Veditz
  • -
  • Vladimir Vukicevic
  • -
  • Jeff Walden
  • -
  • Tracy Walker
  • -
  • Martijn Wargers
  • -
  • Chris Waterson
  • -
  • Steffen Wilberg
  • -
  • Boris Zbarsky
  • -
- - &credit.translation; -
- - -
-

&credit.thanks;

-
    -
  • silverorange
  • -
  • Spark PR
  • -
  • MozillaZine Community
  • -
  • MozillaZine
  • -
  • MozDev
  • -
-
- -

&credit.poweredByGecko;

- -

- &brandFullName;™ &license.part0; copyright ©1998-2006 &license.part1; - &license.contrib;, - &license.part2; - Mozilla Public License - &license.and; - Netscape Public License&license.part3;

- -

- Portions of this software are Copyright ©1994 The Regents of the - University of California. All Rights Reserved.

- -

- This software may contain portions that are Copyright ©1998-2005 - SupportSoft, Inc. All Rights Reserved.

- -

- Mozilla Firefox™ and the Firefox logo are trademarks of the Mozilla - Foundation. You are not granted rights or licenses to the trademarks - of the Mozilla Foundation or any party, including without limitation the - Firefox name or logo.

- -

- U.S. GOVERNMENT END USERS. The Software is a “commercial item,” - as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of - “commercial computer software” and “commercial computer software - documentation,” as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). - Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through - 227.7202-4 (June 1995), all U.S. Government End Users acquire the - Software with only those rights set forth herein.

- -
- -
- -
- - - diff --git a/mozilla/browser/base/content/downloadManagerOverlay.xul b/mozilla/browser/base/content/downloadManagerOverlay.xul deleted file mode 100644 index 82572aef15b..00000000000 --- a/mozilla/browser/base/content/downloadManagerOverlay.xul +++ /dev/null @@ -1,50 +0,0 @@ - -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is Mozilla.org code. -# -# The Initial Developer of the Original Code is Asaf Romano -# Portions created by the Initial Developer are Copyright (C) 2005 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Asaf Romano -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - - - - - - - -#include browserMountPoints.inc - - - - diff --git a/mozilla/browser/base/content/extensionsManagerOverlay.xul b/mozilla/browser/base/content/extensionsManagerOverlay.xul deleted file mode 100644 index fae3991c156..00000000000 --- a/mozilla/browser/base/content/extensionsManagerOverlay.xul +++ /dev/null @@ -1,50 +0,0 @@ - -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is Mozilla.org code. -# -# The Initial Developer of the Original Code is Asaf Romano -# Portions created by the Initial Developer are Copyright (C) 2005 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Asaf Romano -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - - - - - - - -#include browserMountPoints.inc - - - - diff --git a/mozilla/browser/base/content/feedview.js b/mozilla/browser/base/content/feedview.js deleted file mode 100644 index c4a48609f14..00000000000 --- a/mozilla/browser/base/content/feedview.js +++ /dev/null @@ -1,208 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Feedview for Firefox. - * - * The Initial Developer of the Original Code is - * Tom Germeau . - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Ben Goodger - * Myk Melez - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var FeedView = { - /** - * Converts a W3C-DTF (subset of ISO 8601) date string to an IETF date string. - * @param dateString - * A string that may contain a W3C-DTF date string - * @returns an IETF date string - */ - _W3CToIETFDate: function(dateString) { - // W3C-DTF is described in this note: http://www.w3.org/TR/NOTE-datetime - // IETF is obtained via the Date object's toUTCString() method. The object's - // toString() method is insufficient because it spells out timezones on Win32 - // (f.e. "Pacific Standard Time" instead of "PST"), which Mail doesn't grok. - // For info, see http://lxr.mozilla.org/mozilla/source/js/src/jsdate.c#1654. - - const HOURS_TO_MINUTES = 60; - const MINUTES_TO_SECONDS = 60; - const SECONDS_TO_MILLISECONDS = 1000; - const MINUTES_TO_MILLISECONDS = MINUTES_TO_SECONDS * SECONDS_TO_MILLISECONDS; - const HOURS_TO_MILLISECONDS = HOURS_TO_MINUTES * MINUTES_TO_MILLISECONDS; - - var parts = dateString.match(/(\d\d\d\d)(-(\d\d))?(-(\d\d))?(T(\d\d):(\d\d)(:(\d\d)(\.(\d+))?)?(Z|([+-])(\d\d):(\d\d))?)?/); - - // Here's an example of a W3C-DTF date string and what .match returns for it. - // date: 2003-05-30T11:18:50.345-08:00 - // date.match returns array values: - // 0: 2003-05-30T11:18:50-08:00, - // 1: 2003, - // 2: -05, - // 3: 05, - // 4: -30, - // 5: 30, - // 6: T11:18:50-08:00, - // 7: 11, - // 8: 18, - // 9: :50, - // 10: 50, - // 11: .345, - // 12: 345, - // 13: -08:00, - // 14: -, - // 15: 08, - // 16: 00 - - // Create a Date object from the date parts. Note that the Date object - // apparently can't deal with empty string parameters in lieu of numbers, - // so optional values (like hours, minutes, seconds, and milliseconds) - // must be forced to be numbers. - var date = new Date(parts[1], parts[3]-1, parts[5], parts[7] || 0, - parts[8] || 0, parts[10] || 0, parts[12] || 0); - - // We now have a value that the Date object thinks is in the local timezone - // but which actually represents the date/time in the remote timezone - // (f.e. the value was "10:00 EST", and we have converted it to "10:00 PST" - // instead of "07:00 PST"). We need to correct that. To do so, we're going - // to add the offset between the remote timezone and UTC (to convert the value - // to UTC), then add the offset between UTC and the local timezone (to convert - // the value to the local timezone). - - // Ironically, W3C-DTF gives us the offset between UTC and the remote timezone - // rather than the other way around, while the getTimezoneOffset() method - // of a Date object gives us the offset between the local timezone and UTC - // rather than the other way around. Both of these are the additive inverse - // (i.e. -x for x) of what we want, so we have to invert them to use them - // by multipying by -1 - // (f.e. if "the offset between UTC and the remote timezone" is -5 hours, - // then "the offset between the remote timezone and UTC" is -5*-1 = 5 hours). - - // Note that if the timezone portion of the date/time string is absent - // (which violates W3C-DTF, although ISO 8601 allows it), we assume the value - // to be in UTC. - - // The offset between the remote timezone and UTC in milliseconds. - var remoteToUTCOffset = 0; - if (parts[13] && parts[13] != "Z") { - var direction = (parts[14] == "+" ? 1 : -1); - if (parts[15]) - remoteToUTCOffset += direction * parts[15] * HOURS_TO_MILLISECONDS; - if (parts[16]) - remoteToUTCOffset += direction * parts[16] * MINUTES_TO_MILLISECONDS; - } - remoteToUTCOffset = remoteToUTCOffset * -1; // invert it - - // The offset between UTC and the local timezone in milliseconds. - var UTCToLocalOffset = date.getTimezoneOffset() * MINUTES_TO_MILLISECONDS; - UTCToLocalOffset = UTCToLocalOffset * -1; // invert it - - date.setTime(date.getTime() + remoteToUTCOffset + UTCToLocalOffset); - - return date.toUTCString(); - }, - - /** - * Normalizes date strings embedded in the feed into a common format. - */ - _initializeDates: function() { - // Normalize date formatting for all feed entries - var divs = document.getElementsByTagName("div"); - for (var i = 0; i < divs.length; i++) { - var d = divs[i].getAttribute("date"); - dump("*** D = " + d + "\n"); - if (d) { - // If the date looks like it's in W3C-DTF format, convert it into - // an IETF standard date string. - if (d.search(/^\d\d\d\d/) != -1) - d = this._W3CToIETFDate(d); - - d = new Date(d); - - // If the date could be parsed... - if (d instanceof Date) { - // XXX It would be nicer to say day = "Today" or "Yesterday". - var day = d.toGMTString(); - day = day.substring(0, 11); - - function padZeros(num) { - return num < 10 ? "0" + num : num; - } - divs[i].getElementsByTagName("span")[0].textContent = - day + " @ " + padZeros(d.getHours()) + ":" + padZeros(d.getMinutes()); - } - } - } - }, - - /** - * Returns the value of a boolean preference - * @param name - * The name of the preference - * @returns The value of the preference - */ - _getBooleanPref: function(name) { - return document.getElementById("data").getAttribute(name) == "true"; - }, - - /** - * Returns the value of an integer preference - * @param name - * The name of the preference - * @returns The value of the preference - */ - _getIntegerPref: function(name) { - return parseInt(document.getElementById("data").getAttribute(name)); - }, - - /** - * Reload the page after an interval - */ - reload: function() { - location.reload(); - }, - - /** - * Initialize the feed view - */ - init: function() { - // Hide the menu if the user chose to have it closed - if (!this._getBooleanPref("showmenu")) - document.getElementById("menubox").style.display = "none"; - - // Normalize the date formats - this._initializeDates(); - - // Set up the auto-reload timer. - // The timer loads every browser.feedview.reloadInterval minutes. - // It is disabled if the value of that preference is 0. - var reloadInterval = this._getIntegerPref("reloadinterval") || 0; - if (reloadInterval > 0) - setTimeout("FeedView.reload()", reloadInterval * 60 * 1000); - } -}; diff --git a/mozilla/browser/base/content/feedview.xsl b/mozilla/browser/base/content/feedview.xsl deleted file mode 100644 index 9929fec0a0a..00000000000 --- a/mozilla/browser/base/content/feedview.xsl +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - <xsl:value-of select="$title"/> - - - - - - - - - - - - - - - - -

- -

- -
- -
-
- - - -
- - - - - - - - - - -

- - -

-
-
- - - -

- - - -

-
- -
-
- -
- - - - - - -

-
- - - - - - - - - -

-

-
- - - -

- - - -

-
- -
-
- -
- - - - - - -

-
- - - - - - - - - -

-

-
- -
diff --git a/mozilla/browser/base/content/global-scripts.inc b/mozilla/browser/base/content/global-scripts.inc deleted file mode 100644 index c34cb30d152..00000000000 --- a/mozilla/browser/base/content/global-scripts.inc +++ /dev/null @@ -1,48 +0,0 @@ -# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is Mozilla.org Code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2001 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Ben Goodger (v2.0) -# Blake Ross -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - - - -# All sets except for popupsets (commands, keys, stringbundles and broadcasters) *must* go into the -# browser-sets.inc file for sharing with hiddenWindow.xul. -#include browser-sets.inc - -# The hacky hidden tree used by the Go menu to build items. -#include browser-gotreehack.inc - -# The entire main menubar is placed into browser-menubar.inc, so that it can be shared by -# hiddenWindow.xul. -#include browser-menubar.inc - - diff --git a/mozilla/browser/base/content/metaData.js b/mozilla/browser/base/content/metaData.js deleted file mode 100644 index 52835a1fb8b..00000000000 --- a/mozilla/browser/base/content/metaData.js +++ /dev/null @@ -1,606 +0,0 @@ -# -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is this file as it was released on January 3, 2001. -# -# The Initial Developer of the Original Code is -# Jonas Sicking. -# Portions created by the Initial Developer are Copyright (C) 2000 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Jonas Sicking (Original Author) -# Gervase Markham -# Heikki Toivonen -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -const XLinkNS = "http://www.w3.org/1999/xlink"; -const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; -const XMLNS = "http://www.w3.org/XML/1998/namespace"; -const XHTMLNS = "http://www.w3.org/1999/xhtml"; -var gMetadataBundle; -var gLangBundle; -var gRegionBundle; -var nodeView; -var htmlMode = false; - -var onLink = false; -var onImage = false; -var onInsDel = false; -var onQuote = false; -var onMisc = false; -var onTable = false; -var onTitle = false; -var onLang = false; - -const nsICacheService = Components.interfaces.nsICacheService; -const cacheService = Components.classes["@mozilla.org/network/cache-service;1"] - .getService(nsICacheService); -var httpCacheSession = cacheService.createSession("HTTP", 0, true); -httpCacheSession.doomEntriesIfExpired = false; -var ftpCacheSession = cacheService.createSession("FTP", 0, true); -ftpCacheSession.doomEntriesIfExpired = false; - - -function onLoad() -{ - gMetadataBundle = document.getElementById("bundle_metadata"); - gLangBundle = document.getElementById("bundle_languages"); - gRegionBundle = document.getElementById("bundle_regions"); - - showMetadataFor(window.arguments[0]); - nodeView = window.arguments[0].ownerDocument.defaultView; -} - -function showMetadataFor(elem) -{ - // skip past non-element nodes - while (elem && elem.nodeType != Node.ELEMENT_NODE) - elem = elem.parentNode; - - if (!elem) { - alert(gMetadataBundle.getString("unableToShowProps")); - window.close(); - } - - if (elem.ownerDocument.getElementsByName && !elem.ownerDocument.namespaceURI) - htmlMode = true; - - // htmllocalname is "" if it's not an html tag, or the name of the tag if it is. - var htmllocalname = ""; - if (isHTMLElement(elem,"")) { - htmllocalname = elem.localName.toLowerCase(); - } - - // We only look for images once - checkForImage(elem, htmllocalname); - - // Walk up the tree, looking for elements of interest. - // Each of them could be at a different level in the tree, so they each - // need their own boolean to tell us to stop looking. - while (elem && elem.nodeType == Node.ELEMENT_NODE) { - htmllocalname = ""; - if (isHTMLElement(elem,"")) { - htmllocalname = elem.localName.toLowerCase(); - } - - if (!onLink) checkForLink(elem, htmllocalname); - if (!onInsDel) checkForInsDel(elem, htmllocalname); - if (!onQuote) checkForQuote(elem, htmllocalname); - if (!onTable) checkForTable(elem, htmllocalname); - if (!onTitle) checkForTitle(elem, htmllocalname); - if (!onLang) checkForLang(elem, htmllocalname); - - elem = elem.parentNode; - } - - // Decide which sections to show - var onMisc = onTable || onTitle || onLang; - if (!onMisc) hideNode("misc-sec"); - if (!onLink) hideNode("link-sec"); - if (!onImage) hideNode("image-sec"); - if (!onInsDel) hideNode("insdel-sec"); - if (!onQuote) hideNode("quote-sec"); - - // Fix the Misc section visibilities - if (onMisc) { - if (!onTable) hideNode("misc-tblsummary"); - if (!onLang) hideNode("misc-lang"); - if (!onTitle) hideNode("misc-title"); - } - - // Get rid of the "No properties" message. This is a backstop - - // it should really never show, as long as nsContextMenu.js's - // checking doesn't get broken. - if (onLink || onImage || onInsDel || onQuote || onMisc) - hideNode("no-properties") -} - - -function checkForImage(elem, htmllocalname) -{ - var img; - var imgType; // "img" = - // "object" = - // "input" = - // "background" = css background (to be added later) - var ismap = false; - - if (htmllocalname === "img") { - img = elem; - imgType = "img"; - - } else if (htmllocalname === "object" && - elem.type.substring(0,6) == "image/" && - elem.data) { - img = elem; - imgType = "object"; - - } else if (htmllocalname === "input" && - elem.type.toUpperCase() == "IMAGE") { - img = elem; - imgType = "input"; - - } else if (htmllocalname === "area" || htmllocalname === "a") { - - // Clicked in image map? - var map = elem; - ismap = true; - setAlt(map); - - while (map && map.nodeType == Node.ELEMENT_NODE && !isHTMLElement(map,"map") ) - map = map.parentNode; - - if (map && map.nodeType == Node.ELEMENT_NODE) { - img = getImageForMap(map); - var imgLocalName = img && img.localName.toLowerCase(); - if (imgLocalName == "img" || imgLocalName == "object") - imgType = imgLocalName; - } - } - - if (img) { - - var imgURL = imgType == "object" ? img.data : img.src; - setInfo("image-url", imgURL); - var size = getSize(imgURL); - - if (size != -1) { - var kbSize = size / 1024; - kbSize = Math.round(kbSize*100)/100; - setInfo("image-filesize", gMetadataBundle.getFormattedString("imageSize", [kbSize, size])); - } else { - setInfo("image-filesize", gMetadataBundle.getString("imageSizeUnknown")); - } - if ("width" in img && img.width != "") { - setInfo("image-width", gMetadataBundle.getFormattedString("imageWidth", [ img.width ])); - setInfo("image-height", gMetadataBundle.getFormattedString("imageHeight", [ img.height ])); - } - else { - setInfo("image-width", ""); - setInfo("image-height", ""); - } - - if (imgType == "img") { - setInfo("image-desc", getAbsoluteURL(img.longDesc, img)); - } else { - setInfo("image-desc", ""); - } - - onImage = true; - } - - if (!ismap) { - if (imgType == "img" || imgType == "input") { - setAlt(img); - } else { - hideNode("image-alt"); - } - } -} - -function checkForLink(elem, htmllocalname) -{ - if ((htmllocalname === "a" && elem.href != "") || - htmllocalname === "area") { - - setInfo("link-lang", convertLanguageCode(elem.getAttribute("hreflang"))); - setInfo("link-url", elem.href); - setInfo("link-type", elem.getAttribute("type")); - setInfo("link-rel", elem.getAttribute("rel")); - setInfo("link-rev", elem.getAttribute("rev")); - - var target = elem.target; - - switch (target) { - case "_top": - setInfo("link-target", gMetadataBundle.getString("sameWindowText")); - break; - case "_parent": - setInfo("link-target", gMetadataBundle.getString("parentFrameText")); - break; - case "_blank": - setInfo("link-target", gMetadataBundle.getString("newWindowText")); - break; - case "": - case "_self": - if (elem.ownerDocument.defaultView) { - if (elem.ownerDocument != elem.ownerDocument.defaultView.content.document) - setInfo("link-target", gMetadataBundle.getString("sameFrameText")); - else - setInfo("link-target", gMetadataBundle.getString("sameWindowText")); - } else { - hideNode("link-target"); - } - break; - default: - setInfo("link-target", "\"" + target + "\""); - } - - onLink = true; - } - - else if (elem.getAttributeNS(XLinkNS,"href") != "") { - setInfo("link-url", getAbsoluteURL(elem.getAttributeNS(XLinkNS,"href"),elem)); - setInfo("link-lang", ""); - setInfo("link-type", ""); - setInfo("link-rel", ""); - setInfo("link-rev", ""); - - switch (elem.getAttributeNS(XLinkNS,"show")) { - case "embed": - setInfo("link-target", gMetadataBundle.getString("embeddedText")); - break; - case "new": - setInfo("link-target", gMetadataBundle.getString("newWindowText")); - break; - case "": - case "replace": - if (elem.ownerDocument != elem.ownerDocument.defaultView.content.document) - setInfo("link-target", gMetadataBundle.getString("sameFrameText")); - else - setInfo("link-target", gMetadataBundle.getString("sameWindowText")); - break; - default: - setInfo("link-target", ""); - break; - } - - onLink = true; - } -} - -function checkForInsDel(elem, htmllocalname) -{ - if ((htmllocalname === "ins" || htmllocalname === "del") && - (elem.cite || elem.dateTime)) { - setInfo("insdel-cite", getAbsoluteURL(elem.cite, elem)); - setInfo("insdel-date", elem.dateTime); - onInsDel = true; - } -} - - -function checkForQuote(elem, htmllocalname) -{ - if ((htmllocalname === "q" || htmllocalname === "blockquote") && elem.cite) { - setInfo("quote-cite", getAbsoluteURL(elem.cite, elem)); - onQuote = true; - } -} - -function checkForTable(elem, htmllocalname) -{ - if (htmllocalname === "table" && elem.summary) { - setInfo("misc-tblsummary", elem.summary); - onTable = true; - } -} - -function checkForLang(elem, htmllocalname) -{ - if ((htmllocalname && elem.lang) || elem.getAttributeNS(XMLNS, "lang")) { - var abbr; - if (htmllocalname && elem.lang) - abbr = elem.lang; - else - abbr = elem.getAttributeNS(XMLNS, "lang"); - - setInfo("misc-lang", convertLanguageCode(abbr)); - onLang = true; - } -} - -function checkForTitle(elem, htmllocalname) -{ - if (htmllocalname && elem.title) { - setInfo("misc-title", elem.title); - onTitle = true; - } -} - -/* - * Set text of node id to value - * if value="" the node with specified id is hidden. - * Node should be have one of these forms - * - * - */ -function setInfo(id, value) -{ - if (!value) { - hideNode(id); - return; - } - - var node = document.getElementById(id+"-text"); - - if (node.namespaceURI == XULNS && node.localName == "label" || - (node.namespaceURI == XULNS && node.localName == "textbox")) { - node.setAttribute("value",value); - - } else if (node.namespaceURI == XULNS && node.localName == "description") { - while (node.hasChildNodes()) - node.removeChild(node.firstChild); - node.appendChild(node.ownerDocument.createTextNode(value)); - } -} - -// Hide node with specified id -function hideNode(id) -{ - var style = document.getElementById(id).getAttribute("style"); - document.getElementById(id).setAttribute("style", "display:none;" + style); -} - -/* - * Find or which uses an imagemap. - * If more then one object is found we can't determine which one - * was clicked. - * - * This code has to be changed once bug 1882 is fixed. - * Once bug 72527 is fixed this code should use the .images collection. - */ -function getImageForMap(map) -{ - var mapuri = "#" + map.getAttribute("name"); - var multipleFound = false; - var img; - - var list = getHTMLElements(map.ownerDocument, "img"); - for (var i=0; i < list.length; i++) { - if (list.item(i).getAttribute("usemap") == mapuri) { - if (img) { - multipleFound = true; - break; - } else { - img = list.item(i); - imgType = "img"; - } - } - } - - list = getHTMLElements(map.ownerDocument, "object"); - for (i = 0; i < list.length; i++) { - if (list.item(i).getAttribute("usemap") == mapuri) { - if (img) { - multipleFound = true; - break; - } else { - img = list.item(i); - imgType = "object"; - } - } - } - - if (multipleFound) - img = null; - - return img; -} - -/* - * Takes care of XMLBase and - * url is the possibly relative url. - * node is the node where the url was given (needed for XMLBase) - * - * This function is called in many places as a workaround for bug 72524 - * Once bug 72522 is fixed this code should use the Node.baseURI attribute - * - * for node==null or url=="", empty string is returned - */ -function getAbsoluteURL(url, node) -{ - if (!url || !node) - return ""; - - var urlArr = new Array(url); - var doc = node.ownerDocument; - - if (node.nodeType == Node.ATTRIBUTE_NODE) - node = node.ownerElement; - - while (node && node.nodeType == Node.ELEMENT_NODE) { - if (node.getAttributeNS(XMLNS, "base") != "") - urlArr.unshift(node.getAttributeNS(XMLNS, "base")); - - node = node.parentNode; - } - - // Look for a . - var baseTags = getHTMLElements(doc,"base"); - if (baseTags && baseTags.length) { - urlArr.unshift(baseTags[baseTags.length - 1].getAttribute("href")); - } - - // resolve everything from bottom up, starting with document location - var ioService = Components.classes["@mozilla.org/network/io-service;1"] - .getService(Components.interfaces.nsIIOService); - var URL = ioService.newURI(doc.location.href, null, null); - for (var i=0; i - -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is this file as it was released on January 3, 2001. -# -# The Initial Developer of the Original Code is -# Jonas Sicking. -# Portions created by the Initial Developer are Copyright (C) 2000 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Jonas Sicking (Original Author) -# Gervase Markham -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mozilla/browser/base/content/search.xml b/mozilla/browser/base/content/search.xml deleted file mode 100644 index 28dac35b29b..00000000000 --- a/mozilla/browser/base/content/search.xml +++ /dev/null @@ -1,495 +0,0 @@ - - -# -*- Mode: HTML -*- -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org browser. -# -# The Initial Developer of the Original Code is -# Joe Hewitt. -# Portions created by the Initial Developer are Copyright (C) 2003 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Pierre Chanial V 2.0 (p_ch@verizon.net) -# Gavin Sharp (gavin@gavinsharp.com) -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - - - - - - - - - - - - - - - - - - - - - - - - - document.getAnonymousNodes(this)[0] - document.getAnonymousNodes(this)[1] - - - - - - - - - - - - - - - - - - - var textBox = document.getAnonymousElementByAttribute(this, - "anonid", "textbox-input-box"); - return document.getAnonymousElementByAttribute(textBox, - "anonid", "input-box-contextmenu"); - - - - - - - - - - - - - Components.interfaces.nsIPrefLocalizedString; - - this.parentNode.mStringBundle - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // overload |onTextEntered| in autocomplete.xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#ifndef XP_MACOSX - -#endif - - - - - - - nsDragAndDrop.drop(event, this.searchbarDNDObserver); - - - - - - - - - - - - - - - - - - - diff --git a/mozilla/browser/base/content/searchDialog.css b/mozilla/browser/base/content/searchDialog.css deleted file mode 100644 index f7edebb9dd8..00000000000 --- a/mozilla/browser/base/content/searchDialog.css +++ /dev/null @@ -1,53 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** -#if 0 - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Search Dialog. - * - * The Initial Developer of the Original Code is - * Gavin Sharp . - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * -#endif - * ***** END LICENSE BLOCK ***** */ - - #searchEngineList { - min-height: 24px; -} - -.engine-icon > .menulist-label-box > .menulist-icon, -.engine-icon > .menu-iconic-left > .menu-iconic-icon { - width: 16px; - height: 16px; - min-height: 16px; -} - -.engine-icon > .menu-iconic-left { - display: -moz-box; - min-height: 16px; -} diff --git a/mozilla/browser/base/content/searchDialog.js b/mozilla/browser/base/content/searchDialog.js deleted file mode 100644 index 71672bf3f3b..00000000000 --- a/mozilla/browser/base/content/searchDialog.js +++ /dev/null @@ -1,211 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** -#if 0 - - Version: MPL 1.1/GPL 2.0/LGPL 2.1 - - - - The contents of this file are subject to the Mozilla Public License Version - - 1.1 (the "License"); you may not use this file except in compliance with - - the License. You may obtain a copy of the License at - - http://www.mozilla.org/MPL/ - - - - Software distributed under the License is distributed on an "AS IS" basis, - - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - - for the specific language governing rights and limitations under the - - License. - - - - The Original Code is Mozilla Search Dialog. - - - - The Initial Developer of the Original Code is - - Gavin Sharp . - - Portions created by the Initial Developer are Copyright (C) 2005 - - the Initial Developer. All Rights Reserved. - - - - Contributor(s): - - Pierre Chanial - - - - Alternatively, the contents of this file may be used under the terms of - - either the GNU General Public License Version 2 or later (the "GPL"), or - - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - - in which case the provisions of the GPL or the LGPL are applicable instead - - of those above. If you wish to allow use of your version of this file only - - under the terms of either the GPL or the LGPL, and not to allow others to - - use your version of this file under the terms of the MPL, indicate your - - decision by deleting the provisions above and replace them with the notice - - and other provisions required by the LGPL or the GPL. If you do not delete - - the provisions above, a recipient may use your version of this file under - - the terms of any one of the MPL, the GPL or the LGPL. - - -#endif - * ***** END LICENSE BLOCK ***** */ - -var gDialog = {}; -var gSelectedEngineIndex; - -const kTabPref = "browser.tabs.opentabfor.searchdialog"; -const kEnginePref = "browser.search.selectedEngineInDialog"; -const kDefEnginePref = "browser.search.defaultenginename"; -const nsIPLS = Components.interfaces.nsIPrefLocalizedString; -const kXUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; - -function onLoad() { - setTimeout(onAfterLoad, 0); -} - -function onAfterLoad() { - - gDialog.list = document.getElementById("searchEngineList"); - gDialog.list.addEventListener("ValueChange", onEnginesListValueChange, false); - gDialog.input = document.getElementById("searchInput"); - gDialog.newtab = document.getElementById("searchInNewTab"); - gDialog.searchbundle = document.getElementById("searchbarBundle"); - gDialog.browserbundle = document.getElementById("browserBundle"); - - var el = document.getAnonymousElementByAttribute(gDialog.input, "anonid", - "textbox-input-box"); - gDialog.contextmenu = document.getAnonymousElementByAttribute(el, - "anonid", "input-box-contextmenu"); - - var pref = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefBranch2); - - var selectedEngine; - var tabChecked = false; - try { - selectedEngine = pref.getComplexValue(kEnginePref, nsIPLS).data; - } catch (ex) { - selectedEngine = pref.getComplexValue(kDefEnginePref, nsIPLS).data; - } - try { - tabChecked = pref.getBoolPref(kTabPref); - } catch (ex) { } - - gDialog.newtab.setAttribute("checked", tabChecked); - - for (var i=0; i < gDialog.list.menupopup.childNodes.length; i++) { - var label = gDialog.list.menupopup.childNodes[i].getAttribute("label"); - if (label == selectedEngine) - gDialog.list.selectedIndex = i; - } - - // Make sure we have a selected item - if (gDialog.list.selectedIndex == -1) - gDialog.list.selectedIndex = 0; - - gSelectedEngineIndex = gDialog.list.selectedIndex; - - // Add "Clear Search History" item to the text box context menu - var sep = document.createElementNS(kXUL_NS, "menuseparator"); - gDialog.contextmenu.appendChild(sep); - - var element = document.createElementNS(kXUL_NS, "menuitem"); - - var label = gDialog.searchbundle.getString("cmd_clearHistory"); - var accesskey = gDialog.searchbundle.getString("cmd_clearHistory_accesskey"); - element.setAttribute("label", label); - element.setAttribute("accesskey", accesskey); - element.setAttribute("cmd", "cmd_clearhistory"); - - gDialog.contextmenu.appendChild(element); - gDialog.input.controllers.appendController(clearHistoryController); -} - -function onEnginesListValueChange() { - if (gDialog.list.value == "addengines") { - var url = gDialog.browserbundle.getString("searchEnginesURL"); - window.opener.openNewWindowWith(url, null, false); - gDialog.list.selectedIndex = gSelectedEngineIndex; - } else { - gSelectedEngineIndex = gDialog.list.selectedIndex; - } -} - -function updateAddEnginesItem(aAdd) { - // Remove the old item if it exists - var elem = document.getElementById("addenginemenuitem"); - var sep = document.getElementById("addenginesep"); - if (elem) - gDialog.list.menupopup.removeChild(elem); - if (sep) - gDialog.list.menupopup.removeChild(sep); - - if (aAdd) { - // Add "Add Engines" item to the drop down - var sep = document.createElementNS(kXUL_NS, "menuseparator"); - sep.setAttribute("id", "addenginesep"); - gDialog.list.menupopup.appendChild(sep); - - var label = gDialog.searchbundle.getString("cmd_addEngine"); - var newItem = gDialog.list.appendItem(label, "addengines"); - newItem.setAttribute("id", "addenginemenuitem"); - newItem.setAttribute("class", "menuitem-iconic engine-icon"); - } -} - -function onDialogAccept() { - var searchText = gDialog.input.value; - var engine = gDialog.list.value; - var searchURL; - - var searchSvc = - Components.classes["@mozilla.org/rdf/datasource;1?name=internetsearch"] - .getService(Components.interfaces.nsIInternetSearchService); - - // XXX Bug 269994: Use dummy string if there is no user entered string - searchURL = searchSvc.GetInternetSearchURL(engine, - searchText ? encodeURIComponent(searchText):"A", - 0, 0, {value:0}); - - if (searchText) { - // Add item to form history - var frmHistSvc = Components.classes["@mozilla.org/satchel/form-history;1"] - .getService(Components.interfaces.nsIFormHistory); - frmHistSvc.addEntry("searchbar-history", searchText); - } else { - try { - // Get the engine's base URL - searchURL = makeURI(searchURL).host; - } catch (ex) {} - } - - setPrefs(); - gDialog.input.controllers.removeController(clearHistoryController); - - window.opener.delayedSearchLoadURL(searchURL, gDialog.newtab.checked); - - // Delay closing slightly to avoid timing bug on Linux. - window.close(); - return false; -} - -function setPrefs() { - var pref = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefBranch2); - - var pls = Components.classes["@mozilla.org/pref-localizedstring;1"] - .createInstance(nsIPLS); - - var name = gDialog.list.selectedItem.getAttribute("label"); - pls.data = name; - - pref.setComplexValue(kEnginePref, nsIPLS, pls); - pref.setBoolPref(kTabPref, gDialog.newtab.checked); -} - -var clearHistoryController = { - frmHistSvc: Components.classes["@mozilla.org/satchel/form-history;1"] - .getService(Components.interfaces.nsIFormHistory), - - autocompleteSearchParam: "searchbar-history", - - supportsCommand: function (aCommand) { - return aCommand == "cmd_clearhistory"; - }, - - isCommandEnabled: function (aCommand) { - return this.frmHistSvc.nameExists(this.autocompleteSearchParam); - }, - - doCommand: function (aCommand) { - this.frmHistSvc.removeEntriesForName(this.autocompleteSearchParam); - gDialog.input.value = ""; - } -} diff --git a/mozilla/browser/base/content/searchDialog.xul b/mozilla/browser/base/content/searchDialog.xul deleted file mode 100644 index e8d38be66e6..00000000000 --- a/mozilla/browser/base/content/searchDialog.xul +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/mozilla/browser/components/bookmarks/content/bookmarksTree.xml b/mozilla/browser/components/bookmarks/content/bookmarksTree.xml deleted file mode 100644 index 860c390fc68..00000000000 --- a/mozilla/browser/components/bookmarks/content/bookmarksTree.xml +++ /dev/null @@ -1,1005 +0,0 @@ - - -# -*- Mode: HTML; indent-tabs-mode: nil; -*- -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Ben Goodger (Original Author) -# Blake Ross -# Pierre Chanial (v 2.0) -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - - - %bookmarksDTD; -]> - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - this.tree.focus(); - - - - null - null - - - 0) - for (var k = 0; k < rangeCount; ++k) { - var rangeMin = {}; - var rangeMax = {}; - this.treeBoxObject.view.selection.getRangeAt(k, rangeMin, rangeMax); - for (var i = rangeMin.value; i <= rangeMax.value; ++i) { - var selectedItem = this.getRowResource(i); - var selectedParent = this.getParentResource(i); - var isExpanded = this.treeBoxObject.view.isContainerOpen(i); - selection.item .push(selectedItem); - selection.parent.push(selectedParent); - selection.isExpanded.push(isExpanded); - } - } - selection.length = selection.item.length; - BookmarksUtils.checkSelection(selection); - return selection; - ]]> - - - - - - - - - - # This function saves the current selection state before the tree is rebuilt - # following a command execution. This allows us to remember which item(s) - # was/were selected so that the user does not need to constantly refocus the - # tree to perform a sequence of commands. - [] - - - - - # This function restores the selection appropriately after a command executes. - # This is necessary because most commands trigger a rebuild of the tree which - # destroys the selection. The restoration of selection is handled in three - # different ways depending on the type of command that has been executed: - # 1) Commands that remove rows: - # The row immediately after the first range in the selection is selected, - # if there is no row immediately after the first range the item before it - # is selected - # 2) Commands that insert rows: - # The newly inserted rows are selected - # 3) Commands that do not change the row count - # The row(s) that was/were operated on remain selected. - # - # The calls to save/restore are placed in the doCommand method and thus all - # commands must pass through this gate. The result is that this method becomes - # the POLICY CENTER FOR POST-VIEW/EDIT SELECTION CHANGES. - - - = maxCount) - nextRow = maxCount-1; - if (nextRow >= 0) - newRanges.push({min: nextRow, max: nextRow}); - break; - // [Category 2] - Commands that insert rows - case "cmd_paste": - case "cmd_bm_import": - case "cmd_bm_movebookmark": - case "cmd_bm_newbookmark": - case "cmd_bm_newfolder": - case "cmd_bm_newseparator": - case "cmd_undo": //XXXpch: doesn't work for insert - case "cmd_redo": //XXXpch: doesn't work for remove - // All items inserted will be selected. The implementation of this model - // is left to |preUpdateTreeSelection|, called when an insert transaction is - // executed, and |updateTreeSelection| called here. - this.updateTreeSelection(); - break; - // [Category 3] - Commands that do not alter the row count - case "cmd_copy": - case "cmd_bm_properties": - case "cmd_bm_rename": - case "cmd_bm_setpersonaltoolbarfolder": - case "cmd_bm_export": - default: - // The selection is unchanged. - return; - } - - var newSelection = this.treeBoxObject.view.selection; - for (i = 0; i < newRanges.length; ++i) - newSelection.rangedSelect(newRanges[i].min, newRanges[i].max, true); - ]]> - - - [] - // keep track of the items that we will select - // because we can not select rows during a batch. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0) - this.mOuter.updateTreeSelection(); - // use of a timer to speedup - var This = this.mOuter; - setTimeout( function (){This.treeBoxObject.view.selection.selectEventsSuppressed = false}, 100) - //dump("DND time:"+(Date.now()-date)+"\n") - }, - - onToggleOpenState: function (aRow) - { - // update the open attribute of the selection - var selection = this.mOuter._selection; - if (!selection) - return; - var resource = this.mOuter.getRowResource(aRow); - for (var i=0; i - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Adding the transaction listener - BMSVC.transactionManager.AddListener(this.bookmarkTreeTransactionListener); - - - BMSVC.transactionManager.RemoveListener(this.bookmarkTreeTransactionListener); - - 2 - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - 2 - - - diff --git a/mozilla/browser/components/bookmarks/content/selectBookmark.js b/mozilla/browser/components/bookmarks/content/selectBookmark.js deleted file mode 100644 index cd2e9c0b1c9..00000000000 --- a/mozilla/browser/components/bookmarks/content/selectBookmark.js +++ /dev/null @@ -1,99 +0,0 @@ -# -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Pierre Chanial (Original Author) -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -var gBookmarkTree; -var gOK; -var gUrls; - -function Startup() -{ - initServices(); - initBMService(); - gOK = document.documentElement.getButton("accept"); - gBookmarkTree = document.getElementById("bookmarks-view"); - gBookmarkTree.treeBoxObject.view.selection.select(0); - gBookmarkTree.focus(); -} - -function onDblClick() -{ - if (!gOK.disabled) - document.documentElement.acceptDialog(); -} - -function updateOK() -{ - var selection = gBookmarkTree._selection; - var ds = gBookmarkTree.tree.database; - var url; - gUrls = []; - for (var i=0; i - -# -*- Mode: HTML; indent-tabs-mode: nil; -*- -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Pierre Chanial (Original Author) -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - - - - - - - - - - - - - - - - - - - - - - - - - - - - &calendar.publish.url.label; - - - - - - &calendar.publish.example.url.description; - - - - - - - - diff --git a/mozilla/calendar/base/content/calendar-recurrence-dialog.js b/mozilla/calendar/base/content/calendar-recurrence-dialog.js deleted file mode 100644 index 68b39e803a7..00000000000 --- a/mozilla/calendar/base/content/calendar-recurrence-dialog.js +++ /dev/null @@ -1,277 +0,0 @@ -/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Oracle Corporation code. - * - * The Initial Developer of the Original Code is Oracle Corporation - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Stuart Parmenter - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* dialog stuff */ -function onLoad() -{ - var args = window.arguments[0]; - - window.onAcceptCallback = args.onOk; - window.calendarEvent = args.calendarEvent; - window.originalRecurrenceInfo = args.recurrenceInfo; - - window.removedExceptions = []; - - loadDialog(); - - updateDeck(); - - updateDuration(); - - opener.setCursor("auto"); - - self.focus(); -} - -function onAccept() -{ - var event = window.calendarEvent; - - var recurrenceInfo = saveDialog(); - - window.onAcceptCallback(recurrenceInfo); - - return true; -} - -function onCancel() -{ - -} - -function loadDialog() -{ - if (!window.originalRecurrenceInfo) - return; - - /* split out rules and exceptions */ - var rrules = splitRecurrenceRules(window.originalRecurrenceInfo); - var rules = rrules[0]; - var exceptions = rrules[1]; - - /* deal with the rules */ - if (rules.length > 0) { - // we only handle 1 rule currently - var rule = rules[0]; - if (rule instanceof calIRecurrenceRule) { - - switch(rule.type) { - case "DAILY": - document.getElementById("period-list").selectedIndex = 0; - - setElementValue("daily-days", rule.interval); - break; - case "WEEKLY": - document.getElementById("period-list").selectedIndex = 1; - - const byDayTable = { 1 : "sun", 2 : "mon", 3 : "tue", 4 : "wed", - 5 : "thu", 6 : "fri", 7: "sat" }; - - for each (var i in rule.getComponent("BYDAY", {})) { - setElementValue("weekly-" + byDayTable[i], "true", "checked"); - } - break; - case "MONTHLY": - document.getElementById("period-list").selectedIndex = 2; - break; - case "YEARLY": - document.getElementById("period-list").selectedIndex = 3; - break; - default: - dump("unable to handle your rule type!\n"); - break; - } - - /* load up the duration of the event radiogroup */ - if (rule.count == -1) { - setElementValue("recurrence-duration", "forever"); - } else if (rule.isByCount) { - setElementValue("recurrence-duration", "ntimes"); - setElementValue("repeat-ntimes-count", rule.count ); - } else { - setElementValue("recurrence-duration", "until"); - setElementValue("repeat-until-date", rule.endDate.jsDate); // XXX getInTimezone() - } - } - } - - /* Deal with exceptions */ - var exceptionListBox = document.getElementById("recurrence-exceptions-listbox"); - - for each (exception in exceptions) { - if (exception instanceof calIRecurrenceDate) { - exceptionListBox.appendItem(exception.date.toString()).date = exception.date; - } else if (exception instanceof calIRecurrenceDateSet) { - var dateSet = exception.getDates({}); - for each(date in dateSet) - exceptionListBox.appendItem(date.toString()).date = date; - } else - dump(exception); - } -} - -function saveDialog() -{ - // This works, but if we ever support more complex recurrence, - // e.g. recurrence for Martians, then we're going to want to - // not clone and just recreate the recurrenceInfo each time. - // The reason is that the order of items (rules/dates/datesets) - // matters, so we can't always just append at the end. This - // code here always inserts a rule first, because all our - // exceptions should come afterward. - var deckNumber = Number(getElementValue("period-list")); - - var recurrenceInfo = null; - if (window.originalRecurrenceInfo) { - recurrenceInfo = window.originalRecurrenceInfo.clone(); - var rrules = splitRecurrenceRules(recurrenceInfo); - if (rrules[0].length > 0) - recurrenceInfo.deleteRecurrenceItem(rrules[0][0]); - } else { - recurrenceInfo = createRecurrenceInfo(); - recurrenceInfo.item = window.calendarEvent; - } - - var recRule = new calRecurrenceRule(); - switch (deckNumber) { - case 0: - recRule.type = "DAILY"; - var ndays = Number(getElementValue("daily-days")); - if (ndays == "") - ndays = 1; - recRule.interval = ndays; - break; - case 1: - recRule.type = "WEEKLY"; - recRule.interval = 1; // XXX we need to support every 2 weeks and so on.. - var onDays = []; - ["sun", "mon", "tue", "wed", "thu", "fri", "sat"]. - forEach(function(d) - { - var elem = document.getElementById("weekly-" + d); - if (elem.checked) { - onDays.push(elem.getAttribute("value")); - } - }); - if (onDays.length > 0) - recRule.setComponent("BYDAY", onDays.length, onDays); - break; - case 2: - recRule.type = "MONTHLY"; - break; - case 3: - recRule.type = "YEARLY"; - var nyears = Number(getElementValue("yearly-years")); - if (nyears == "") - nyears = 1; - recRule.interval = nyears; - break; - } - - /* figure out how long this event is supposed to last */ - switch(document.getElementById("recurrence-duration").selectedItem.value) { - case "forever": - recRule.count = -1; - break; - case "ntimes": - recRule.count = Math.max(1, getElementValue("repeat-ntimes-count")); - break; - case "until": - recRule.endDate = jsDateToDateTime(getElementValue("repeat-until-date")); - break; - } - - recurrenceInfo.insertRecurrenceItemAt(recRule, 0); - - for each (date in window.removedExceptions) { - recurrenceInfo.restoreOccurrenceAt(date); - } - - return recurrenceInfo; -} - - -function updateDeck() -{ - document.getElementById("period-deck").selectedIndex = Number(getElementValue("period-list")); -} - -function updateDuration() -{ - var durationSelection = document.getElementById("recurrence-duration").selectedItem.value; - if (durationSelection == "forever") { - } - - if (durationSelection == "ntimes") { - setElementValue("repeat-ntimes-count", false, "disabled"); - setElementValue("repeat-ntimes-units", false, "disabled"); - } else { - setElementValue("repeat-ntimes-count", "true", "disabled"); - setElementValue("repeat-ntimes-units", "true", "disabled"); - } - - if (durationSelection == "until") { - setElementValue("repeat-until-date", false, "disabled"); - } else { - setElementValue("repeat-until-date", "true", "disabled"); - } -} - -function removeSelectedException() -{ - var exceptionList = document.getElementById("recurrence-exceptions-listbox"); - var item = exceptionList.selectedItem; - window.removedExceptions.push(item.date); - exceptionList.removeItemAt(exceptionList.getIndexOfItem(item)); -} - -function splitRecurrenceRules(recurrenceInfo) -{ - var ritems = recurrenceInfo.getRecurrenceItems({}); - - var rules = []; - var exceptions = []; - - for each (var r in ritems) { - if (r.isNegative) - exceptions.push(r); - else - rules.push(r); - } - - return [rules, exceptions]; -} diff --git a/mozilla/calendar/base/content/calendar-recurrence-dialog.xul b/mozilla/calendar/base/content/calendar-recurrence-dialog.xul deleted file mode 100644 index 5a6a57f49e3..00000000000 --- a/mozilla/calendar/base/content/calendar-recurrence-dialog.xul +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - - - \n"; - html += "
\n"; - html += startForm(data); - html += "\n"; - var organizer = event.organizer; - var rows = [["Invitation from", "" + - organizer.commonName + ""], - ["Topic:", event.title], - ["Start:", event.startDate.jsDate.toLocaleTimeString()], - ["End:", event.endDate.jsDate.toLocaleTimeString()]]; - html += rows.map(makeTableRow).join("\n"); - html += "\n"; - html += "
"; - html += makeButton("accept", "Accept meeting") + " "; - html += makeButton("decline", "Decline meeting") + " "; - html += "
\n\n
"; - - // dump("Generated HTML:\n\n" + html + "\n\n"); - return html; - }, - -}; - -var myModule = { - registerSelf: function (compMgr, fileSpec, location, type) { - debug("*** Registering Lightning text/calendar handler\n"); - compMgr = compMgr.QueryInterface(CI.nsIComponentRegistrar); - compMgr.registerFactoryLocation(this.myCID, - "Lightning text/calendar handler", - this.myContractID, - fileSpec, - location, - type); - - var catman = Components.classes["@mozilla.org/categorymanager;1"] - .getService(CI.nsICategoryManager); - - catman.addCategoryEntry("simple-mime-converters", "text/calendar", - this.myContractID, true, true); - }, - - getClassObject: function (compMgr, cid, iid) { - if (!cid.equals(this.myCID)) - throw Components.results.NS_ERROR_NO_INTERFACE; - - if (!iid.equals(Components.interfaces.nsIFactory)) - throw Components.results.NS_ERROR_NOT_IMPLEMENTED; - - return this.myFactory; - }, - - myCID: Components.ID("{c70acb08-464e-4e55-899d-b2c84c5409fa}"), - - myContractID: "@mozilla.org/lightning/mime-converter;1", - - myFactory: { - createInstance: function (outer, iid) { - if (outer != null) - throw Components.results.NS_ERROR_NO_AGGREGATION; - - return (new ltnMimeConverter()).QueryInterface(iid); - } - }, - - canUnload: function(compMgr) { - return true; - } -}; - -function NSGetModule(compMgr, fileSpec) { - return myModule; -} - - diff --git a/mozilla/calendar/lightning/content/agenda-tree-overlay.xul b/mozilla/calendar/lightning/content/agenda-tree-overlay.xul deleted file mode 100644 index 2be666361e3..00000000000 --- a/mozilla/calendar/lightning/content/agenda-tree-overlay.xul +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - -
- - - -

-U.S. GOVERNMENT END USERS. The Software is a "commercial -item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting -of "commercial computer software" and "commercial computer software -documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). -Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 -(June 1995), all U.S. Government End Users acquire the Software with only -those rights set forth herein. - -

- - - diff --git a/mozilla/calendar/resources/content/about.xul b/mozilla/calendar/resources/content/about.xul deleted file mode 100644 index 6191c681dd1..00000000000 --- a/mozilla/calendar/resources/content/about.xul +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - %dtd; -]> - - - - - - - - - - - \n\ -"; - -const REMOTE_STYLE = "\n\ - body {\n\ - margin: 0;\n\ - border: none;\n\ - padding: 0;\n\ - }\n\ - iframe {\n\ - position: fixed;\n\ - top: 0;\n\ - right: 0;\n\ - bottom: 0;\n\ - left: 0;\n\ - border: none;\n\ - }\n\ -"; - -// Unlike remote content, which is locked within a fixed position iframe, -// local content goes is positioned according to the normal rules of flow. -// The problem with this is that the message pane itself provides a scrollbar -// if necessary, and that scrollbar appears next to the toolbar as well as -// the content being scrolled. The solution is to lock local content within -// a fixed position div and set its overflow property to auto so that the div -// itself provides the scrollbar. Unfortunately we can't do that because of -// Mozilla bug 97283, which makes it hard to scroll an auto overflow div. - -const LOCAL_CONTENT_TEMPLATE = "\n\ - %CONTENT%\n\ -"; - -// no local style overrides at this time -const LOCAL_STYLE = "\n"; - -function FeedItem() -{ - this.mDate = new Date().toString(); - this.mUnicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"] - .createInstance(Components.interfaces.nsIScriptableUnicodeConverter); -} - -FeedItem.prototype = -{ - isStoredWithId: false, // we currently only do this for IETF Atom. RSS2 with GUIDs should do this as well. - xmlContentBase: null, // only for IETF Atom - id: null, - feed: null, - description: null, - content: null, - enclosure: null, // we currently only support one enclosure per feed item... - title: "(no subject)", // TO DO: this needs to be localized - author: "anonymous", - mURL: null, - characterSet: "", - - get url() - { - return this.mURL; - }, - - set url(aVal) - { - var uri = Components.classes["@mozilla.org/network/standard-url;1"].getService(Components.interfaces["nsIStandardURL"]); - uri.init(1, 80, aVal, null, null); - var uri = uri.QueryInterface(Components.interfaces.nsIURI); - this.mURL = uri.spec; - }, - - get date() - { - return this.mDate; - }, - - set date (aVal) - { - this.mDate = aVal; - }, - - get identity () - { - return this.feed.name + ": " + this.title + " (" + this.id + ")" - }, - - get messageID() - { - var messageID = this.id || this.mURL || this.title; - - // Escape occurrences of message ID meta characters <, >, and @. - messageID.replace(//g, "%3E"); - messageID.replace(/@/g, "%40"); - messageID = messageID + "@" + "localhost.localdomain"; - return messageID; - }, - - get itemUniqueURI() - { - var theURI; - if(this.isStoredWithId && this.id) - theURI = "urn:" + this.id; - else - theURI = this.mURL || ("urn:" + this.id); - return theURI; - }, - - get contentBase() - { - if(this.xmlContentBase) - return this.xmlContentBase - else - return this.mURL; - }, - - store: function() - { - this.mUnicodeConverter.charset = this.characterSet; - - if (this.isStored()) - debug(this.identity + " already stored; ignoring"); - else if (this.content) - { - debug(this.identity + " has content; storing"); - var content = MESSAGE_TEMPLATE; - content = content.replace(/%CONTENT_TEMPLATE%/, LOCAL_CONTENT_TEMPLATE); - content = content.replace(/%STYLE%/, LOCAL_STYLE); - content = content.replace(/%TITLE%/, this.title); - content = content.replace(/%BASE%/, this.contentBase); - content = content.replace(/%URL%/g, this.mURL); - content = content.replace(/%CONTENT%/, this.content); - this.content = content; // XXX store it elsewhere, f.e. this.page - this.writeToFolder(); - } - else if (this.feed.quickMode) - { - debug(this.identity + " in quick mode; storing"); - - this.content = this.description || this.title; - - var content = MESSAGE_TEMPLATE; - content = content.replace(/%CONTENT_TEMPLATE%/, LOCAL_CONTENT_TEMPLATE); - content = content.replace(/%STYLE%/, LOCAL_STYLE); - content = content.replace(/%BASE%/, this.contentBase); - content = content.replace(/%TITLE%/, this.title); - content = content.replace(/%URL%/g, this.mURL); - content = content.replace(/%CONTENT%/, this.content); - this.content = content; // XXX store it elsewhere, f.e. this.page - this.writeToFolder(); - } - else - { - //debug(this.identity + " needs content; downloading"); - debug(this.identity + " needs content; creating and storing"); - var content = MESSAGE_TEMPLATE; - content = content.replace(/%CONTENT_TEMPLATE%/, REMOTE_CONTENT_TEMPLATE); - content = content.replace(/%STYLE%/, REMOTE_STYLE); - content = content.replace(/%TITLE%/, this.title); - content = content.replace(/%BASE%/, this.contentBase); - content = content.replace(/%URL%/g, this.mURL); - content = content.replace(/%DESCRIPTION%/, this.description || this.title); - this.content = content; // XXX store it elsewhere, f.e. this.page - this.writeToFolder(); - } - }, - - isStored: function() - { - // Checks to see if the item has already been stored in its feed's message folder. - - debug(this.identity + " checking to see if stored"); - - var server = this.feed.server; - var folder = this.feed.folder; - - if (!folder) - { - debug(this.feed.name + " folder doesn't exist; creating"); - debug("creating " + this.feed.name + "as child of " + server.rootMsgFolder + "\n"); - server.rootMsgFolder.createSubfolder(this.feed.name, null /* supposed to be a msg window */); - folder = server.rootMsgFolder.FindSubFolder(this.feed.name); - debug(this.identity + " not stored (folder didn't exist)"); - return false; - } - - var ds = getItemsDS(server); - var itemURI = this.itemUniqueURI; - var itemResource = rdf.GetResource(itemURI); - - var downloaded = ds.GetTarget(itemResource, FZ_STORED, true); - if (!downloaded || downloaded.QueryInterface(Components.interfaces.nsIRDFLiteral).Value == "false") - { - // HACK ALERT: before we give up, try to work around an entity escaping bug in RDF - // See Bug #258465 for more details - itemURI = itemURI.replace(/</g, '<'); - itemURI = itemURI.replace(/>/g, '>'); - itemURI = itemURI.replace(/"/g, '"'); - itemURI = itemURI.replace(/&/g, '&'); - - debug('Failed to find item, trying entity replacement version: ' + itemURI); - itemResource = rdf.GetResource(itemURI); - downloaded = ds.GetTarget(itemResource, FZ_STORED, true); - - if (downloaded) - { - debug(this.identity + " not stored"); - return true; - } - - debug(this.identity + " not stored"); - return false; - } - else - { - debug(this.identity + " stored"); - return true; - } - }, - - markValid: function() - { - debug("validating " + this.mURL); - var ds = getItemsDS(this.feed.server); - - var itemURI = this.itemUniqueURI; - var resource = rdf.GetResource(itemURI); - - if (!ds.HasAssertion(resource, FZ_FEED, rdf.GetResource(this.feed.url), true)) - ds.Assert(resource, FZ_FEED, rdf.GetResource(this.feed.url), true); - - if (ds.hasArcOut(resource, FZ_VALID)) - { - var currentValue = ds.GetTarget(resource, FZ_VALID, true); - ds.Change(resource, FZ_VALID, currentValue, RDF_LITERAL_TRUE); - } - else - ds.Assert(resource, FZ_VALID, RDF_LITERAL_TRUE, true); - }, - - markStored: function() - { - var ds = getItemsDS(this.feed.server); - var itemURI = this.itemUniqueURI; - var resource = rdf.GetResource(itemURI); - - if (!ds.HasAssertion(resource, FZ_FEED, rdf.GetResource(this.feed.url), true)) - ds.Assert(resource, FZ_FEED, rdf.GetResource(this.feed.url), true); - - var currentValue; - if (ds.hasArcOut(resource, FZ_STORED)) - { - currentValue = ds.GetTarget(resource, FZ_STORED, true); - ds.Change(resource, FZ_STORED, currentValue, RDF_LITERAL_TRUE); - } - else - ds.Assert(resource, FZ_STORED, RDF_LITERAL_TRUE, true); - }, - - mimeEncodeSubject: function(aSubject, aCharset) - { - // get the mime header encoder service - var mimeEncoder = Components.classes["@mozilla.org/messenger/mimeconverter;1"].getService(Components.interfaces.nsIMimeConverter); - - // this routine sometimes throws exceptions for mis-encoded data so wrap it - // with a try catch for now.. - var newSubject; - try - { - newSubject = mimeEncoder.encodeMimePartIIStr(this.mUnicodeConverter.ConvertFromUnicode(aSubject), false, aCharset, 9, 72); - } - catch (ex) - { - newSubject = aSubject; - } - - return newSubject; - }, - - writeToFolder: function() - { - debug(this.identity + " writing to message folder" + this.feed.name + "\n"); - - var server = this.feed.server; - this.mUnicodeConverter.charset = this.characterSet; - - // If the sender isn't a valid email address, quote it so it looks nicer. - if (this.author && this.author.indexOf('@') == -1) - this.author = '<' + this.author + '>'; - - // Convert the title to UTF-16 before performing our HTML entity replacement - // reg expressions. - var title = this.title; - - // the subject may contain HTML entities. - // Convert these to their unencoded state. i.e. & becomes '&' - title = title.replace(/</g, '<'); - title = title.replace(/>/g, '>'); - title = title.replace(/"/g, '"'); - title = title.replace(/&/g, '&'); - - // Compress white space in the subject to make it look better. - title = title.replace(/[\t\r\n]+/g, " "); - - this.title = this.mimeEncodeSubject(title, this.characterSet); - - // If the date looks like it's in W3C-DTF format, convert it into - // an IETF standard date. Otherwise assume it's in IETF format. - if (this.mDate.search(/^\d\d\d\d/) != -1) - this.mDate = W3CToIETFDate(this.mDate); - - // Escape occurrences of "From " at the beginning of lines of content - // per the mbox standard, since "From " denotes a new message, and add - // a line break so we know the last line has one. - this.content = this.content.replace(/([\r\n]+)(>*From )/g, "$1>$2"); - this.content += "\n"; - - // The opening line of the message, mandated by standards to start with - // "From ". It's useful to construct this separately because we not only - // need to write it into the message, we also need to use it to calculate - // the offset of the X-Mozilla-Status lines from the front of the message - // for the statusOffset property of the DB header object. - var openingLine = 'From - ' + this.mDate + '\n'; - - var source = - openingLine + - 'X-Mozilla-Status: 0000\n' + - 'X-Mozilla-Status2: 00000000\n' + - 'Date: ' + this.mDate + '\n' + - 'Message-Id: <' + this.messageID + '>\n' + - 'From: ' + this.author + '\n' + - 'MIME-Version: 1.0\n' + - 'Subject: ' + this.title + '\n' + - 'Content-Transfer-Encoding: 8bit\n' + - 'Content-Base: ' + this.mURL + '\n'; - - if (this.enclosure && this.enclosure.mFileName) - { - var boundaryID = source.length + this.enclosure.mLength; - source += 'Content-Type: multipart/mixed;\n boundary="' + ENCLOSURE_HEADER_BOUNDARY_PREFIX + boundaryID + '"' + '\n\n' + - 'This is a multi-part message in MIME format.\n' + ENCLOSURE_BOUNDARY_PREFIX + boundaryID + '\n' + - 'Content-Type: text/html; charset=' + this.characterSet + '\n' + - 'Content-Transfer-Encoding: 8bit\n' + - this.content; - source += this.enclosure.convertToAttachment(boundaryID); - } - else - { - source += 'Content-Type: text/html; charset=' + this.characterSet + '\n' + - '\n' + this.content; - - } - - debug(this.identity + " is " + source.length + " characters long"); - - // Get the folder and database storing the feed's messages and headers. - folder = this.feed.folder.QueryInterface(Components.interfaces.nsIMsgLocalMailFolder); - - // source is a unicode string, we want to save a char * string in the original charset. So convert back - folder.addMessage(this.mUnicodeConverter.ConvertFromUnicode(source)); - this.markStored(); - } -}; - - -// A feed enclosure is to RSS what an attachment is for e-mail. We make enclosures look -// like attachments in the UI. - -function FeedEnclosure(aURL, aContentType, aLength) -{ - this.mURL = aURL; - this.mContentType = aContentType; - this.mLength = aLength; - - // generate a fileName from the URL - if (this.mURL) - { - var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); - var enclosureURL = ioService.newURI(this.mURL, null, null).QueryInterface(Components.interfaces.nsIURL); - if (enclosureURL) - this.mFileName = enclosureURL.fileName; - } -} - -FeedEnclosure.prototype = -{ - mURL: "", - mContentType: "", - mLength: 0, - mFileName: "", - - // returns a string that looks like an e-mail attachment - // which represents the enclosure. - convertToAttachment: function(aBoundaryID) - { - return '\n' + - ENCLOSURE_BOUNDARY_PREFIX + aBoundaryID + '\n' + - 'Content-Type: ' + this.mContentType + '; name="' + this.mFileName + '"\n' + - 'X-Mozilla-External-Attachment-URL: ' + this.mURL + '\n' + - 'Content-Disposition: attachment; filename="' + this.mFileName + '"\n\n' + - 'This MIME attachment is stored separately from the message.\n' + - ENCLOSURE_BOUNDARY_PREFIX + aBoundaryID + '--' + '\n'; - - } -}; - -function W3CToIETFDate(dateString) { - // Converts a W3C-DTF (subset of ISO 8601) date string to an IETF date string. - // W3C-DTF is described in this note: http://www.w3.org/TR/NOTE-datetime - // IETF is obtained via the Date object's toUTCString() method. The object's - // toString() method is insufficient because it spells out timezones on Win32 - // (f.e. "Pacific Standard Time" instead of "PST"), which Mail doesn't grok. - // For info, see http://lxr.mozilla.org/mozilla/source/js/src/jsdate.c#1526. - - var parts = dateString.match(/(\d\d\d\d)(-(\d\d))?(-(\d\d))?(T(\d\d):(\d\d)(:(\d\d)(\.(\d+))?)?(Z|([+-])(\d\d):(\d\d))?)?/); - debug("date parts: " + parts); - - // Here's an example of a W3C-DTF date string and what .match returns for it. - // date: 2003-05-30T11:18:50.345-08:00 - // date.match returns array values: - // 0: 2003-05-30T11:18:50-08:00, - // 1: 2003, - // 2: -05, - // 3: 05, - // 4: -30, - // 5: 30, - // 6: T11:18:50-08:00, - // 7: 11, - // 8: 18, - // 9: :50, - // 10: 50, - // 11: .345, - // 12: 345, - // 13: -08:00, - // 14: -, - // 15: 08, - // 16: 00 - - // Create a Date object from the date parts. Note that the Date object - // apparently can't deal with empty string parameters in lieu of numbers, - // so optional values (like hours, minutes, seconds, and milliseconds) - // must be forced to be numbers. - var date = new Date(parts[1], parts[3]-1, parts[5], parts[7] || 0, - parts[8] || 0, parts[10] || 0, parts[12] || 0); - - // We now have a value that the Date object thinks is in the local timezone - // but which actually represents the date/time in the remote timezone - // (f.e. the value was "10:00 EST", and we have converted it to "10:00 PST" - // instead of "07:00 PST"). We need to correct that. To do so, we're going - // to add the offset between the remote timezone and UTC (to convert the value - // to UTC), then add the offset between UTC and the local timezone (to convert - // the value to the local timezone). - - // Ironically, W3C-DTF gives us the offset between UTC and the remote timezone - // rather than the other way around, while the getTimezoneOffset() method - // of a Date object gives us the offset between the local timezone and UTC - // rather than the other way around. Both of these are the additive inverse - // (i.e. -x for x) of what we want, so we have to invert them to use them - // by multipying by -1 - // (f.e. if "the offset between UTC and the remote timezone" is -5 hours, - // then "the offset between the remote timezone and UTC" is -5*-1 = 5 hours). - - // Note that if the timezone portion of the date/time string is absent - // (which violates W3C-DTF, although ISO 8601 allows it), we assume the value - // to be in UTC. - - // The offset between the remote timezone and UTC in milliseconds. - var remoteToUTCOffset = 0; - if (parts[13] && parts[13] != "Z") { - var direction = (parts[14] == "+" ? 1 : -1); - if (parts[15]) - remoteToUTCOffset += direction * parts[15] * HOURS_TO_MILLISECONDS; - if (parts[16]) - remoteToUTCOffset += direction * parts[16] * MINUTES_TO_MILLISECONDS; - } - remoteToUTCOffset = remoteToUTCOffset * -1; // invert it - debug("date remote to UTC offset: " + remoteToUTCOffset); - - // The offset between UTC and the local timezone in milliseconds. - var UTCToLocalOffset = date.getTimezoneOffset() * MINUTES_TO_MILLISECONDS; - UTCToLocalOffset = UTCToLocalOffset * -1; // invert it - debug("date UTC to local offset: " + UTCToLocalOffset); - - date.setTime(date.getTime() + remoteToUTCOffset + UTCToLocalOffset); - - debug("date string: " + date.toUTCString()); - - return date.toUTCString(); -} diff --git a/mozilla/mail/extensions/newsblog/content/am-newsblog.js b/mozilla/mail/extensions/newsblog/content/am-newsblog.js deleted file mode 100644 index 9501b85b147..00000000000 --- a/mozilla/mail/extensions/newsblog/content/am-newsblog.js +++ /dev/null @@ -1,68 +0,0 @@ -# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is News and Blogs Account Settings. -# -# The Initial Developer of the Original Code is -# The Mozilla Foundation. -# Portions created by the Initial Developer are Copyright (C) 2004 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Scott MacGregor -# -# Alternatively, the contents of this file may be used under the terms of -# either of the GNU General Public License Version 2 or later (the "GPL"), -# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# ***** END LICENSE BLOCK ***** - -var gIncomingServer; - -function onInit() -{ - // set our custom quickMode attribute - document.getElementById('useQuickMode').checked = gIncomingServer.getBoolAttribute("quickMode"); -} - -function onPreInit(account, accountValues) -{ - gIncomingServer = account.incomingServer; -} - -function onSave() -{ - gIncomingServer.setBoolAttribute("quickMode", document.getElementById('useQuickMode').checked); -} - -function manageSubscriptions() -{ - // XXX: This code should be shared with the JS in toolbar-icon.xul - const kWindowMediatorContractID = "@mozilla.org/appshell/window-mediator;1"; - const kWindowMediatorIID = Components.interfaces.nsIWindowMediator; - const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID); - var lastSubscriptionWindow = kWindowMediator.getMostRecentWindow("Mail:News-BlogSubscriptions"); - - if (lastSubscriptionWindow) - lastSubscriptionWindow.focus(); - else - window.openDialog("chrome://messenger-newsblog/content/feed-subscriptions.xul", "", - "centerscreen,chrome,dialog=no,resizable", { server: gIncomingServer}); -} diff --git a/mozilla/mail/extensions/newsblog/content/am-newsblog.xul b/mozilla/mail/extensions/newsblog/content/am-newsblog.xul deleted file mode 100644 index 806bfac3504..00000000000 --- a/mozilla/mail/extensions/newsblog/content/am-newsblog.xul +++ /dev/null @@ -1,101 +0,0 @@ - -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is News and Blogs Account Settings. -# -# The Initial Developer of the Original Code is -# The Mozilla Foundation. -# Portions created by the Initial Developer are Copyright (C) 2004 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Scott MacGregor -# -# Alternatively, the contents of this file may be used under the terms of -# either of the GNU General Public License Version 2 or later (the "GPL"), -# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# ***** END LICENSE BLOCK ***** - - - - -%newsblogDTD; - -%accountNoIdentDTD; -]> - - - - - - - - - - -
- diff --git a/mozilla/mail/extensions/newsblog/content/utils.js b/mozilla/mail/extensions/newsblog/content/utils.js deleted file mode 100755 index d48606b3ed9..00000000000 --- a/mozilla/mail/extensions/newsblog/content/utils.js +++ /dev/null @@ -1,344 +0,0 @@ -# -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is Thunderbird RSS Utils -# -# The Initial Developer of the Original Code is -# The Mozilla Foundation. -# Portions created by the Initial Developer are Copyright (C) 2005 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Myk Melez -# Scott MacGregor -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ****** - -// Whether or not to dump debugging messages to the console. -const DEBUG = false; -var debug; -if (DEBUG) - debug = function(msg) { dump(' -- FZ -- : ' + msg + '\n'); } -else - debug = function() {} - -var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); - -const RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; -const RDF_TYPE = rdf.GetResource(RDF_NS + "type"); - -const RSS_NS = "http://purl.org/rss/1.0/"; -const RSS_CHANNEL = rdf.GetResource(RSS_NS + "channel"); -const RSS_TITLE = rdf.GetResource(RSS_NS + "title"); -const RSS_DESCRIPTION = rdf.GetResource(RSS_NS + "description"); -const RSS_ITEMS = rdf.GetResource(RSS_NS + "items"); -const RSS_ITEM = rdf.GetResource(RSS_NS + "item"); -const RSS_LINK = rdf.GetResource(RSS_NS + "link"); - -const RSS_CONTENT_NS = "http://purl.org/rss/1.0/modules/content/"; -const RSS_CONTENT_ENCODED = rdf.GetResource(RSS_CONTENT_NS + "encoded"); - -const DC_NS = "http://purl.org/dc/elements/1.1/"; -const DC_CREATOR = rdf.GetResource(DC_NS + "creator"); -const DC_SUBJECT = rdf.GetResource(DC_NS + "subject"); -const DC_DATE = rdf.GetResource(DC_NS + "date"); -const DC_TITLE = rdf.GetResource(DC_NS + "title"); -const DC_LASTMODIFIED = rdf.GetResource(DC_NS + "lastModified"); -const DC_IDENTIFIER = rdf.GetResource(DC_NS + "identifier"); - -const FZ_NS = "urn:forumzilla:"; -const FZ_ROOT = rdf.GetResource(FZ_NS + "root"); -const FZ_FEEDS = rdf.GetResource(FZ_NS + "feeds"); -const FZ_FEED = rdf.GetResource(FZ_NS + "feed"); -const FZ_QUICKMODE = rdf.GetResource(FZ_NS + "quickMode"); -const FZ_DESTFOLDER = rdf.GetResource(FZ_NS + "destFolder"); -const FZ_STORED = rdf.GetResource(FZ_NS + "stored"); -const FZ_VALID = rdf.GetResource(FZ_NS + "valid"); - -const RDF_LITERAL_TRUE = rdf.GetLiteral("true"); -const RDF_LITERAL_FALSE = rdf.GetLiteral("false"); - -// Atom constants -const ATOM_03_NS = "http://purl.org/atom/ns#"; -const ATOM_IETF_NS = "http://www.w3.org/2005/Atom"; - -// XXX There's a containerutils in forumzilla.js that this should be merged with. -var containerUtils = Components.classes["@mozilla.org/rdf/container-utils;1"] - .getService(Components.interfaces.nsIRDFContainerUtils); - -var fileHandler = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService) - .getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler); - -// helper routine that checks our subscriptions list array and returns true if the url -// is already in our list. This is used to prevent the user from subscribing to the same -// feed multiple times for the same server... -function feedAlreadyExists(aUrl, aServer) -{ - var feeds = getSubscriptionsList(aServer); - return feeds.IndexOf(rdf.GetResource(aUrl)) != -1; -} - -function addFeed(url, title, destFolder) -{ - var ds = getSubscriptionsDS(destFolder.server); - var feeds = getSubscriptionsList(destFolder.server); - - // Generate a unique ID for the feed. - var id = url; - var i = 1; - while (feeds.IndexOf(rdf.GetResource(id)) != -1 && ++i < 1000) - id = url + i; - if (id == 1000) - throw("couldn't generate a unique ID for feed " + url); - - // Add the feed to the list. - id = rdf.GetResource(id); - feeds.AppendElement(id); - ds.Assert(id, RDF_TYPE, FZ_FEED, true); - ds.Assert(id, DC_IDENTIFIER, rdf.GetLiteral(url), true); - if (title) - ds.Assert(id, DC_TITLE, rdf.GetLiteral(title), true); - ds.Assert(id, FZ_DESTFOLDER, destFolder, true); - ds = ds.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); - ds.Flush(); -} - -// updates the "feedUrl" property in the message database for the folder in question. - -var kFeedUrlDelimiter = '|'; // the delimiter used to delimit feed urls in the msg folder database "feedUrl" property - -function updateFolderFeedUrl(aFolder, aFeedUrl, aRemoveUrl) -{ - var msgdb = aFolder.QueryInterface(Components.interfaces.nsIMsgFolder).getMsgDatabase(null); - var folderInfo = msgdb.dBFolderInfo; - var oldFeedUrl = folderInfo.getCharPtrProperty("feedUrl"); - - if (aRemoveUrl) - { - // remove our feed url string from the list of feed urls - var newFeedUrl = oldFeedUrl.replace(kFeedUrlDelimiter + aFeedUrl, ""); - folderInfo.setCharPtrProperty("feedUrl", newFeedUrl); - } - else - folderInfo.setCharPtrProperty("feedUrl", oldFeedUrl + kFeedUrlDelimiter + aFeedUrl); - - // commit the db to preserve our changes - msgdb.Close(true); -} - -function getNodeValue(node) -{ - if (node && node.textContent) - return node.textContent; - else if (node && node.firstChild) - { - var ret = ""; - for (var child = node.firstChild; child; child = child.nextSibling) - { - var value = getNodeValue(child); - if (value) - ret += value; - } - - if (ret) - return ret; - } - - return null; -} - -function getRDFTargetValue(ds, source, property) -{ - var node = ds.GetTarget(source, property, true); - if (node) - { - try{ - node = node.QueryInterface(Components.interfaces.nsIRDFLiteral); - if (node) - return node.Value; - }catch(e){ - // if the RDF was bogus, do nothing. rethrow if it's some other problem - if(!((e instanceof Components.interfaces.nsIXPCException) - && (e.result==Components.results.NS_ERROR_NO_INTERFACE))) - throw e; - } - - } - return null; -} - -var gFzSubscriptionsDS; // cache -function getSubscriptionsDS(server) -{ - if (gFzSubscriptionsDS) - return gFzSubscriptionsDS; - - var file = getSubscriptionsFile(server); - var url = fileHandler.getURLSpecFromFile(file); - - gFzSubscriptionsDS = rdf.GetDataSourceBlocking(url); - - if (!gFzSubscriptionsDS) - throw("can't get subscriptions data source"); - - return gFzSubscriptionsDS; -} - -function getSubscriptionsList(server) -{ - var ds = getSubscriptionsDS(server); - var list = ds.GetTarget(FZ_ROOT, FZ_FEEDS, true); - //list = feeds.QueryInterface(Components.interfaces.nsIRDFContainer); - list = list.QueryInterface(Components.interfaces.nsIRDFResource); - list = containerUtils.MakeSeq(ds, list); - return list; -} - -function getSubscriptionsFile(server) -{ - server.QueryInterface(Components.interfaces.nsIRssIncomingServer); - var file = server.subscriptionsDataSourcePath; - - // If the file doesn't exist, create it. - if (!file.exists()) - createSubscriptionsFile(file); - - return file; -} - -function createSubscriptionsFile(file) -{ - file = new LocalFile(file, MODE_WRONLY | MODE_CREATE); - file.write('\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -'); - file.close(); -} - -var gFzItemsDS; // cache -function getItemsDS(server) -{ - if (gFzItemsDS) - return gFzItemsDS; - - var file = getItemsFile(server); - var url = fileHandler.getURLSpecFromFile(file); - gFzItemsDS = rdf.GetDataSourceBlocking(url); - if (!gFzItemsDS) - throw("can't get subscriptions data source"); - - // Note that it this point the datasource may not be loaded yet. - // You have to QueryInterface it to nsIRDFRemoteDataSource and check - // its "loaded" property to be sure. You can also attach an observer - // which will get notified when the load is complete. - return gFzItemsDS; -} - -function getItemsFile(server) -{ - server.QueryInterface(Components.interfaces.nsIRssIncomingServer); - var file = server.feedItemsDataSourcePath; - - // If the file doesn't exist, create it. - if (!file.exists()) - { - var newfile = new LocalFile(file, MODE_WRONLY | MODE_CREATE); - newfile.write('\ -\n\ -\n\ -\n\ -'); - newfile.close(); - } - return file; -} - -function removeAssertions(ds, resource) -{ - var properties = ds.ArcLabelsOut(resource); - var property; - while (properties.hasMoreElements()) - { - property = properties.getNext(); - var values = ds.GetTargets(resource, property, true); - var value; - while (values.hasMoreElements()) - { - value = values.getNext(); - ds.Unassert(resource, property, value, true); - } - } -} - -// Date validator for RSS feeds -const FZ_RFC822_RE = "^(((Mon)|(Tue)|(Wed)|(Thu)|(Fri)|(Sat)|(Sun)), *)?\\d\\d?" -+ " +((Jan)|(Feb)|(Mar)|(Apr)|(May)|(Jun)|(Jul)|(Aug)|(Sep)|(Oct)|(Nov)|(Dec))" -+ " +\\d\\d(\\d\\d)? +\\d\\d:\\d\\d(:\\d\\d)? +(([+-]?\\d\\d\\d\\d)|(UT)|(GMT)" -+ "|(EST)|(EDT)|(CST)|(CDT)|(MST)|(MDT)|(PST)|(PDT)|\\w)$"; - -function isValidRFC822Date(pubDate) -{ - var regex = new RegExp(FZ_RFC822_RE); - return regex.test(pubDate); -} - -function dateRescue(dateString) -{ - // Deal with various kinds of invalid dates - // Just timestamps for now. - if(!isNaN(parseInt(dateString))) - { //It's an integer, so maybe it's a timestamp - var d = new Date(parseInt(dateString)*1000); - var now = new Date(); - var yeardiff = now.getFullYear()-d.getFullYear(); - debug("Rescue Timestamp date: " + d.toString() + "\nYear diff:" + yeardiff + "\n"); - if((yeardiff >= 0) && (yeardiff<3)) - { - //it's quite likely the correct date - return d.toString(); - } - } - // Can't help. Set to current time. - return (new Date()).toString(); -} - -// Could be a prototype on String, but I don't know the policy on that -function trimString(s) -{ - return(s.replace(/^\s+/,'').replace(/\s+$/,'')); -} diff --git a/mozilla/mail/extensions/newsblog/jar.mn b/mozilla/mail/extensions/newsblog/jar.mn deleted file mode 100755 index 97705864022..00000000000 --- a/mozilla/mail/extensions/newsblog/jar.mn +++ /dev/null @@ -1,17 +0,0 @@ -newsblog.jar: -% content messenger-newsblog %content/messenger-newsblog/ xpcnativewrappers=yes -% overlay chrome://messenger/content/mailWindowOverlay.xul chrome://messenger-newsblog/content/toolbar-icon.xul -* content/messenger-newsblog/toolbar-icon.xul (content/toolbar-icon.xul) -* content/messenger-newsblog/edittree.xml (content/edittree.xml) -* content/messenger-newsblog/debug-utils.js (content/debug-utils.js) -* content/messenger-newsblog/Feed.js (content/Feed.js) -* content/messenger-newsblog/FeedItem.js (content/FeedItem.js) -* content/messenger-newsblog/feed-parser.js (content/feed-parser.js) -* content/messenger-newsblog/file-utils.js (content/file-utils.js) -* content/messenger-newsblog/utils.js (content/utils.js) -* content/messenger-newsblog/feed-properties.xul (content/feed-properties.xul) -* content/messenger-newsblog/feed-properties.js (content/feed-properties.js) -* content/messenger-newsblog/feed-subscriptions.js (content/feed-subscriptions.js) -* content/messenger-newsblog/feed-subscriptions.xul (content/feed-subscriptions.xul) -* content/messenger-newsblog/am-newsblog.xul (content/am-newsblog.xul) -* content/messenger-newsblog/am-newsblog.js (content/am-newsblog.js) diff --git a/mozilla/mail/extensions/newsblog/js/newsblog.js b/mozilla/mail/extensions/newsblog/js/newsblog.js deleted file mode 100755 index a61bae3f62d..00000000000 --- a/mozilla/mail/extensions/newsblog/js/newsblog.js +++ /dev/null @@ -1,558 +0,0 @@ -/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the News&Blog Feed Downloader - * - * The Initial Developer of the Original Code is - * The Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Myk Melez - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gExternalScriptsLoaded = false; - -var nsNewsBlogFeedDownloader = -{ - downloadFeed: function(aUrl, aFolder, aQuickMode, aTitle, aUrlListener, aMsgWindow) - { - if (!gExternalScriptsLoaded) - loadScripts(); - - // we don't yet support the ability to check for new articles while we are in the middle of - // subscribing to a feed. For now, abort the check for new feeds. - if (progressNotifier.mSubscribeMode) - { - debug('Aborting RSS New Mail Check. Feed subscription in progress\n'); - return; - } - // if folder seems to have lost its feeds, look in DS for feeds. - if (!aUrl.length) - { - var ds = getSubscriptionsDS(aFolder.server); - var enumerator = ds.GetSources(FZ_DESTFOLDER, aFolder, true); - var concatenatedUris = ""; - while (enumerator.hasMoreElements()) - { - var containerArc = enumerator.getNext(); - var uri = containerArc.QueryInterface(Components.interfaces.nsIRDFResource).Value; - if (concatenatedUris.length > 0) - concatenatedUris += "|"; - concatenatedUris += uri; - } - if (concatenatedUris.length > 0) - { - aUrl = concatenatedUris; - try - { - var msgdb = aFolder.getMsgDatabase(null); - var folderInfo = msgdb.dBFolderInfo; - folderInfo.setCharPtrProperty("feedUrl", concatenatedUris); - } - catch (ex) {dump(ex);} - } - } - // aUrl may be a delimited list of feeds for a particular folder. We need to kick off a download - // for each feed. - - var feedUrlArray = aUrl.split("|"); - - // we might just pull all these args out of the aFolder DB, instead of passing them in... - var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"] - .getService(Components.interfaces.nsIRDFService); - - progressNotifier.init(aMsgWindow, false); - - for (url in feedUrlArray) - { - if (feedUrlArray[url]) - { - id = rdf.GetResource(feedUrlArray[url]); - feed = new Feed(id, aFolder.server); - feed.folder = aFolder; - gNumPendingFeedDownloads++; // bump our pending feed download count - feed.download(true, progressNotifier); - } - } - }, - - subscribeToFeed: function(aUrl, aFolder, aMsgWindow) - { - if (!gExternalScriptsLoaded) - loadScripts(); - - // we don't support the ability to subscribe to several feeds at once yet... - // for now, abort the subscription if we are already in the middle of subscribing to a feed - // via drag and drop. - if (gNumPendingFeedDownloads) - { - debug('Aborting RSS subscription. Feed downloads already in progress\n'); - return; - } - - // if aFolder is null, then use the root folder for the first RSS account - if (!aFolder) - { - var accountManager = Components.classes["@mozilla.org/messenger/account-manager;1"] - .getService(Components.interfaces.nsIMsgAccountManager); - var allServers = accountManager.allServers; - for (var i=0; i< allServers.Count() && !aFolder; i++) - { - var currentServer = allServers.GetElementAt(i).QueryInterface(Components.interfaces.nsIMsgIncomingServer); - if (currentServer && currentServer.type == 'rss') - aFolder = currentServer.rootFolder; - } - } - - // What do we do if the user hasn't created an RSS account yet? - // for now, fall out, would be nice if we could force RSS account creation - if (!aFolder) - return; - - // if aUrl is a feed url, then it is of the form: feed:http://somesite/feed.xml or - // feed://http://somesite/feed.xml - // Strip off the feed: part so we can subscribe to the contained URL. - if (/^feed:/i.test(aUrl)) - { - aUrl = aUrl.replace(/^feed:/i, ''); - // Strip off the optional forward slashes if we were given feed:// - aUrl = aUrl.replace(/^\x2f\x2f/, ''); - } - - // make sure we aren't already subscribed to this feed before we attempt to subscribe to it. - if (feedAlreadyExists(aUrl, aFolder.server)) - { - aMsgWindow.statusFeedback.showStatusString(GetNewsBlogStringBundle().GetStringFromName('subscribe-feedAlreadySubscribed')); - return; - } - - var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"] - .getService(Components.interfaces.nsIRDFService); - - var itemResource = rdf.GetResource(aUrl); - var feed = new Feed(itemResource, aFolder.server); - feed.quickMode = feed.server.getBoolAttribute('quickMode'); - - if (!aFolder.isServer) // if the root server, create a new folder for the feed - feed.folder = aFolder; // user must want us to add this subscription url to an existing RSS folder. - - progressNotifier.init(aMsgWindow, true); - gNumPendingFeedDownloads++; - feed.download(true, progressNotifier); - }, - - updateSubscriptionsDS: function(aFolder, aUnsubscribe) - { - if (!gExternalScriptsLoaded) - loadScripts(); - - // an rss folder was just renamed...we need to update our feed data source - var msgdb = aFolder.QueryInterface(Components.interfaces.nsIMsgFolder).getMsgDatabase(null); - var folderInfo = msgdb.dBFolderInfo; - var feedurls = folderInfo.getCharPtrProperty("feedUrl"); - var feedUrlArray = feedurls.split("|"); - - var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); - var ds = getSubscriptionsDS(aFolder.server); - - for (url in feedUrlArray) - { - if (feedUrlArray[url]) - { - id = rdf.GetResource(feedUrlArray[url]); - // get the node for the current folder URI - var node = ds.GetTarget(id, FZ_DESTFOLDER, true); - - // we need to check and see if the folder is a child of the trash...if it is, then we can - // treat this as an unsubscribe action - if (aUnsubscribe) - { - var feeds = getSubscriptionsList(aFolder.server); - var index = feeds.IndexOf(id); - if (index != -1) - feeds.RemoveElementAt(index, false); - removeAssertions(ds, id); - } - else - ds.Change(id, FZ_DESTFOLDER, node, rdf.GetResource(aFolder.URI)); - } - } // for each feed url in the folder property - - ds.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource).Flush(); // flush any changes - }, - - QueryInterface: function(aIID) - { - if (aIID.equals(Components.interfaces.nsINewsBlogFeedDownloader) || - aIID.equals(Components.interfaces.nsISupports)) - return this; - - Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; - return null; - } -} - -var nsNewsBlogAcctMgrExtension = -{ - name: "newsblog", - chromePackageName: "messenger-newsblog", - showPanel: function (server) - { - return server.type == "rss"; - }, - QueryInterface: function(aIID) - { - if (aIID.equals(Components.interfaces.nsIMsgAccountManagerExtension) || - aIID.equals(Components.interfaces.nsISupports)) - return this; - - Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; - return null; - } -} - -var nsFeedCommandLineHandler = -{ - /* nsISupports */ - QueryInterface : function(aIID) - { - if (!aIID.equals(Components.interfaces.nsISupports) && - !aIID.equals(Components.interfaces.nsICommandLineHandler)) - throw Components.errors.NS_ERROR_NO_INTERFACE; - return this; - }, - - /* nsICommandLineHandler */ - handle : function(cmdLine) - { - // we only care about "-mail someurl" where someurl is a feed: url - // we also don't want to remove the parameter in case we don't end up handling it... - - var mailPos = cmdLine.findFlag("mail", false); - if (mailPos != -1 && cmdLine.length >= mailPos ) - { - var uriStr = cmdLine.getArgument(mailPos + 1); - if (/^feed:/i.test(uriStr)) - { - var mailWindow = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService() - .QueryInterface(Components.interfaces.nsIWindowMediator).getMostRecentWindow("mail:3pane"); - - // if we don't have a 3 pane window visible already, then we can optimize and do nothing here, - // that will let the default command line handler create a 3pane window for us using the feed - // URL as an argument to that window when it gets constructed...so we only care about the - // case where we want to re-use an existing 3 pane to subscribe to the feed url - if (mailWindow) - { - cmdLine.handleFlagWithParam("mail", false); // eat up the arguments we are now handling - cmdLine.preventDefault = true; // prevent the default cmd line handler from doing anything - - var feedHandler = Components.classes["@mozilla.org/newsblog-feed-downloader;1"].getService(Components.interfaces.nsINewsBlogFeedDownloader); - if (feedHandler) - feedHandler.subscribeToFeed(uriStr, null, mailWindow.msgWindow); - } - } - } - }, - - helpInfo : "" -}; - -var nsNewsBlogFeedDownloaderModule = -{ - getClassObject: function(aCompMgr, aCID, aIID) - { - if (!aIID.equals(Components.interfaces.nsIFactory)) - throw Components.results.NS_ERROR_NOT_IMPLEMENTED; - - for (var key in this.mObjects) - if (aCID.equals(this.mObjects[key].CID)) - return this.mObjects[key].factory; - - throw Components.results.NS_ERROR_NO_INTERFACE; - }, - - mObjects: - { - feedDownloader: - { - CID: Components.ID("{5c124537-adca-4456-b2b5-641ab687d1f6}"), - contractID: "@mozilla.org/newsblog-feed-downloader;1", - className: "News+Blog Feed Downloader", - factory: - { - createInstance: function (aOuter, aIID) - { - if (aOuter != null) - throw Components.results.NS_ERROR_NO_AGGREGATION; - if (!aIID.equals(Components.interfaces.nsINewsBlogFeedDownloader) && - !aIID.equals(Components.interfaces.nsISupports)) - throw Components.results.NS_ERROR_INVALID_ARG; - - // return the singleton - return nsNewsBlogFeedDownloader.QueryInterface(aIID); - } - } // factory - }, // feed downloader - - nsNewsBlogAcctMgrExtension: - { - CID: Components.ID("{E109C05F-D304-4ca5-8C44-6DE1BFAF1F74}"), - contractID: "@mozilla.org/accountmanager/extension;1?name=newsblog", - className: "News+Blog Account Manager Extension", - factory: - { - createInstance: function (aOuter, aIID) - { - if (aOuter != null) - throw Components.results.NS_ERROR_NO_AGGREGATION; - if (!aIID.equals(Components.interfaces.nsIMsgAccountManagerExtension) && - !aIID.equals(Components.interfaces.nsISupports)) - throw Components.results.NS_ERROR_INVALID_ARG; - - // return the singleton - return nsNewsBlogAcctMgrExtension.QueryInterface(aIID); - } - } // factory - }, // account manager extension - - nsFeedCommandLineHandler: - { - CID: Components.ID("{0E377BF7-E4FE-4c94-804C-0C33D49F883E}"), - contractID: "@mozilla.org/newsblog-feed-downloader/clh;1", - className: "Feed CommandLine Handler", - factory: - { - createInstance: function (aOuter, aIID) - { - if (aOuter != null) - throw Components.results.NS_ERROR_NO_AGGREGATION; - if (!aIID.equals(Components.interfaces.nsICommandLineHandler) && - !aIID.equals(Components.interfaces.nsISupports)) - throw Components.results.NS_ERROR_INVALID_ARG; - - // return the singleton - return nsFeedCommandLineHandler.QueryInterface(aIID); - } - } // factory - } - }, - - registerSelf: function(aCompMgr, aFileSpec, aLocation, aType) - { - aCompMgr = aCompMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar); - for (var key in this.mObjects) - { - var obj = this.mObjects[key]; - aCompMgr.registerFactoryLocation(obj.CID, obj.className, obj.contractID, aFileSpec, aLocation, aType); - } - - // we also need to do special account extension registration - var catman = Components.classes["@mozilla.org/categorymanager;1"].getService(Components.interfaces.nsICategoryManager); - catman.addCategoryEntry("mailnews-accountmanager-extensions", - "newsblog account manager extension", - "@mozilla.org/accountmanager/extension;1?name=newsblog", true, true); - catman.addCategoryEntry("command-line-handler", - "l-feed", - "@mozilla.org/newsblog-feed-downloader/clh;1", true, true); - }, - - unregisterSelf: function(aCompMgr, aFileSpec, aLocation) - { - aCompMgr = aCompMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar); - for (var key in this.mObjects) - { - var obj = this.mObjects[key]; - aCompMgr.unregisterFactoryLocation(obj.CID, aFileSpec); - } - - // unregister the account manager extension - catman = Components.classes["@mozilla.org/categorymanager;1"].getService(Components.interfaces.nsICategoryManager); - catman.deleteCategoryEntry("mailnews-accountmanager-extensions", - "@mozilla.org/accountmanager/extension;1?name=newsblog", true); - catMan.addCategoryEntry("command-line-handler", - "@mozilla.org/newsblog-feed-downloader/clh;1", true); - }, - - canUnload: function(aCompMgr) - { - return true; - } -}; - -function NSGetModule(aCompMgr, aFileSpec) -{ - return nsNewsBlogFeedDownloaderModule; -} - -function loadScripts() -{ - var scriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] - .getService(Components.interfaces.mozIJSSubScriptLoader); - if (scriptLoader) - { - scriptLoader.loadSubScript("chrome://messenger-newsblog/content/Feed.js"); - scriptLoader.loadSubScript("chrome://messenger-newsblog/content/FeedItem.js"); - scriptLoader.loadSubScript("chrome://messenger-newsblog/content/feed-parser.js"); - scriptLoader.loadSubScript("chrome://messenger-newsblog/content/file-utils.js"); - scriptLoader.loadSubScript("chrome://messenger-newsblog/content/utils.js"); - } - - gExternalScriptsLoaded = true; -} - -// Progress glue code. Acts as a go between the RSS back end and the mail window front end -// determined by the aMsgWindow parameter passed into nsINewsBlogFeedDownloader. -// gNumPendingFeedDownloads: keeps track of the total number of feeds we have been asked to download -// this number may not reflect the # of entries in our mFeeds array because not all -// feeds may have reported in for the first time... -var gNumPendingFeedDownloads = 0; - -var progressNotifier = { - mSubscribeMode: false, - mMsgWindow: null, - mStatusFeedback: null, - mFeeds: new Array, - - init: function(aMsgWindow, aSubscribeMode) - { - if (!gNumPendingFeedDownloads) // if we aren't already in the middle of downloading feed items... - { - this.mStatusFeedback = aMsgWindow ? aMsgWindow.statusFeedback : null; - this.mSubscribeMode = aSubscribeMode; - this.mMsgWindow = aMsgWindow; - - if (this.mStatusFeedback) - { - this.mStatusFeedback.startMeteors(); - this.mStatusFeedback.showStatusString(aSubscribeMode ? GetNewsBlogStringBundle().GetStringFromName('subscribe-validating') - : GetNewsBlogStringBundle().GetStringFromName('newsblog-getNewMailCheck')); - } - } - }, - - downloaded: function(feed, aErrorCode) - { - if (this.mSubscribeMode && aErrorCode == kNewsBlogSuccess) - { - // if we get here...we should always have a folder by now...either - // in feed.folder or FeedItems created the folder for us.... - updateFolderFeedUrl(feed.folder, feed.url, false); - addFeed(feed.url, feed.name, feed.folder); // add feed just adds the feed to the subscription UI and flushes the datasource - - // Nice touch: select the folder that now contains the newly subscribed feed...this is particularly nice - // if we just finished subscribing to a feed URL that the operating system gave us. - this.mMsgWindow.SelectFolder(feed.folder.URI); - } - - if (this.mStatusFeedback) - { - var newsBlogBundle = GetNewsBlogStringBundle(); - if (aErrorCode == kNewsBlogNoNewItems) - this.mStatusFeedback.showStatusString(newsBlogBundle.GetStringFromName("newsblog-noNewArticlesForFeed")); - else if (aErrorCode == kNewsBlogInvalidFeed) - this.mStatusFeedback.showStatusString(newsBlogBundle.formatStringFromName("newsblog-invalidFeed", - [feed.url], 1)); - else if (aErrorCode == kNewsBlogRequestFailure) - this.mStatusFeedback.showStatusString(newsBlogBundle.formatStringFromName("newsblog-networkError", - [feed.url], 1)); - this.mStatusFeedback.stopMeteors(); - } - - gNumPendingFeedDownloads--; - - if (!gNumPendingFeedDownloads) - { - this.mFeeds = new Array; - - this.mSubscribeMode = false; - - // should we do this on a timer so the text sticks around for a little while? - // It doesnt look like we do it on a timer for newsgroups so we'll follow that model. - if (aErrorCode == kNewsBlogSuccess && this.mStatusFeedback) // don't clear the status text if we just dumped an error to the status bar! - this.mStatusFeedback.showStatusString(""); - } - }, - - // this gets called after the RSS parser finishes storing a feed item to disk - // aCurrentFeedItems is an integer corresponding to how many feed items have been downloaded so far - // aMaxFeedItems is an integer corresponding to the total number of feed items to download - onFeedItemStored: function (feed, aCurrentFeedItems, aMaxFeedItems) - { - // we currently don't do anything here. Eventually we may add - // status text about the number of new feed articles received. - - if (this.mSubscribeMode && this.mStatusFeedback) // if we are subscribing to a feed, show feed download progress - { - this.mStatusFeedback.showStatusString(GetNewsBlogStringBundle().formatStringFromName("subscribe-fetchingFeedItems", [aCurrentFeedItems, aMaxFeedItems], 2)); - this.onProgress(feed, aCurrentFeedItems, aMaxFeedItems); - } - }, - - onProgress: function(feed, aProgress, aProgressMax) - { - if (feed.url in this.mFeeds) // have we already seen this feed? - this.mFeeds[feed.url].currentProgress = aProgress; - else - this.mFeeds[feed.url] = {currentProgress: aProgress, maxProgress: aProgressMax}; - - this.updateProgressBar(); - }, - - updateProgressBar: function() - { - var currentProgress = 0; - var maxProgress = 0; - for (index in this.mFeeds) - { - currentProgress += this.mFeeds[index].currentProgress; - maxProgress += this.mFeeds[index].maxProgress; - } - - // if we start seeing weird "jumping" behavior where the progress bar goes below a threshold then above it again, - // then we can factor a fudge factor here based on the number of feeds that have not reported yet and the avg - // progress we've already received for existing feeds. Fortunately the progressmeter is on a timer - // and only updates every so often. For the most part all of our request have initial progress - // before the UI actually picks up a progress value. - - if (this.mStatusFeedback) - { - var progress = (currentProgress * 100) / maxProgress; - this.mStatusFeedback.showProgress(progress); - } - } -} - -function GetNewsBlogStringBundle(name) -{ - var strBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(); - strBundleService = strBundleService.QueryInterface(Components.interfaces.nsIStringBundleService); - var strBundle = strBundleService.createBundle("chrome://messenger-newsblog/locale/newsblog.properties"); - return strBundle; -} diff --git a/mozilla/mail/extensions/newsblog/rss.rdf b/mozilla/mail/extensions/newsblog/rss.rdf deleted file mode 100644 index d898b2484b6..00000000000 --- a/mozilla/mail/extensions/newsblog/rss.rdf +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - &rss.hostName; - rss - 100 - nobody - - - - - - - - - - true - true - &rss.accountName; - identitypage,serverpage,loginpage - &rss.wizardShortName; - &rss.wizardLongName; - true - RSS - false - - - - - diff --git a/mozilla/mail/extensions/offline/Makefile.in b/mozilla/mail/extensions/offline/Makefile.in deleted file mode 100644 index 4502b21079c..00000000000 --- a/mozilla/mail/extensions/offline/Makefile.in +++ /dev/null @@ -1,45 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/mail/extensions/offline/content/mail-offline.js b/mozilla/mail/extensions/offline/content/mail-offline.js deleted file mode 100644 index a163279983e..00000000000 --- a/mozilla/mail/extensions/offline/content/mail-offline.js +++ /dev/null @@ -1,272 +0,0 @@ -# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is Mozilla Communicator client code, released -# March 31, 1998. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998-2001 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -var gMailOfflinePrefs = null; -var gOfflinePromptsBundle; -var gPromptService; -var gOfflineManager; - - -function MailOfflineStateChanged(goingOffline) -{ - // tweak any mail UI here that needs to change when we go offline or come back online - gFolderJustSwitched = true; -} - -function MsgSettingsOffline() -{ - window.parent.MsgAccountManager('am-offline.xul'); -} - -// Init PrefsService -function GetMailOfflinePrefs() -{ - // Store the prefs object - try { - var prefsService = Components.classes["@mozilla.org/preferences-service;1"]; - if (prefsService) - prefsService = prefsService.getService(); - if (prefsService) - gMailOfflinePrefs = prefsService.QueryInterface(Components.interfaces.nsIPrefBranch); - - if (!gMailOfflinePrefs) - dump("failed to get prefs service!\n"); - } - catch(ex) { - dump("failed to get prefs service!\n"); - } -} - -// Check for unsent messages -function CheckForUnsentMessages() -{ - try - { - var am = Components.classes["@mozilla.org/messenger/account-manager;1"] - .getService(Components.interfaces.nsIMsgAccountManager); - var msgSendlater = Components.classes["@mozilla.org/messengercompose/sendlater;1"] - .getService(Components.interfaces.nsIMsgSendLater); - var identitiesCount, allIdentities, currentIdentity, numMessages, msgFolder; - - if(am) { - allIdentities = am.allIdentities; - identitiesCount = allIdentities.Count(); - for (var i = 0; i < identitiesCount; i++) { - currentIdentity = allIdentities.QueryElementAt(i, Components.interfaces.nsIMsgIdentity); - msgFolder = msgSendlater.getUnsentMessagesFolder(currentIdentity); - if(msgFolder) { - // if true, descends into all subfolders - numMessages = msgFolder.getTotalMessages(false); - if(numMessages > 0) return true; - } - } - } - } - catch(ex) { - } - return false; -} - -// Init nsIPromptService & strings. -function InitPrompts() -{ - if(!gPromptService) { - gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); - gPromptService = gPromptService.QueryInterface(Components.interfaces.nsIPromptService); - } - if (!gOfflinePromptsBundle) - gOfflinePromptsBundle = document.getElementById("bundle_offlinePrompts"); -} - -// prompt for sending messages while going online, and go online. -function PromptSendMessages() -{ - InitPrompts(); - InitServices(); - - if (gPromptService) { - var checkValue = {value:true}; - var buttonPressed = gPromptService.confirmEx(window, - gOfflinePromptsBundle.getString('sendMessagesWindowTitle'), - gOfflinePromptsBundle.getString('sendMessagesLabel'), - gPromptService.BUTTON_TITLE_IS_STRING * (gPromptService.BUTTON_POS_0 + - gPromptService.BUTTON_POS_1 + gPromptService.BUTTON_POS_2), - gOfflinePromptsBundle.getString('sendMessagesSendButtonLabel'), - gOfflinePromptsBundle.getString('sendMessagesCancelButtonLabel'), - gOfflinePromptsBundle.getString('sendMessagesNoSendButtonLabel'), - gOfflinePromptsBundle.getString('sendMessagesCheckboxLabel'), - checkValue); - if(buttonPressed == 0) { - gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", !checkValue.value); - gOfflineManager.goOnline(true, true, msgWindow); - return true; - } - if(buttonPressed == 1) { - return false; - } - if(buttonPressed == 2) { - gMailOfflinePrefs.setIntPref("offline.send.unsent_messages", 2*!checkValue.value); - gOfflineManager.goOnline(false, true, msgWindow); - return true; - } - } - return false; -} - -// prompt for downlading messages while going offline, and synchronise -function PromptDownloadMessages() -{ - InitPrompts(); - InitServices(); - - if(gPromptService) { - var checkValue = {value:true}; - var buttonPressed = gPromptService.confirmEx(window, - gOfflinePromptsBundle.getString('downloadMessagesWindowTitle'), - gOfflinePromptsBundle.getString('downloadMessagesLabel'), - gPromptService.BUTTON_TITLE_IS_STRING * (gPromptService.BUTTON_POS_0 + - gPromptService.BUTTON_POS_1 + gPromptService.BUTTON_POS_2), - gOfflinePromptsBundle.getString('downloadMessagesDownloadButtonLabel'), - gOfflinePromptsBundle.getString('downloadMessagesCancelButtonLabel'), - gOfflinePromptsBundle.getString('downloadMessagesNoDownloadButtonLabel'), - gOfflinePromptsBundle.getString('downloadMessagesCheckboxLabel'), - checkValue); - if(buttonPressed == 0) { - gMailOfflinePrefs.setIntPref("offline.download.download_messages", !checkValue.value); - gOfflineManager.synchronizeForOffline(true, true, false, true, msgWindow); - return true; - } - if(buttonPressed == 1) { - return false; - } - if(buttonPressed == 2) { - gMailOfflinePrefs.setIntPref("offline.download.download_messages", 2*!checkValue.value); - gOfflineManager.synchronizeForOffline(false, false, false, true, msgWindow); - return true; - } - } - return false; -} - -// online? -function CheckOnline() -{ - var ioService = Components.classes["@mozilla.org/network/io-service;1"] - .getService(Components.interfaces.nsIIOService); - return (!ioService.offline); -} - -// Init Pref Service & Offline Manager -function InitServices() -{ - if (!gMailOfflinePrefs) - GetMailOfflinePrefs(); - - if (!gOfflineManager) - GetOfflineMgrService(); -} - -// Init Offline Manager -function GetOfflineMgrService() -{ - if (!gOfflineManager) { - gOfflineManager = Components.classes["@mozilla.org/messenger/offline-manager;1"] - .getService(Components.interfaces.nsIMsgOfflineManager); - } -} - -// This function must always return false to prevent toggling of offline state because -// we change the offline state ourselves -function MailCheckBeforeOfflineChange() -{ - var ioService = Components.classes["@mozilla.org/network/io-service;1"] - .getService(Components.interfaces.nsIIOService); - - var goingOnline = ioService.offline; - var bundle = srGetStrBundle("chrome://communicator/locale/utilityOverlay.properties"); - -// messenger.SetWindow(window, msgWindow); - - InitServices(); - - var prefSendUnsentMessages = gMailOfflinePrefs.getIntPref("offline.send.unsent_messages"); - var prefDownloadMessages = gMailOfflinePrefs.getIntPref("offline.download.download_messages"); - - if(goingOnline) { - switch(prefSendUnsentMessages) { - case 0: - if(CheckForUnsentMessages()) { - if(! PromptSendMessages()) - return false; - } - else - gOfflineManager.goOnline(false /* sendUnsentMessages */, - true /* playbackOfflineImapOperations */, - msgWindow); - break; - case 1: - gOfflineManager.goOnline(CheckForUnsentMessages() /* sendUnsentMessages */, - true /* playbackOfflineImapOperations */, - msgWindow); - break; - case 2: - gOfflineManager.goOnline(false /* sendUnsentMessages */, - true /* playbackOfflineImapOperations */, - msgWindow); - break; - } - } - else { - // going offline - switch(prefDownloadMessages) { - case 0: - if(! PromptDownloadMessages()) return false; - break; - case 1: - // download news, download mail, send unsent messages, go offline when done, msg window - gOfflineManager.synchronizeForOffline(true, true, false, true, msgWindow); - break; - case 2: - // download news, download mail, send unsent messages, go offline when done, msg window - gOfflineManager.synchronizeForOffline(false, false, false, true, msgWindow); - break; - } - } - return false; -} - diff --git a/mozilla/mail/extensions/offline/content/msgOfflineOverlay.xul b/mozilla/mail/extensions/offline/content/msgOfflineOverlay.xul deleted file mode 100644 index ed7b8e84b91..00000000000 --- a/mozilla/mail/extensions/offline/content/msgOfflineOverlay.xul +++ /dev/null @@ -1,78 +0,0 @@ - - -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is Netscape Communicator. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2002 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the LGPL or the GPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mozilla/mail/extensions/smime/content/msgCompSecurityInfo.xul b/mozilla/mail/extensions/smime/content/msgCompSecurityInfo.xul deleted file mode 100644 index 5e7a34c28d3..00000000000 --- a/mozilla/mail/extensions/smime/content/msgCompSecurityInfo.xul +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - \n"); - fprintf(stdout, "%s starting at %s", program, ctime(&start)); - fflush(stdout); - } - - argc -= optind; - argv += optind; - if (argc == 0) { - if (tmreader_eventloop(tmr, "-", my_tmevent_handler) <= 0) - exit(1); - } else { - for (i = j = 0; i < argc; i++) { - fp = fopen(argv[i], "r"); - if (!fp) { - fprintf(stderr, "%s: can't open %s: %s\n", - program, argv[i], strerror(errno)); - exit(1); - } - rv = tmreader_eventloop(tmr, argv[i], my_tmevent_handler); - if (rv < 0) - exit(1); - if (rv > 0) - j++; - fclose(fp); - } - if (j == 0) - exit(1); - } - - compute_callsite_totals(&tmr->calltree_root); - walk_callsite_tree(&tmr->calltree_root, 0, 0, stdout); - - if (js_mode) { - fprintf(stdout, - "\n" - "\n" - " \n" - " \n" - "\n", - stdout); - } - } - - exit(0); -} diff --git a/mozilla/tools/trace-malloc/diffbloatdump.pl b/mozilla/tools/trace-malloc/diffbloatdump.pl deleted file mode 100755 index 7d7ab8517d7..00000000000 --- a/mozilla/tools/trace-malloc/diffbloatdump.pl +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/perl -w -# vim:cindent:ts=8:et:sw=4: -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2001 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# L. David Baron (original author) -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** */ - -# This script produces a diff between two files that are the result of -# calling NS_TraceMallocDumpAllocations. Such files can be created -# through the command-line option --shutdown-leaks= or through -# the DOM function window.TraceMallocDumpAllocations(). Both -# methods will work only if --trace-malloc= is also given on -# the command line. - -use 5.004; -use strict; -use Getopt::Long; - -$::opt_help = 0; -$::opt_depth = 6; -$::opt_include_zero = 0; -$::opt_allocation_count = 0; -$::opt_use_address = 0; - -Getopt::Long::Configure("pass_through"); -Getopt::Long::GetOptions("help", "allocation-count", "depth=i", - "include-zero", "use-address"); - -if ($::opt_help) { - die "usage: diffbloatdump.pl [options] - --help Display this message - - --allocation-count Use allocation count rather than size (i.e., treat - all sizes as 1). - --depth= Only display frames at top of allocation stack. - --include-zero Display subtrees totalling zero. - --use-address Don't ignore the address part of the stack trace - (can make comparison more accurate when comparing - results from the same build) -"; -} - -my $calltree = { count => 0 }; # leave children undefined - -sub add_file($$) { - # Takes (1) a reference to a file descriptor for input and (2) the - # factor to multiply the stacks by (generally +1 or -1). - # Returns a reference to an array representing the stack, allocation - # site in array[0]. - sub read_stack($) { - my ($infile) = @_; - my $line; - my @stack; - - # read the data at the memory location - while ( defined($infile) && ($line = <$infile>) && substr($line,0,1) eq "\t" ) { - # do nothing - } - - # read the stack - do { - chomp($line); - if ( ! $::opt_use_address && - $line =~ /(.*)\[(.*)\]/) { - $line = $1; - } - $stack[$#stack+1] = $line; - } while ( defined($infile) && ($line = <$infile>) && $line ne "\n" && $line ne "\r\n" ); - - return \@stack; - } - - # adds the stack given as a parameter (reference to array, $stack[0] is - # allocator) to $calltree, with the call count multiplied by $factor - # (typically +1 or -1). - sub add_stack($$) { - my @stack = @{$_[0]}; - my $factor = $_[1]; - - my $i = 0; - my $node = $calltree; - while ($i < $#stack && $i < $::opt_depth) { - $node->{count} += $factor; - if (!defined($node->{children})) { - $node->{children} = {}; - } - if (!defined($node->{children}->{$stack[$i]})) { - $node->{children}->{$stack[$i]} = { count => 0 }; - } - $node = $node->{children}->{$stack[$i]}; - ++$i; - } - $node->{count} += $factor; - } - - my ($infile, $factor) = @_; - - open (INFILE, "<$infile") || die "Can't open input \"$infile\""; - while ( ! eof(INFILE) ) { - # read the type and address - my $line = ; - unless ($line =~ /.*\((\d*)\)[\r|\n]/) { - die "badly formed allocation header in $infile"; - } - my $size; - if ($::opt_allocation_count) { - $size = 1; - } else { - $size = $1; - } - - add_stack(read_stack(\*INFILE), $size * $factor); - } - close INFILE; -} - -sub print_node_indent($$$); - -sub print_calltree() { - sub print_indent($) { - my ($i) = @_; - while (--$i >= 0) { - print " "; - } - } - - sub print_node_indent($$$) { - my ($nodename, $node, $indent) = @_; - - if (!$::opt_include_zero && $node->{count} == 0) { - return; - } - - print_indent($indent); - print "$node->{count} $nodename\n"; - if (defined($node->{children})) { - my %kids = %{$node->{children}}; - ++$indent; - foreach my $kid (sort { $kids{$b}->{count} <=> $kids{$a}->{count} } - keys (%kids)) { - print_node_indent($kid, $kids{$kid}, $indent); - } - } - } - - print_node_indent("malloc", $calltree, 0); -} - -add_file($ARGV[0], -1); -add_file($ARGV[1], 1); -print_calltree(); diff --git a/mozilla/tools/trace-malloc/formdata.c b/mozilla/tools/trace-malloc/formdata.c deleted file mode 100644 index cc7f2ba36ed..00000000000 --- a/mozilla/tools/trace-malloc/formdata.c +++ /dev/null @@ -1,238 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is formdata.c code, released - * May 9, 2002. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Garrett Arch Blythe, 09-May-2002 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* -** formdata.c -** -** Play utility to parse up form get data into name value pairs. -*/ - -#include "formdata.h" - -#include -#include -#include - - -static void unhexcape(char* inPlace) -/* -** Real low tech unhexcaper.... -** -** inPlace string to decode, in place as it were. -*/ -{ - if(NULL != inPlace) - { - int index1 = 0; - int index2 = 0; - int theLen = strlen(inPlace); - - for(; index1 <= theLen; index1++) - { - if('%' == inPlace[index1] && '\0' != inPlace[index1 + 1] && '\0' != inPlace[index1 + 2]) - { - int unhex = 0; - - if('9' >= inPlace[index1 + 1]) - { - unhex |= ((inPlace[index1 + 1] - '0') << 4); - } - else - { - unhex |= ((toupper(inPlace[index1 + 1]) - 'A' + 10) << 4); - } - - if('9' >= inPlace[index1 + 2]) - { - unhex |= (inPlace[index1 + 2] - '0'); - } - else - { - unhex |= (toupper(inPlace[index1 + 2]) - 'A' + 10); - } - - index1 += 2; - inPlace[index1] = unhex; - } - - inPlace[index2++] = inPlace[index1]; - } - } -} - - -FormData* FormData_Create(const char* inFormData) -{ - FormData* retval = NULL; - - if(NULL != inFormData) - { - FormData* container = NULL; - - /* - ** Allocate form data container. - */ - container = (FormData*)calloc(1, sizeof(FormData)); - if(NULL != container) - { - /* - ** Dup the incoming form data. - */ - container->mStorage = strdup(inFormData); - if(NULL != container->mStorage) - { - char* traverse = NULL; - unsigned nvpairs = 1; - unsigned storeLen = 0; - - /* - ** Count the number of pairs we are going to have. - ** We do this by counting '&' + 1. - */ - for(traverse = container->mStorage; '\0' != *traverse; traverse++) - { - if('&' == *traverse) - { - nvpairs++; - } - } - storeLen = (unsigned)(traverse - container->mStorage); - - /* - ** Allocate space for our names and values. - */ - container->mNArray = (char**)calloc(nvpairs * 2, sizeof(char*)); - if(NULL != container->mNArray) - { - char* amp = NULL; - char* equ = NULL; - - container->mVArray = &container->mNArray[nvpairs]; - - /* - ** Go back over the storage. - ** Fill in the names and values as we go. - ** Terminate on dividing '=' and '&' characters. - ** Increase the count of items as we go. - */ - for(traverse = container->mStorage; NULL != traverse; container->mNVCount++) - { - container->mNArray[container->mNVCount] = traverse; - - amp = strchr(traverse, '&'); - equ = strchr(traverse, '='); - traverse = NULL; - - if(NULL != equ && (NULL == amp || equ < amp)) - { - *equ++ = '\0'; - - container->mVArray[container->mNVCount] = equ; - } - else - { - container->mVArray[container->mNVCount] = (container->mStorage + storeLen); - } - - if(NULL != amp) - { - *amp++ = '\0'; - - traverse = amp; - } - - unhexcape(container->mNArray[container->mNVCount]); - unhexcape(container->mVArray[container->mNVCount]); - } - - retval = container; - } - } - } - - /* - ** If we failed, cleanup. - */ - if(NULL == retval) - { - FormData_Destroy(container); - } - } - - return retval; -} - - -void FormData_Destroy(FormData* inDestroy) -{ - if(NULL != inDestroy) - { - unsigned traverse = 0; - - for(traverse = 0; traverse < inDestroy->mNVCount; traverse++) - { - if(NULL != inDestroy->mNArray) - { - inDestroy->mNArray[traverse] = NULL; - } - if(NULL != inDestroy->mVArray) - { - inDestroy->mVArray[traverse] = NULL; - } - } - inDestroy->mNVCount = 0; - - if(NULL != inDestroy->mStorage) - { - free(inDestroy->mStorage); - inDestroy->mStorage = NULL; - } - - if(NULL != inDestroy->mNArray) - { - free(inDestroy->mNArray); - inDestroy->mNArray = NULL; - inDestroy->mVArray = NULL; - } - - free(inDestroy); - inDestroy = NULL; - } -} diff --git a/mozilla/tools/trace-malloc/formdata.h b/mozilla/tools/trace-malloc/formdata.h deleted file mode 100644 index 53caafca76a..00000000000 --- a/mozilla/tools/trace-malloc/formdata.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is formdata.h code, released - * May 9, 2002. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Garrett Arch Blythe, 09-May-2002 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#if !defined(__formdata_H__) -#define __formdata_H__ - -/* -** formdata.h -** -** Play (quick and dirty) utility API to parse up form get data into -** name value pairs. -*/ - -typedef struct __struct_FormData -/* -** Structure to hold the breakdown of any form data. -** -** mNArray Each form datum is a name value pair. -** This array holds the names. -** You can find the corresponding value at the same index in -** mVArray. -** Never NULL, but perhpas an empty string. -** mVArray Each form datum is a name value pair. -** This array holds the values. -** You can find the corresponding name at the same index in -** mNArray. -** Never NULL, but perhpas an empty string. -** mNVCount Count of array items in both mNArray and mVArray. -** mStorage Should be ignored by users of this API. -** In reality holds the duped and decoded form data. -*/ -{ - char** mNArray; - char** mVArray; - unsigned mNVCount; - char* mStorage; -} -FormData; - -FormData* FormData_Create(const char* inFormData) -/* -** Take a contiguous string of form data, possibly hex encoded, and return -** the name value pairs parsed up and decoded. -** A caller of this routine should call FormData_Destroy at some point. -** -** inFormData The form data to parse up and decode. -** returns FormData* The result of our effort. -** This should be passed to FormData_Destroy at some -** point of the memory will be leaked. -*/ -; - -void FormData_Destroy(FormData* inDestroy) -/* -** Release to the heap the structure previously created via FormData_Create. -** -** inDestroy The object to free off. -*/ -; - -#endif /* __formdata_H__ */ diff --git a/mozilla/tools/trace-malloc/getopt.c b/mozilla/tools/trace-malloc/getopt.c deleted file mode 100755 index 08d9d1d9b08..00000000000 --- a/mozilla/tools/trace-malloc/getopt.c +++ /dev/null @@ -1,139 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -/* - * Copyright (c) 1987 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that: (1) source distributions retain this entire copyright - * notice and comment, and (2) distributions including binaries display - * the following acknowledgement: ``This product includes software - * developed by the University of California, Berkeley and its contributors'' - * in the documentation or other materials provided with the distribution - * and in all advertising materials mentioning features or use of this - * software. Neither the name of the University nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getopt.c 4.12 (Berkeley) 6/1/90"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include -#define index strchr -#define rindex strrchr - -/* - * get option letter from argument vector - */ -int opterr = 1, /* if error message should be printed */ - optind = 1, /* index into parent argv vector */ - optopt; /* character checked for validity */ -char *optarg; /* argument associated with option */ - -#define BADCH (int)'?' -#define EMSG "" - -getopt(int nargc, char **nargv, char *ostr) -{ - static char *place = EMSG; /* option letter processing */ - register char *oli; /* option letter list index */ - char *p; - - if (!*place) { /* update scanning pointer */ - if (optind >= nargc || *(place = nargv[optind]) != '-') { - place = EMSG; - return(EOF); - } - if (place[1] && *++place == '-') { /* found "--" */ - ++optind; - place = EMSG; - return(EOF); - } - } /* option letter okay? */ - if ((optopt = (int)*place++) == (int)':' || - !(oli = index(ostr, optopt))) { - /* - * if the user didn't specify '-' as an option, - * assume it means EOF. - */ - if (optopt == (int)'-') - return(EOF); - if (!*place) - ++optind; - if (opterr) { - if (!(p = rindex(*nargv, '/'))) - p = *nargv; - else - ++p; - (void)fprintf(stderr, "%s: illegal option -- %c\n", - p, optopt); - } - return(BADCH); - } - if (*++oli != ':') { /* don't need argument */ - optarg = NULL; - if (!*place) - ++optind; - } - else { /* need an argument */ - if (*place) /* no white space */ - optarg = place; - else if (nargc <= ++optind) { /* no arg */ - place = EMSG; - if (!(p = rindex(*nargv, '/'))) - p = *nargv; - else - ++p; - if (opterr) - (void)fprintf(stderr, - "%s: option requires an argument -- %c\n", - p, optopt); - return(BADCH); - } - else /* white space */ - optarg = nargv[optind]; - place = EMSG; - ++optind; - } - return(optopt); /* dump back option letter */ -} diff --git a/mozilla/tools/trace-malloc/histogram-diff.sh b/mozilla/tools/trace-malloc/histogram-diff.sh deleted file mode 100755 index 633d3eaee89..00000000000 --- a/mozilla/tools/trace-malloc/histogram-diff.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is historgram-diff.sh, released -# Dec 8, 2000. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2000 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Chris Waterson -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -# histogram-diff.sh [-c ] -# -# Compute incremental memory growth from histogram in file to -# histogram in file , displaying at most rows. - -# How many rows are we gonna show? -COUNT=20 - -# Read arguments -while [ $# -gt 0 ]; do - case "$1" in - -c) COUNT=$2 - shift 2 - ;; - *) break - ;; - esac -done - -BASE=$1 -INCR=$2 - -# Sort the base and incremental files so that we can `join' them on -# the type name -sort $BASE > /tmp/$$.left -sort $INCR > /tmp/$$.right - -# Do the join. The `awk' script computes the difference between -# the base and the incremental files. -join /tmp/$$.left /tmp/$$.right \ - | awk '{ print $1, $2, $3, $4, $5, $4 - $2, $5 - $3; }' \ - > /tmp/$$.joined - -rm -f /tmp/$$.left /tmp/$$.right - -# Now compute a `TOTAL' row. -awk '{ tobj1 += $2; tbytes1 += $3; tobj2 += $4; tbytes2 += $5; tdobj += $6; tdbytes += $7; } END { print "TOTAL", tobj1, tbytes1, tobj2, tbytes2, tdobj, tdbytes; }' /tmp/$$.joined \ - > /tmp/$$.sorted - -# Then, we sort by the largest delta in bytes. -sort -nr +6 /tmp/$$.joined >> /tmp/$$.sorted - -rm -f /tmp/$$.joined - -# Pretty-print, including percentages -cat < /tmp/$$.awk -BEGIN { - print " ---- Base ---- ---- Incr ---- ----- Difference ----"; - print "Type Count Bytes Count Bytes Count Bytes %Total"; - } -\$1 == "TOTAL" { - tbytes = \$7; - } -NR <= $COUNT { - printf "%-22s %6d %8d %6d %8d %6d %8d %6.2lf\n", \$1, \$2, \$3, \$4, \$5, \$6, \$7, 100.0 * \$7 / tbytes; - } -NR > $COUNT { - oobjs1 += \$2; obytes1 += \$3; - oobjs2 += \$4; obytes2 += \$5; - odobjs += \$6; odbytes += \$7; - } -END { - printf "%-22s %6d %8d %6d %8d %6d %8d %6.2lf\n", "OTHER", oobjs1, obytes1, oobjs2, obytes2, odobjs, odbytes, odbytes * 100.0 / tbytes; - } -EOF - -# Now pretty print the file, and spit it out on stdout. -awk -f /tmp/$$.awk /tmp/$$.sorted - -rm -f /tmp/$$.awk /tmp/$$.sorted diff --git a/mozilla/tools/trace-malloc/histogram-pretty.sh b/mozilla/tools/trace-malloc/histogram-pretty.sh deleted file mode 100755 index 5c49a1ccc98..00000000000 --- a/mozilla/tools/trace-malloc/histogram-pretty.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is historgram-diff.sh, released -# Dec 8, 2000. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2000 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Chris Waterson -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -# histogram-pretty.sh [-c ] [-w ] -# -# Pretty-print the histogram in file , displaying at most -# rows. - -# How many rows are we gonna show? -COUNT=20 -WIDTH=22 - -# Read arguments -while [ $# -gt 0 ]; do - case "$1" in - -c) COUNT=$2 - shift 2 - ;; - -w) WIDTH=$2 - shift 2 - ;; - *) break - ;; - esac -done - -FILE=$1 - -# The first `awk' script computes a `TOTAL' row. Then, we sort by the -# larges delta in bytes. -awk '{ tobj += $2; tbytes += $3; } END { print "TOTAL", tobj, tbytes; }' ${FILE} > /tmp/$$.sorted - -sort -nr +2 ${FILE} >> /tmp/$$.sorted - -# Pretty-print, including percentages -cat < /tmp/$$.awk -BEGIN { - printf "%-${WIDTH}s Count Bytes %Total %Cov\n", "Type"; - } -\$1 == "TOTAL" { - tbytes = \$3; - } -NR <= $COUNT { - if (\$1 != "TOTAL") { - covered += \$3; - } - printf "%-${WIDTH}s %6d %8d %6.2lf %6.2lf\n", \$1, \$2, \$3, 100.0 * \$3 / tbytes, 100.0 * covered / tbytes; - } -NR > $COUNT { - oobjs += \$2; obytes += \$3; covered += \$3; - } -END { - printf "%-${WIDTH}s %6d %8d %6.2lf %6.2lf\n", "OTHER", oobjs, obytes, obytes * 100.0 / tbytes, covered * 100.0 / tbytes; - } -EOF - -# Now pretty print the file, and spit it out on stdout. -awk -f /tmp/$$.awk /tmp/$$.sorted - -rm -f /tmp/$$.awk /tmp/$$.sorted diff --git a/mozilla/tools/trace-malloc/histogram.pl b/mozilla/tools/trace-malloc/histogram.pl deleted file mode 100755 index 6c39f79bd1b..00000000000 --- a/mozilla/tools/trace-malloc/histogram.pl +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/perl -w -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is histogram.pl, released -# Nov 27, 2000. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2000 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Chris Waterson -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -# This program produces a ``class histogram'' of the live objects, one -# line per class, with the total number of objects allocated, and -# total number of bytes attributed to those objects. - -use 5.004; -use strict; -use Getopt::Long; - -# So we can find TraceMalloc.pm -use FindBin; -use lib "$FindBin::Bin"; - -use TraceMalloc; - -# Collect program options -$::opt_help = 0; -$::opt_types = "${FindBin::Bin}/types.dat"; - -GetOptions("help", "types=s"); - -if ($::opt_help) { - die "usage: histogram.pl [options] - --help Display this message - --types= Read type heuristics from "; -} - -# Initialize type inference juju from the type file specified by -# ``--types''. -if ($::opt_types) { - TraceMalloc::init_type_inference($::opt_types); -} - -# Read the dump file, collecting count and size information for each -# object that's detected. - -# This'll hold a record for each class that we detect -$::Classes = { }; - -sub collect_objects($) { - my ($object) = @_; - my $type = $object->{'type'}; - - my $entry = $::Classes{$type}; - if (! $entry) { - $entry = $::Classes{$type} = { '#count#' => 0, '#bytes#' => 0 }; - } - - $entry->{'#count#'} += 1; - $entry->{'#bytes#'} += $object->{'size'}; -} - -TraceMalloc::read(\&collect_objects); - -# Print one line per class, sorted with the classes that accumulated -# the most bytes first. -foreach my $class (sort { $::Classes{$b}->{'#bytes#'} <=> $::Classes{$a}->{'#bytes#'} } keys %::Classes) { - print "$class $::Classes{$class}->{'#count#'} $::Classes{$class}->{'#bytes#'}\n"; -} diff --git a/mozilla/tools/trace-malloc/leak-soup.pl b/mozilla/tools/trace-malloc/leak-soup.pl deleted file mode 100755 index 673af812765..00000000000 --- a/mozilla/tools/trace-malloc/leak-soup.pl +++ /dev/null @@ -1,1215 +0,0 @@ -#!/usr/bin/perl -w -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is leak-soup.pl, released -# Oct 1, 2000. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2000 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Chris Waterson -# Jim Roskind -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -# A perl version of Patrick Beard's ``Leak Soup'', which processes the -# stack crawls from the Boehm GC into a graph. - -use 5.004; -use strict; -use Getopt::Long; -use FileHandle; -use IPC::Open2; - -# Collect program options -$::opt_help = 0; -$::opt_detail = 0; -$::opt_fragment = 1.0; # Default to no fragment analysis -$::opt_nostacks = 0; -$::opt_nochildstacks = 0; -$::opt_depth = 9999; -$::opt_noentrained = 0; -$::opt_noslop = 0; -$::opt_showtype = -1; # default to listing all types -$::opt_stackrefine = "C"; -@::opt_stackretype = (); -@::opt_stackskipclass = (); -@::opt_stackskipfunc = (); -@::opt_typedivide = (); - -GetOptions("help", "detail", "format=s", "fragment=f", "nostacks", - "nochildstacks", "depth=i", "noentrained", "noslop", "showtype=i", - "stackrefine=s", "stackretype=s@", "stackskipclass=s@", "stackskipfunc=s@", - "typedivide=s@" - ); - -if ($::opt_help) { - die "usage: leak-soup.pl [options] - --help Display this message - --detail Provide details of memory sweeping from child to parents - --fragment=ratio Histogram bucket ratio for fragmentation analysis -# --nostacks Do not compute stack traces -# --nochildstacks Do not compute stack traces for entrained objects -# --depth= Only compute stack traces to depth of -# --noentrained Do not compute amount of memory entrained by root objects - --noslop Don't ignore low bits when searching for pointers - --showtype= Show memory usage histogram for most-significant types - --stackrefine={F|C} During stack based refinement, use 'F'ull name name or just 'C'lass - --stackretype=type Use allocation stack to refine vague types like void* - --stackskipclass=class When refining types, ignore stack frames from 'class' - --stackskipfunc=func When refining types, ignore stack frames for 'func' - --typedivide=type Subdivide 'type' based on objects pointing to each instance -"; -} - -# This is the table that keeps a graph of objects. It's indexed by the -# object's address (as an integer), and refers to a simple hash that -# has information about the object's type, size, slots, and allocation -# stack. -%::Objects = %{0}; - -# This will be a list of keys to (addresses in) Objects, that is sorted -# It gets used to evaluate overlaps, calculate fragmentation, and chase -# parent->child (interior) pointers. -@::SortedAddresses = []; - -# This is the table that keeps track of memory usage on a per-type basis. -# It is indexed by the type name (string), and keeps a tally of the -# total number of such objects, and the memory usage of such objects. -%::Types = %{0}; -$::TotalSize = 0; # sum of sizes of all objects included $::Types{} - -# This is an array of leaf node addresses. A leaf node has no children -# with memory allocations. We traverse them sweeping memory -# tallies into parents. Note that after all children have -# been swept into a parent, that parent may also become a leaf node. -@::Leafs = @{0}; - - - - -#---------------------------------------------------------------------- -# -# Decode arguments to override default values for doing call-stack-based -# refinement of typename based on contents of the stack at allocation time. -# - -# List the types that we need to refine (if any) based on allocation stack -$::VagueType = { - 'void*' => 1, -}; - -# With regard to the stack, ignore stack frames in the following -# overly vague classes. -$::VagueClasses = { -# 'nsStr' => 1, - 'nsVoidArray' => 1, -}; - -# With regard to stack, ignore stack frames with the following vague -# function names -$::VagueFunctions = { - 'PL_ArenaAllocate' => 1, - 'PL_HashTableFinalize(PLHashTable *)' => 1, - 'PL_HashTableInit__FP11PLHashTableUiPFPCv_UiPFPCvPCv_iT3PC14PLHashAllocOpsPv' => 1, - 'PL_HashTableRawAdd' => 1, - '__builtin_vec_new' => 1, - '_init' => 1, - 'il_get_container(_IL_GroupContext *, ImgCachePolicy, char const *, _NI_IRGB *, IL_DitherMode, int, int, int)' => 1, - 'nsCStringKey::Clone(void) const' => 1, - 'nsCppSharedAllocator::allocate(unsigned int, void const *)' => 1, - 'nsHashtable::Put(nsHashKey *, void *)' => 1, - 'nsHashtable::nsHashtable(unsigned int, int)' => 1, - 'nsMemory::Alloc(unsigned int)' => 1, - 'nsMemoryImpl::Alloc(unsigned int)' => 1, -}; - -sub init_stack_based_type_refinement() { - # Move across stackretype options, or use default values - if ($#::opt_stackretype < 0) { - print "Default --stackretype options will be used (since none were specified)\n"; - print " use --stackretype='nothing' to disable re-typing activity\n"; - } else { - foreach my $type (keys %{$::VagueType}) { - delete ($::VagueType->{$type}); - } - if ($#::opt_stackretype == 0 && $::opt_stackretype[0] eq 'nothing') { - print "Types will not be refined based on call stack\n"; - } else { - foreach my $type (@::opt_stackretype) { - $::VagueType->{$type} = 1; - } - } - } - - - if (keys %{$::VagueType}) { - print "The following type(s) will be refined based on call stacks:\n"; - foreach my $type (sort keys %{$::VagueType}) { - print " $type\n"; - } - print "Equivalent command line argument(s):\n"; - foreach my $type (sort keys %{$::VagueType}) { - print " --stackretype='$type'"; - } - print "\n\n"; - - if ($#::opt_stackskipclass < 0) { - print "Default --stackskipclass options will be used (since none were specified)\n"; - print " use --stackskipclass='nothing' to disable skipping stack frames based on class names\n"; - } else { - foreach my $type (keys %{$::VagueClasses}) { - delete ($::VagueClasses->{$type}); - } - if ($#::opt_stackskipclass == 0 && $::opt_stackskipclass[0] eq 'nothing') { - print "Types will not be refined based on call stack\n"; - } else { - foreach my $type (@::opt_stackskipclass) { - $::VagueClasses->{$type} = 1; - } - } - } - - if (keys %{$::VagueClasses}) { - print "Stack frames from the following class(es) will not be used to refine types:\n"; - foreach my $class (sort keys %{$::VagueClasses}) { - print " $class\n"; - } - print "Equivalent command line argument(s):\n"; - foreach my $class (sort keys %{$::VagueClasses}) { - print " --stackskipclass='$class'"; - } - print "\n\n"; - } - - - if ($#::opt_stackskipfunc < 0) { - print "Default --stackskipfunc options will be used (since none were specified)\n"; - print " use --stackskipfunc='nothing' to disable skipping stack frames based on function names\n"; - } else { - foreach my $type (keys %{$::VagueFunctions}) { - delete ($::VagueFunctions->{$type}); - } - if ($#::opt_stackskipfunc == 0 && $::opt_stackskipfunc[0] eq 'nothing') { - print "Types will not be refined based on call stack\n"; - } else { - foreach my $type (@::opt_stackskipfunc) { - $::VagueFunctions->{$type} = 1; - } - } - } - - if (keys %{$::VagueFunctions}) { - print "Stack frames from the following function(s) will not be used to refine types:\n"; - foreach my $func (sort keys %{$::VagueFunctions}) { - print " $func\n"; - } - print "Equivalent command line argument(s):\n"; - foreach my $func (sort keys %{$::VagueFunctions}) { - print " --stackskipfunc='$func'"; - } - print "\n\n"; - } - } -} - - -#---------------------------------------------------------------------- -# -# Read in the output from the Boehm GC or Trace-malloc. -# -sub read_boehm() { - OBJECT: while (<>) { - # e.g., 0x0832FBD0 (80) - next OBJECT unless /^0x(\S+) <(.*)> \((\d+)\)/; - my ($addr, $type, $size) = (hex $1, $2, $3); - - my $object = $::Objects{$addr}; - if (! $object) { - # Found a new object entry. Record its type and size - $::Objects{$addr} = - $object = - { 'type' => $type, 'size' => $size }; - } else { - print "Duplicate address $addr contains $object->{'type'} and $type\n"; - $object->{'dup_addr_count'}++; - } - - # Record the object's slots - my @slots; - - SLOT: while (<>) { - # e.g., 0x00000000 - last SLOT unless /^\t0x(\S+)/; - my $value = hex $1; - - # Ignore low bits, unless they've specified --noslop - $value &= ~0x7 unless $::opt_noslop; - - $slots[$#slots + 1] = $value; - } - - $object->{'slots'} = \@slots; - - if (@::opt_stackretype && (defined $::VagueType->{$type})) { - # Change the value of type of the object based on stack - # if we can find an interesting calling function - VAGUEFRAME: while (<>) { - # e.g., _dl_debug_message[/lib/ld-linux.so.2 +0x0000B858] - last VAGUEFRAMEFRAME unless /^(.*)\[(.*) \+0x(\S+)\]$/; - my ($func, $lib, $off) = ($1, $2, hex $3); - chomp; - - my ($class,,$fname) = split(/:/, $func); - next VAGUEFRAME if (defined $::VagueFunctions->{$func} || - defined $::VagueClasses->{$class}); - - # Refine typename and exit stack scan - $object->{'type'} = $type . ":" . - (('C' eq $::opt_stackrefine) ? - $class : - $func); - last VAGUEFRAME; - } - } else { - # Save all stack info if requested - if (! $::opt_nostacks) { - # Record the stack by which the object was allocated - my @stack; - - FRAME: while (<>) { - # e.g., _dl_debug_message[/lib/ld-linux.so.2 +0x0000B858] - last FRAME unless /^(.*)\[(.*) \+0x(\S+)\]$/; - my ($func, $lib, $off) = ($1, $2, hex $3); - chomp; - - $stack[$#stack + 1] = $_; - } - - $object->{'stack'} = \@stack; - } - } - - # Gotta check EOF explicitly... - last OBJECT if eof; - } -} - - -#---------------------------------------------------------------------- -# -# Read input -# -init_stack_based_type_refinement(); -read_boehm; - - - -#---------------------------------------------------------------------- -# -# Do basic initialization of the type hash table. Accumulate -# total counts, and basic memory usage (not including children) -sub load_type_table() { - # Reset global counter and hash table - $::TotalSize = 0; - %::Types = %{0}; - - OBJECT: foreach my $addr (keys %::Objects) { - my $obj = $::Objects{$addr}; - my ($type, $size, $swept_in, $overlap_count, $dup_addr_count) = - ($obj->{'type'}, $obj->{'size'}, - $obj->{'swept_in'}, - $obj->{'overlap_count'},$obj->{'dup_addr_count'}); - - my $type_data = $::Types{$type}; - if (! defined $type_data) { - $::Types{$type} = - $type_data = {'count' => 0, 'size' => 0, - 'max' => $size, 'min' => $size, - 'swept_in' => 0, 'swept' => 0, - 'overlap_count' => 0, - 'dup_addr_count' => 0}; - } - - if (!$size) { - $type_data->{'swept'}++; - next OBJECT; - } - $::TotalSize += $size; - - $type_data->{'count'}++; - $type_data->{'size'} += $size; - if (defined $swept_in) { - $type_data->{'swept_in'} += $swept_in; - - if ($::opt_detail) { - my $type_detail_sizes = $type_data->{'sweep_details_size'}; - my $type_detail_counts; - if (!defined $type_detail_sizes) { - $type_detail_sizes = $type_data->{'sweep_details_size'} = {}; - $type_detail_counts = $type_data->{'sweep_details_count'} = {}; - } else { - $type_detail_counts = $type_data->{'sweep_details_count'}; - } - - my $sweep_details = $obj->{'sweep_details'}; - for my $swept_addr (keys (%{$sweep_details})) { - my $swept_obj = $::Objects{$swept_addr}; - my $swept_type = $swept_obj->{'type'}; - $type_detail_sizes->{$swept_type} += $sweep_details->{$swept_addr}; - $type_detail_counts->{$swept_type}++; - } - } - } - if (defined $overlap_count) { - $type_data->{'overlap_count'} += $overlap_count; - } - - if (defined $dup_addr_count) { - $type_data->{'dup_addr_count'} += $dup_addr_count; - } - - if ($type_data->{'max'} < $size) { - $type_data->{'max'} = $size; - } - # Watch out for case where min is produced by a swept object - if (!$type_data->{'min'} || $type_data->{'min'} > $size) { - $type_data->{'min'} = $size; - } - } -} - - -#---------------------------------------------------------------------- -sub print_type_table(){ - if (!$::opt_showtype) { - return; - } - my $line_count = 0; - my $bytes_printed_tally = 0; - - # Display type summary information - my @sorted_types = keys (%::Types); - print "There are ", 1 + $#sorted_types, " types containing ", $::TotalSize, " bytes\n"; - @sorted_types = sort {$::Types{$b}->{'size'} - <=> $::Types{$a}->{'size'} } @sorted_types; - - foreach my $type (@sorted_types) { - last if ($line_count++ == $::opt_showtype); - - my $type_data = $::Types{$type}; - $bytes_printed_tally += $type_data->{'size'}; - - if ($type_data->{'count'}) { - printf "%.2f%% ", $type_data->{'size'} * 100.0/$::TotalSize; - print $type_data->{'size'}, - "\t(", - $type_data->{'min'}, "/", - int($type_data->{'size'} / $type_data->{'count'}),"/", - $type_data->{'max'}, ")"; - print "\t", $type_data->{'count'}, - " x "; - } - print $type; - - if ($type_data->{'swept_in'}) { - print ", $type_data->{'swept_in'} sub-objs absorbed"; - } - if ($type_data->{'swept'}) { - print ", $type_data->{'swept'} swept away"; - } - if ($type_data->{'overlap_count'}) { - print ", $type_data->{'overlap_count'} range overlaps"; - } - if ($type_data->{'dup_addr_count'}) { - print ", $type_data->{'dup_addr_count'} duplicated addresses"; - } - - print "\n" ; - if (defined $type_data->{'sweep_details_size'}) { - my $sizes = $type_data->{'sweep_details_size'}; - my $counts = $type_data->{'sweep_details_count'}; - my @swept_types = sort {$sizes->{$b} <=> $sizes->{$a}} keys (%{$sizes}); - - for my $type (@swept_types) { - printf " %.2f%% ", $sizes->{$type} * 100.0/$::TotalSize; - print "$sizes->{$type} (", int($sizes->{$type}/$counts->{$type}) , ") $counts->{$type} x $type\n"; - } - print " ---------------\n"; - } - } - if ($bytes_printed_tally != $::TotalSize) { - printf "%.2f%% ", ($::TotalSize- $bytes_printed_tally) * 100.0/$::TotalSize; - print $::TotalSize - $bytes_printed_tally, "\t not shown due to truncation of type list\n"; - print "Currently only data on $::opt_showtype types are displayed, due to command \n", - "line argument '--showtype=$::opt_showtype'\n\n"; - } - -} - -#---------------------------------------------------------------------- -# -# Check for duplicate address ranges is Objects table, and -# create list of sorted addresses for doing pointer-chasing - -sub validate_address_ranges() { - # Build sorted list of address for validating interior pointers - @::SortedAddresses = sort {$a <=> $b} keys %::Objects; - - # Validate non-overlap of memory - my $prev_addr_end = -1; - my $prev_addr = -1; - my $index = 0; - my $overlap_tally = 0; # overlapping object memory - my $unused_tally = 0; # unused memory between blocks - while ($index <= $#::SortedAddresses) { - my $address = $::SortedAddresses[$index]; - if ($prev_addr_end > $address) { - print "Object overlap from $::Objects{$prev_addr}->{'type'}:$prev_addr-$prev_addr_end into"; - my $test_index = $index; - my $prev_addr_overlap_tally = 0; - - while ($test_index <= $#::SortedAddresses) { - my $test_address = $::SortedAddresses[$test_index]; - last if ($prev_addr_end < $test_address); - print " $::Objects{$test_address}->{'type'}:$test_address"; - - $::Objects{$prev_addr}->{'overlap_count'}++; - $::Objects{$test_address}->{'overlap_count'}++; - my $overlap = $prev_addr_end - $test_address; - if ($overlap > $::Objects{$test_address}->{'size'}) { - $overlap = $::Objects{$test_address}->{'size'}; - } - print "($overlap bytes)"; - $prev_addr_overlap_tally += $overlap; - - $test_index++; - } - print " [total $prev_addr_overlap_tally bytes]"; - $overlap_tally += $prev_addr_overlap_tally; - print "\n"; - } - - $prev_addr = $address; - $prev_addr_end = $prev_addr + $::Objects{$prev_addr}->{'size'} - 1; - $index++; - } #end while - if ($overlap_tally) { - print "Total overlap of $overlap_tally bytes\n"; - } -} - -#---------------------------------------------------------------------- -# -# Evaluate sizes of interobject spacing (fragmentation loss?) -# Gather the sizes into histograms for analysis -# This function assumes a sorted list of addresses is present globally - -sub generate_and_print_unused_memory_histogram() { - print "\nInterobject spacing (fragmentation waste) Statistics\n"; - if ($::opt_fragment <= 1) { - print "Statistics are not being gathered. Use '--fragment=10' to get stats\n"; - return; - } - print "Ratio of histogram buckets will be a factor of $::opt_fragment\n"; - - my $prev_addr_end = -1; - my $prev_addr = -1; - my $index = 0; - - my @fragment_count; - my @fragment_tally; - my $power; - my $bucket_size; - - my $max_power = 0; - - my $tally_sizes = 0; - - while ($index <= $#::SortedAddresses) { - my $address = $::SortedAddresses[$index]; - - my $unused = $address - $prev_addr_end; - - # handle overlaps gracefully - if ($unused < 0) { - $unused = 0; - } - - $power = 0; - $bucket_size = 1; - while ($bucket_size < $unused) { - $bucket_size *= $::opt_fragment; - $power++; - } - $fragment_count[$power]++; - $fragment_tally[$power] += $unused; - if ($power > $max_power) { - $max_power = $power; - } - my $size = $::Objects{$address}->{'size'}; - $tally_sizes += $size; - $prev_addr_end = $address + $size - 1; - $index++; - } - - - $power = 0; - $bucket_size = 1; - print "Basic gap histogram is (max_size:count):\n"; - while ($power <= $max_power) { - if (! defined $fragment_count[$power]) { - $fragment_count[$power] = $fragment_tally[$power] = 0; - } - printf " %.1f:", $bucket_size; - print $fragment_count[$power]; - $power++; - $bucket_size *= $::opt_fragment; - } - print "\n"; - - print "Summary gap analysis:\n"; - - $power = 0; - $bucket_size = 1; - my $tally = 0; - my $count = 0; - while ($power <= $max_power) { - $count += $fragment_count[$power]; - $tally += $fragment_tally[$power]; - print "$count gaps, totaling $tally bytes, were under "; - printf "%.1f bytes each", $bucket_size; - if ($count) { - printf ", for an average of %.1f bytes per gap", $tally/$count, ; - } - print "\n"; - $power++; - $bucket_size *= $::opt_fragment; - } - - print "Total allocation was $tally_sizes bytes, or "; - printf "%.0f bytes per allocation block\n\n", $tally_sizes/($count+1); - -} - -#---------------------------------------------------------------------- -# -# Now thread the parents and children together by looking through the -# slots for each object. -# -sub create_parent_links(){ - my $min_addr = $::SortedAddresses[0]; - my $max_addr = $::SortedAddresses[ $#::SortedAddresses]; #allow one beyond each object - $max_addr += $::Objects{$max_addr}->{'size'}; - - print "Viable addresses range from $min_addr to $max_addr for a total of ", - $max_addr-$min_addr, " bytes\n\n"; - - # Gather stats as we try to convert slots to children - my $slot_count = 0; # total slots examined - my $fixed_addr_count = 0; # slots into interiors that were adjusted - my $parent_child_count = 0; # Number of parent-child links - my $child_count = 0; # valid slots, discounting sibling twins - my $child_dup_count = 0; # number of duplicate child pointers - my $self_pointer_count = 0; # count of discarded self-pointers - - foreach my $parent (keys %::Objects) { - # We'll collect a list of this parent object's children - # by iterating through its slots. - my @children; - my %children_hash; - my $self_pointer = 0; - - my @slots = @{$::Objects{$parent}->{'slots'}}; - $slot_count += $#slots + 1; - SLOT: foreach my $child (@slots) { - - # We only care about pointers that refer to other objects - if (! defined $::Objects{$child}) { - # check to see if we are an interior pointer - - # Punt if we are completely out of range - next SLOT unless ($max_addr >= $child && - $child >= $min_addr); - - # Do binary search to find object below this address - my ($min_index, $beyond_index) = (0, $#::SortedAddresses + 1); - my $test_index; - while ($min_index != - ($test_index = int (($beyond_index+$min_index)/2))) { - if ($child >= $::SortedAddresses[$test_index]) { - $min_index = $test_index; - } else { - $beyond_index = $test_index; - } - } - # See if pointer is within extent of this object - my $address = $::SortedAddresses[$test_index]; - next SLOT unless ($child < - $address + $::Objects{$address}->{'size'}); - - # Make adjustment so we point to the actual child precisely - $child = $address; - $fixed_addr_count++; - } - - if ($child == $parent) { - $self_pointer_count++; - next SLOT; # Discard self-pointers - } - - # Avoid creating duplicate child-parent links - if (! defined $children_hash{$child}) { - $parent_child_count++; - # Add the parent to the child's list of parents - my $parents = $::Objects{$child}->{'parents'}; - if (! $parents) { - $parents = $::Objects{$child}->{'parents'} = []; - } - - $parents->[scalar(@$parents)] = $parent; - - # Add the child to the parent's list of children - $children_hash{$child} = 1; - } else { - $child_dup_count++; - } - } - @children = keys %children_hash; - # Track tally of unique children linked - $child_count += $#children + 1; - - $::Objects{$parent}->{'children'} = \@children; - - if (! @children) { - $::Leafs[$#::Leafs + 1] = $parent; - } - } - print "Scanning $#::SortedAddresses objects, we found $parent_child_count parents-to-child connections by chasing $slot_count pointers.\n", - "This required $fixed_addr_count interior pointer fixups, skipping $child_dup_count duplicate pointers, ", - "and $self_pointer_count self pointers\nAlso discarded ", - $slot_count - $parent_child_count -$self_pointer_count - $child_dup_count, - " out-of-range pointers\n\n"; -} - - -#---------------------------------------------------------------------- -# For every leaf, if a leaf has only one parent, then sweep the memory -# cost into the parent from the leaf -sub sweep_leaf_memory () { - my $sweep_count = 0; - my $leaf_counter = 0; - LEAF: while ($leaf_counter <= $#::Leafs) { - my $leaf_addr = $::Leafs[$leaf_counter++]; - my $leaf_obj = $::Objects{$leaf_addr}; - my $parents = $leaf_obj->{'parents'}; - - next LEAF if (! defined($parents) || 1 != scalar(@$parents)); - - # We have only one parent, so we'll try to sweep upwards - my $parent_addr = @$parents[0]; - my $parent_obj = $::Objects{$parent_addr}; - - # watch out for self-pointers - next LEAF if ($parent_addr == $leaf_addr); - - if ($::opt_detail) { - foreach my $obj ($parent_obj, $leaf_obj) { - if (!defined $obj->{'original_size'}) { - $obj->{'original_size'} = $obj->{'size'}; - } - } - if (defined $leaf_obj->{'sweep_details'}) { - if (defined $parent_obj->{'sweep_details'}) { # merge details - foreach my $swept_obj (keys (%{$leaf_obj->{'sweep_details'}})) { - %{$parent_obj->{'sweep_details'}}->{$swept_obj} = - %{$leaf_obj->{'sweep_details'}}->{$swept_obj}; - } - } else { # No parent info - $parent_obj->{'sweep_details'} = \%{$leaf_obj->{'sweep_details'}}; - } - delete $leaf_obj->{'sweep_details'}; - } else { # no leaf detail - if (!defined $parent_obj->{'sweep_details'}) { - $parent_obj->{'sweep_details'} = {}; - } - } - %{$parent_obj->{'sweep_details'}}->{$leaf_addr} = $leaf_obj->{'original_size'}; - } - - $parent_obj->{'size'} += $leaf_obj->{'size'}; - $leaf_obj->{'size'} = 0; - - if (defined ($leaf_obj->{'swept_in'})) { - $parent_obj->{'swept_in'} += $leaf_obj->{'swept_in'}; - $leaf_obj->{'swept_in'} = 0; # sweep has been handed off to parent - } - $parent_obj->{'swept_in'} ++; # tally swept in leaf_obj - - $sweep_count++; - - # See if we created another leaf - my $consumed_children = $parent_obj->{'consumed'}++; - my @children = $parent_obj->{'children'}; - if ($consumed_children == $#children) { - $::Leafs[$#::Leafs + 1] = @$parents[0]; - } - } - print "Processed ", $leaf_counter, " leaves sweeping memory to parents in ", $sweep_count, " objects\n"; -} - - -#---------------------------------------------------------------------- -# -# Subdivide the types of objects that are in our "expand" list -# List types that should be sub-divided based on parents, and possibly -# children -# The argument supplied is a hash table with keys selecting types that -# need to be "refined" by including the types of the parent objects, -# and (when we are desparate) the types of the children objects. - -sub expand_type_names($) { - my %TypeExpand = %{$_[0]}; - - my @retype; # array of addrs that get extended type names - foreach my $child (keys %::Objects) { - my $child_obj = $::Objects{$child}; - next unless (defined ($TypeExpand{$child_obj->{'type'}})); - - foreach my $relation ('parents','children') { - my $relatives = $child_obj->{$relation}; - next unless defined @$relatives; - - # Sort out the names of the types of the relatives - my %names; - foreach my $relative (@$relatives) { - %names->{$::Objects{$relative}->{'type'}} = 1; - } - my $related_type_names = join(',' , sort(keys(%names))); - - - $child_obj->{'name' . $relation} = $related_type_names; - - # Don't bother with children if we have significant parent types - last if (!defined ($TypeExpand{$related_type_names})); - } - $retype[$#retype + 1] = $child; - } - - # Revisit all addresses we've marked - foreach my $child (@retype) { - my $child_obj = $::Objects{$child}; - $child_obj->{'type'} = $TypeExpand{$child_obj->{'type'}}; - my $extended_type = $child_obj->{'namechildren'}; - if (defined $extended_type) { - $child_obj->{'type'}.= "->(" . $extended_type . ")"; - delete ($child_obj->{'namechildren'}); - } - $extended_type = $child_obj->{'nameparents'}; - if (defined $extended_type) { - $child_obj->{'type'} = "(" . $extended_type . ")->" . $::Objects{$child}->{'type'}; - delete ($child_obj->{'nameparents'}); - } - } -} - -#---------------------------------------------------------------------- -# -# Print out a type histogram - -sub print_type_histogram() { - load_type_table(); - print_type_table(); - print "\n\n"; -} - - -#---------------------------------------------------------------------- -# Provide a nice summary of the types during the process -validate_address_ranges(); -create_parent_links(); - -print "\nBasic memory use histogram is:\n"; -print_type_histogram(); - -generate_and_print_unused_memory_histogram(); - -sweep_leaf_memory (); -print "After doing basic leaf-sweep processing of instances:\n"; -print_type_histogram(); - -{ - foreach my $typename (@::opt_typedivide) { - my %expansion_table; - $expansion_table{$typename} = $typename; - expand_type_names(\%expansion_table); - print "After subdividing <$typename> based on inbound (and somtimes outbound) pointers:\n"; - print_type_histogram(); - } -} - -exit(); # Don't bother with SCCs yet. - - -#---------------------------------------------------------------------- -# -# Determine objects that entrain equivalent sets, using the strongly -# connected component algorithm from Cormen, Leiserson, and Rivest, -# ``An Introduction to Algorithms'', MIT Press 1990, pp. 488-493. -# -sub compute_post_order($$$) { -# This routine produces a post-order of the call graph (what CLR call -# ``ordering the nodes by f[u]'') - my ($parent, $visited, $finish) = @_; - - # Bail if we've already seen this node - return if $visited->{$parent}; - - # We have now! - $visited->{$parent} = 1; - - # Walk the children - my $children = $::Objects{$parent}->{'children'}; - - foreach my $child (@$children) { - compute_post_order($child, $visited, $finish); - } - - # Now that we've walked all the kids, we can append the parent to - # the post-order - @$finish[scalar(@$finish)] = $parent; -} - -sub compute_equivalencies($$$) { -# This routine recursively computes equivalencies by walking the -# transpose of the callgraph. - my ($child, $table, $equivalencies) = @_; - - # Bail if we've already seen this node - return if $table->{$child}; - - # Otherwise, append ourself to the list of equivalencies... - @$equivalencies[scalar(@$equivalencies)] = $child; - - # ...and note our other equivalents in the table - $table->{$child} = $equivalencies; - - my $parents = $::Objects{$child}->{'parents'}; - - foreach my $parent (@$parents) { - compute_equivalencies($parent, $table, $equivalencies); - } -} - -sub compute_equivalents() { -# Here's the strongly connected components algorithm. (Step 2 has been -# done implictly by our object graph construction.) - my %visited; - my @finish; - - # Step 1. Compute a post-ordering of the object graph - foreach my $parent (keys %::Objects) { - compute_post_order($parent, \%visited, \@finish); - } - - # Step 3. Traverse the transpose of the object graph in reverse - # post-order, collecting vertices into %equivalents - my %equivalents; - foreach my $child (reverse @finish) { - compute_equivalencies($child, \%equivalents, []); - } - - # Now, we'll trim the %equivalents table, arbitrarily removing - # ``redundant'' entries. - EQUIVALENT: foreach my $node (keys %equivalents) { - my $equivalencies = $equivalents{$node}; - next EQUIVALENT unless $equivalencies; - - foreach my $equivalent (@$equivalencies) { - delete $equivalents{$equivalent} unless $equivalent == $node; - } - } - - # Note the equivalent objects in a way that will yield the most - # interesting order as we do depth-first traversal later to - # output them. - ROOT: foreach my $equivalent (reverse @finish) { - next ROOT unless $equivalents{$equivalent}; - $::Equivalents[$#::Equivalents + 1] = $equivalent; - - # XXX Lame! Should figure out function refs. - $::Objects{$equivalent}->{'entrained-size'} = 0; - } -} - -# Do it! -compute_equivalents(); - - -#---------------------------------------------------------------------- -# -# Compute the size of each node's transitive closure. -# -sub compute_entrained($$) { - my ($parent, $visited) = @_; - - $visited->{$parent} = 1; - - $::Objects{$parent}->{'entrained-size'} = $::Objects{$parent}->{'size'}; - - my $children = $::Objects{$parent}->{'children'}; - CHILD: foreach my $child (@$children) { - next CHILD if $visited->{$child}; - - compute_entrained($child, $visited); - $::Objects{$parent}->{'entrained-size'} += $::Objects{$child}->{'entrained-size'}; - } -} - -if (! $::opt_noentrained) { - my %visited; - - PARENT: foreach my $parent (@::Equivalents) { - next PARENT if $visited{$parent}; - compute_entrained($parent, \%visited); - } -} - - -#---------------------------------------------------------------------- -# -# Converts a shared library and an address into a file and line number -# using a bunch of addr2line processes. -# -sub addr2line($$) { - my ($dso, $addr) = @_; - - # $::Addr2Lines is a global table that maps a DSO's name to a pair - # of filehandles that are talking to an addr2line process. - my $fhs = $::Addr2Lines{$dso}; - if (! $fhs) { - if (!(-r $dso)) { - # bogus filename (that happens sometimes), so bail - return { 'dso' => $dso, 'addr' => $addr }; - } - my ($in, $out) = (new FileHandle, new FileHandle); - open2($in, $out, "addr2line --exe=$dso") || die "unable to open addr2line --exe=$dso"; - $::Addr2Lines{$dso} = $fhs = { 'in' => $in, 'out' => $out }; - } - - # addr2line takes a hex address as input... - $fhs->{'out'}->print($addr . "\n"); - - # ...and'll return file:lineno as output - if ($fhs->{'in'}->getline() =~ /([^:]+):(.+)/) { - return { 'file' => $1, 'line' => $2 }; - } - else { - return { 'dso' => $dso, 'addr' => $addr }; - } -} - - -#---------------------------------------------------------------------- -# -# Dump the objects, using a depth-first traversal. -# -sub dump_objects($$$) { - my ($parent, $visited, $depth) = @_; - - # Have we already seen this? - my $already_visited = $visited->{$parent}; - return if ($depth == 0 && $already_visited); - - if (! $already_visited) { - $visited->{$parent} = 1; - $::Total += $::Objects{$parent}->{'size'}; - } - - my $parententry = $::Objects{$parent}; - - # Make an ``object'' div, which'll contain an ``object'' span, two - # ``toggle'' spans, an invisible ``stack'' div, and the invisible - # ``children'' div. - print "
"; - - if ($already_visited) { - print ""; - } - else { - print ""; - } - - printf "0x%x<%s>[%d]", $parent, $parententry->{'type'}, $parententry->{'size'}; - - if ($already_visited) { - print ""; - goto DONE; - } - - if ($depth == 0) { - print "($parententry->{'entrained-size'})" - if $parententry->{'entrained-size'}; - - print " Children" - if @{$parententry->{'children'}} > 0; - } - - if (($depth == 0 || !$::opt_nochildstacks) && !$::opt_nostacks) { - print " Stack"; - } - - print ""; - - # Print stack traces - print "
\n"; - - if (($depth == 0 || !$::opt_nochildstacks) && !$::opt_nostacks) { - my $depth = $::opt_depth; - - FRAME: foreach my $frame (@{$parententry->{'stack'}}) { - # Only go as deep as they've asked us to. - last FRAME unless --$depth >= 0; - - # Stack frames look like ``mangled_name[dso address]'' - $frame =~ /([^\]]+)\[(.*) \+0x([0-9A-Fa-f]+)\]/; - - # Convert address to file and line number - my $mangled = $1; - my $result = addr2line($2, $3); - - if ($result->{'file'}) { - # It's mozilla source! Clean up refs to dist/include - if (($result->{'file'} =~ s/.*\.\.\/\.\.\/dist\/include\//http:\/\/bonsai.mozilla.org\/cvsguess.cgi\?file=/) || - ($result->{'file'} =~ s/.*\/mozilla/http:\/\/bonsai.mozilla.org\/cvsblame.cgi\?file=mozilla/)) { - my $prevline = $result->{'line'} - 10; - print "{'file'}\&mark=$result->{'line'}#$prevline\">$mangled
\n"; - } - else { - print "$mangled ($result->{'file'}, line $result->{'line'})
\n"; - } - } - else { - print "$result->{'dso'} ($result->{'addr'})
\n"; - } - } - - } - - print "
"; - - # Recurse to children - if (@{$parententry->{'children'}} >= 0) { - print "
\n" if $depth == 0; - - foreach my $child (@{$parententry->{'children'}}) { - dump_objects($child, $visited, $depth + 1); - } - - print "
" if $depth == 0; - } - - DONE: - print "
\n"; -} - - -#---------------------------------------------------------------------- -# -# Do the output. -# - -# Force flush on STDOUT. We get funky output unless we do this. -$| = 1; - -# Header -print " - -Object Graph - - - - -"; - -{ -# Body. Display ``roots'', sorted by the amount of memory they -# entrain. Because of the way we've sorted @::Equivalents, we should -# get a nice ordering that sorts things with a lot of kids early -# on. This should yield a fairly "deep" depth-first traversal, with -# most of the objects appearing as children. -# -# XXX I sure hope that Perl implements a stable sort! - my %visited; - - foreach my $parent (sort { $::Objects{$b}->{'entrained-size'} - <=> $::Objects{$a}->{'entrained-size'} } - @::Equivalents) { - dump_objects($parent, \%visited, 0); - print "\n"; - } -} - -# Footer -print "
$::Total total bytes\n" if $::Total; -print " - -"; - diff --git a/mozilla/tools/trace-malloc/leaksoup.cpp b/mozilla/tools/trace-malloc/leaksoup.cpp deleted file mode 100644 index 4ed1d7c4944..00000000000 --- a/mozilla/tools/trace-malloc/leaksoup.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is leaksoup3, a memory graph analysis tool that - * finds roots based on strongly connected components (SCCs). - * - * The Initial Developer of the Original Code is L. David Baron. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * L. David Baron (original author) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "adreader.h" - -#include -#include "plhash.h" - -#include "nsVoidArray.h" -#include "nsQuickSort.h" - -/* - * Read in an allocation dump, presumably one taken at shutdown (using - * the --shutdown-leaks=file option, which must be used along with - * --trace-malloc=tmlog), and treat the memory in the dump as leaks. - * Find the leak roots, including cycles that are roots, by finding the - * strongly connected components in the graph. Print output to stdout - * as HTML. - */ - -struct AllocationNode { - const ADLog::Entry *entry; - - // Other |AllocationNode| objects whose memory has a pointer to - // this object. - nsAutoVoidArray pointers_to; - - // The reverse. - nsAutoVoidArray pointers_from; - - // Early on in the algorithm, the pre-order index from a DFS. - // Later on, set to the index of the strongly connected component to - // which this node belongs. - PRUint32 index; - - PRPackedBool reached; - PRPackedBool is_root; -}; - -static PLHashNumber hash_pointer(const void *key) -{ - return (PLHashNumber) key; -} - -static int sort_by_index(const void* e1, const void* e2, void*) -{ - const AllocationNode *n1 = *NS_STATIC_CAST(const AllocationNode*const*, e1); - const AllocationNode *n2 = *NS_STATIC_CAST(const AllocationNode*const*, e2); - return n1->index - n2->index; -} - -static int sort_by_reverse_index(const void* e1, const void* e2, void*) -{ - const AllocationNode *n1 = *NS_STATIC_CAST(const AllocationNode*const*, e1); - const AllocationNode *n2 = *NS_STATIC_CAST(const AllocationNode*const*, e2); - return n2->index - n1->index; -} - -static void print_escaped(FILE *aStream, const char* aData) -{ - char c; - char buf[1000]; - char *p = buf; - while ((c = *aData++)) { - switch (c) { -#define CH(char) *p++ = char - case '<': - CH('&'); CH('l'); CH('t'); CH(';'); - break; - case '>': - CH('&'); CH('g'); CH('t'); CH(';'); - break; - case '&': - CH('&'); CH('a'); CH('m'); CH('p'); CH(';'); - break; - default: - CH(c); - break; -#undef CH - } - if (p + 10 > buf + sizeof(buf)) { - *p = '\0'; - fputs(buf, aStream); - p = buf; - } - } - *p = '\0'; - fputs(buf, aStream); -} - -int main(int argc, char **argv) -{ - if (argc != 2) { - fprintf(stderr, - "Expected usage: %s \n" - " sd-leak-file: Output of --shutdown-leaks= option.\n", - argv[0]); - return 1; - } - - ADLog log; - if (!log.Read(argv[1])) { - fprintf(stderr, - "%s: Error reading input file %s.\n", argv[0], argv[1]); - } - - const size_t count = log.count(); - - PLHashTable *memory_map = - PL_NewHashTable(count * 8, hash_pointer, PL_CompareValues, - PL_CompareValues, 0, 0); - if (!memory_map) { - fprintf(stderr, "%s: Out of memory.\n", argv[0]); - return 1; - } - - // Create one |AllocationNode| object for each log entry, and create - // entries in the hashtable pointing to it for each byte it occupies. - AllocationNode *nodes = new AllocationNode[count]; - if (!nodes) { - fprintf(stderr, "%s: Out of memory.\n", argv[0]); - return 1; - } - - { - AllocationNode *cur_node = nodes; - for (ADLog::const_iterator entry = log.begin(), entry_end = log.end(); - entry != entry_end; ++entry, ++cur_node) { - const ADLog::Entry *e = cur_node->entry = *entry; - cur_node->reached = PR_FALSE; - - for (ADLog::Pointer p = e->address, - p_end = e->address + e->datasize; - p != p_end; ++p) { - PLHashEntry *e = PL_HashTableAdd(memory_map, p, cur_node); - if (!e) { - fprintf(stderr, "%s: Out of memory.\n", argv[0]); - return 1; - } - } - } - } - - // Construct graph based on pointers. - for (AllocationNode *node = nodes, *node_end = nodes + count; - node != node_end; ++node) { - const ADLog::Entry *e = node->entry; - for (const char *d = e->data, *d_end = e->data + e->datasize - - e->datasize % sizeof(ADLog::Pointer); - d != d_end; d += sizeof(ADLog::Pointer)) { - AllocationNode *target = (AllocationNode*) - PL_HashTableLookup(memory_map, *(void**)d); - if (target) { - target->pointers_from.AppendElement(node); - node->pointers_to.AppendElement(target); - } - } - } - - // Do a depth-first search on the graph (i.e., by following - // |pointers_to|) and assign the post-order index to |index|. - { - PRUint32 dfs_index = 0; - nsVoidArray stack; - - for (AllocationNode *n = nodes, *n_end = nodes+count; n != n_end; ++n) { - if (n->reached) { - continue; - } - stack.AppendElement(n); - - do { - PRUint32 pos = stack.Count() - 1; - AllocationNode *n = - NS_STATIC_CAST(AllocationNode*, stack[pos]); - if (n->reached) { - n->index = dfs_index++; - stack.RemoveElementAt(pos); - } else { - n->reached = PR_TRUE; - - // When doing post-order processing, we have to be - // careful not to put reached nodes into the stack. - nsVoidArray &pt = n->pointers_to; - for (PRInt32 i = pt.Count() - 1; i >= 0; --i) { - if (!NS_STATIC_CAST(AllocationNode*, pt[i])->reached) { - stack.AppendElement(pt[i]); - } - } - } - } while (stack.Count() > 0); - } - } - - // Sort the nodes by their DFS index, in reverse, so that the first - // node is guaranteed to be in a root SCC. - AllocationNode **sorted_nodes = new AllocationNode*[count]; - if (!sorted_nodes) { - fprintf(stderr, "%s: Out of memory.\n", argv[0]); - return 1; - } - - { - for (size_t i = 0; i < count; ++i) { - sorted_nodes[i] = nodes + i; - } - NS_QuickSort(sorted_nodes, count, sizeof(AllocationNode*), - sort_by_reverse_index, 0); - } - - // Put the nodes into their strongly-connected components. - PRUint32 num_sccs = 0; - { - for (size_t i = 0; i < count; ++i) { - nodes[i].reached = PR_FALSE; - } - nsVoidArray stack; - for (AllocationNode **sn = sorted_nodes, - **sn_end = sorted_nodes + count; sn != sn_end; ++sn) { - if ((*sn)->reached) { - continue; - } - - // We found a new strongly connected index. - stack.AppendElement(*sn); - do { - PRUint32 pos = stack.Count() - 1; - AllocationNode *n = - NS_STATIC_CAST(AllocationNode*, stack[pos]); - stack.RemoveElementAt(pos); - - if (!n->reached) { - n->reached = PR_TRUE; - n->index = num_sccs; - stack.AppendElements(n->pointers_from); - } - } while (stack.Count() > 0); - ++num_sccs; - } - } - - // Identify which nodes are leak roots by using DFS, and watching - // for component transitions. - PRUint32 num_root_nodes = count; - { - for (size_t i = 0; i < count; ++i) { - nodes[i].is_root = PR_TRUE; - } - - nsVoidArray stack; - for (AllocationNode *n = nodes, *n_end = nodes+count; n != n_end; ++n) { - if (!n->is_root) { - continue; - } - - // Loop through pointers_to, and add any that are in a - // different SCC to stack: - for (int i = n->pointers_to.Count() - 1; i >= 0; --i) { - AllocationNode *target = - NS_STATIC_CAST(AllocationNode*, n->pointers_to[i]); - if (n->index != target->index) { - stack.AppendElement(target); - } - } - - while (stack.Count() > 0) { - PRUint32 pos = stack.Count() - 1; - AllocationNode *n = - NS_STATIC_CAST(AllocationNode*, stack[pos]); - stack.RemoveElementAt(pos); - - if (n->is_root) { - n->is_root = PR_FALSE; - --num_root_nodes; - stack.AppendElements(n->pointers_to); - } - } - } - } - - // Sort the nodes by their SCC index. - NS_QuickSort(sorted_nodes, count, sizeof(AllocationNode*), - sort_by_index, 0); - - // Print output. - { - printf("\n" - "\n" - "\n" - "Leak analysis\n" - "\n" - "\n"); - printf("\n\n" - "

Generated %d entries (%d in root SCCs) and %d SCCs.

\n\n", - count, num_root_nodes, num_sccs); - - for (size_t i = 0; i < count; ++i) { - nodes[i].reached = PR_FALSE; - } - - // Loop over the sorted nodes twice, first printing the roots - // and then the non-roots. - for (PRBool root_type = PR_TRUE; - root_type == PR_TRUE || root_type == PR_FALSE; --root_type) { - if (root_type) { - printf("\n\n" - "
\n" - "

Root components

\n"); - } else { - printf("\n\n" - "
\n" - "

Non-root components

\n"); - } - PRUint32 component = (PRUint32)-1; - PRBool one_object_component; - for (const AllocationNode *const* sn = sorted_nodes, - *const* sn_end = sorted_nodes + count; - sn != sn_end; ++sn) { - const AllocationNode *n = *sn; - if (n->is_root != root_type) - continue; - const ADLog::Entry *e = n->entry; - - if (n->index != component) { - component = n->index; - one_object_component = - sn + 1 == sn_end || (*(sn+1))->index != component; - if (!one_object_component) - printf("\n\n

Component %d

\n", - component, component); - } - - if (one_object_component) { - printf("\n\n
\n", component); - printf("

Object %d " - "(single-object component %d)

\n", - n-nodes, n-nodes, component); - } else { - printf("\n\n

Object %d

\n", - n-nodes, n-nodes); - } - printf("
\n");
-                printf("%p <%s> (%d)\n",
-                       e->address, e->type, e->datasize);
-                for (size_t d = 0; d < e->datasize;
-                     d += sizeof(ADLog::Pointer)) {
-                    AllocationNode *target = (AllocationNode*)
-                        PL_HashTableLookup(memory_map, *(void**)(e->data + d));
-                    if (target) {
-                        printf("        0x%08X <%s>",
-                               target - nodes,
-                               *(unsigned int*)(e->data + d),
-                               target->entry->type);
-                        if (target->index != n->index) {
-                            printf(", component %d", target->index);
-                        }
-                        printf("\n");
-                    } else {
-                        printf("        0x%08X\n",
-                               *(unsigned int*)(e->data + d));
-                    }
-                }
-
-                if (n->pointers_from.Count()) {
-                    printf("\nPointers from:\n");
-                    for (PRUint32 i = 0, i_end = n->pointers_from.Count();
-                         i != i_end; ++i) {
-                        AllocationNode *t = NS_STATIC_CAST(AllocationNode*,
-                                                          n->pointers_from[i]);
-                        const ADLog::Entry *te = t->entry;
-                        printf("    %s (Object %d, ",
-                               t - nodes, te->type, t - nodes);
-                        if (t->index != n->index) {
-                            printf("component %d, ", t->index);
-                        }
-                        if (t == n) {
-                            printf("self)\n");
-                        } else {
-                            printf("%p)\n", te->address);
-                        }
-                    }
-                }
-
-                print_escaped(stdout, e->allocation_stack);
-
-                printf("
\n"); - if (one_object_component) { - printf("
\n"); - } - } - printf("
\n"); - } - printf("\n" - "\n"); - } - - delete [] sorted_nodes; - delete [] nodes; - - return 0; -} diff --git a/mozilla/tools/trace-malloc/leakstats.c b/mozilla/tools/trace-malloc/leakstats.c deleted file mode 100644 index f1cd6560fd4..00000000000 --- a/mozilla/tools/trace-malloc/leakstats.c +++ /dev/null @@ -1,175 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is nsTraceMalloc.c/bloatblame.c code, released - * April 19, 2000. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Brendan Eich, 14-April-2000 - * L. David Baron, 2001-06-07, created leakstats.c based on bloatblame.c - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include -#include -#include -#include -#ifdef HAVE_GETOPT_H -#include -#else -extern int getopt(int argc, char *const *argv, const char *shortopts); -extern char *optarg; -extern int optind; -#ifdef XP_WIN32 -int optind=1; -#endif -#endif -#include -#include "nsTraceMalloc.h" -#include "tmreader.h" - -static char *program; - -typedef struct handler_data { - uint32 current_heapsize; - uint32 max_heapsize; - uint32 bytes_allocated; - uint32 current_allocations; - uint32 total_allocations; - int finished; -} handler_data; - -static void handler_data_init(handler_data *data) -{ - data->current_heapsize = 0; - data->max_heapsize = 0; - data->bytes_allocated = 0; - data->current_allocations = 0; - data->total_allocations = 0; - data->finished = 0; -} - -static void handler_data_finish(handler_data *data) -{ -} - -static void my_tmevent_handler(tmreader *tmr, tmevent *event) -{ - handler_data *data = (handler_data*) tmr->data; - - switch (event->type) { - case TM_EVENT_REALLOC: - data->current_heapsize -= event->u.alloc.oldsize; - --data->current_allocations; - /* fall-through intentional */ - case TM_EVENT_MALLOC: - case TM_EVENT_CALLOC: - ++data->current_allocations; - ++data->total_allocations; - data->bytes_allocated += event->u.alloc.size; - data->current_heapsize += event->u.alloc.size; - if (data->current_heapsize > data->max_heapsize) - data->max_heapsize = data->current_heapsize; - break; - case TM_EVENT_FREE: - --data->current_allocations; - data->current_heapsize -= event->u.alloc.size; - break; - case TM_EVENT_STATS: - data->finished = 1; - break; - } -} - - -int main(int argc, char **argv) -{ - int i, j, rv; - tmreader *tmr; - FILE *fp; - time_t start; - handler_data data; - - program = *argv; - - handler_data_init(&data); - tmr = tmreader_new(program, &data); - if (!tmr) { - perror(program); - exit(1); - } - - start = time(NULL); - fprintf(stdout, "%s starting at %s", program, ctime(&start)); - fflush(stdout); - - argc -= optind; - argv += optind; - if (argc == 0) { - if (tmreader_eventloop(tmr, "-", my_tmevent_handler) <= 0) - exit(1); - } else { - for (i = j = 0; i < argc; i++) { - fp = fopen(argv[i], "r"); - if (!fp) { - fprintf(stderr, "%s: can't open %s: %s\n", - program, argv[i], strerror(errno)); - exit(1); - } - rv = tmreader_eventloop(tmr, argv[i], my_tmevent_handler); - if (rv < 0) - exit(1); - if (rv > 0) - j++; - fclose(fp); - } - if (j == 0) - exit(1); - } - - if (!data.finished) { - fprintf(stderr, "%s: log file incomplete\n", program); - exit(1); - } - - fprintf(stdout, - "Leaks: %u bytes, %u allocations\n" - "Maximum Heap Size: %u bytes\n" - "%u bytes were allocated in %u allocations.\n", - data.current_heapsize, data.current_allocations, - data.max_heapsize, - data.bytes_allocated, data.total_allocations); - - handler_data_finish(&data); - tmreader_destroy(tmr); - - exit(0); -} diff --git a/mozilla/tools/trace-malloc/lib/Makefile.in b/mozilla/tools/trace-malloc/lib/Makefile.in deleted file mode 100644 index a59f99bbb42..00000000000 --- a/mozilla/tools/trace-malloc/lib/Makefile.in +++ /dev/null @@ -1,73 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2003 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = tracemalloc -LIBRARY_NAME = tracemalloc -EXPORT_LIBRARY = 1 -DEFFILE = $(srcdir)/tm.def -LIBXUL_LIBRARY = 1 - -REQUIRES = xpcom - -CSRCS = \ - nsTraceMalloc.c \ - $(NULL) - -CPPSRCS = \ - nsDemangle.cpp \ - nsTypeInfo.cpp \ - $(NULL) - -EXPORTS = nsTraceMalloc.h - -EXTRA_DSO_LDOPTS = $(NSPR_LIBS) - -ifeq ($(OS_ARCH),WINNT) -CPPSRCS += nsDebugHelpWin32.cpp nsWinTraceMalloc.cpp nsStackFrameWin.cpp -EXTRA_DSO_LDOPTS += $(XPCOM_LIBS) -OS_LIBS += shell32.lib ole32.lib uuid.lib imagehlp.lib -endif - -include $(topsrcdir)/config/rules.mk - diff --git a/mozilla/tools/trace-malloc/lib/nsDebugHelpWin32.cpp b/mozilla/tools/trace-malloc/lib/nsDebugHelpWin32.cpp deleted file mode 100644 index 573da434c51..00000000000 --- a/mozilla/tools/trace-malloc/lib/nsDebugHelpWin32.cpp +++ /dev/null @@ -1,397 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * John Bandhauer - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -#if defined(_WIN32) && defined(_M_IX86) -// This is the .cpp file where the globals live -#define DHW_IMPLEMENT_GLOBALS -#include -#include "prtypes.h" -#include "prprf.h" -#include "prlog.h" -#include "plstr.h" -#include "prlock.h" -#include "nscore.h" -#include "nsDebugHelpWin32.h" -#include "nsStackFrameWin.h" -#else -#error "nsDebugHelpWin32.cpp should only be built in Win32 x86 builds" -#endif - - - -/***************************************************************************/ - - -PRLock* DHWImportHooker::gLock = nsnull; -DHWImportHooker* DHWImportHooker::gHooks = nsnull; -GETPROCADDRESS DHWImportHooker::gRealGetProcAddress = nsnull; - - -static PRBool -dhwEnsureImageHlpInitialized() -{ - static PRBool gInitialized = PR_FALSE; - static PRBool gTried = PR_FALSE; - - if (!gInitialized && !gTried) { - gTried = PR_TRUE; - HMODULE module = ::LoadLibrary("DBGHELP.DLL"); - if (!module) { - DWORD dw = GetLastError(); - printf("DumpStack Error: DBGHELP.DLL wasn't found. GetLastError() returned 0x%8.8X\n" - " This DLL is needed for succeessfully implementing trace-malloc.\n" - " This dll ships by default on Win2k. Disabling trace-malloc functionality.\n" - , dw); - return PR_FALSE; - } - -#define INIT_PROC(typename_, name_) \ - dhw##name_ = (typename_) ::GetProcAddress(module, #name_); \ - if(!dhw##name_) return PR_FALSE; - - INIT_PROC(ENUMERATELOADEDMODULES, EnumerateLoadedModules); - INIT_PROC(IMAGEDIRECTORYENTRYTODATA, ImageDirectoryEntryToData); - -#undef INIT_PROC - - gInitialized = PR_TRUE; - } - - return gInitialized; -} - - -DHWImportHooker& -DHWImportHooker::getGetProcAddressHooker() -{ - static DHWImportHooker gGetProcAddress("Kernel32.dll", "GetProcAddress", - (PROC)DHWImportHooker::GetProcAddress); - return gGetProcAddress; -} - - -DHWImportHooker& -DHWImportHooker::getLoadLibraryWHooker() -{ - static DHWImportHooker gLoadLibraryW("Kernel32.dll", "LoadLibraryW", - (PROC)DHWImportHooker::LoadLibraryW); - return gLoadLibraryW; -} - -DHWImportHooker& -DHWImportHooker::getLoadLibraryExWHooker() -{ - static DHWImportHooker gLoadLibraryExW("Kernel32.dll", "LoadLibraryExW", - (PROC)DHWImportHooker::LoadLibraryExW); - return gLoadLibraryExW; -} - -DHWImportHooker& -DHWImportHooker::getLoadLibraryAHooker() -{ - static DHWImportHooker gLoadLibraryA("Kernel32.dll", "LoadLibraryA", - (PROC)DHWImportHooker::LoadLibraryA); - return gLoadLibraryA; -} - -DHWImportHooker& -DHWImportHooker::getLoadLibraryExAHooker() -{ - static DHWImportHooker gLoadLibraryExA("Kernel32.dll", "LoadLibraryExA", - (PROC)DHWImportHooker::LoadLibraryExA); - return gLoadLibraryExA; -} - - -static HMODULE ThisModule() -{ - MEMORY_BASIC_INFORMATION info; - return VirtualQuery(ThisModule, &info, sizeof(info)) ? - (HMODULE) info.AllocationBase : nsnull; -} - -DHWImportHooker::DHWImportHooker(const char* aModuleName, - const char* aFunctionName, - PROC aHook, - PRBool aExcludeOurModule /* = PR_FALSE */) - : mNext(nsnull), - mModuleName(aModuleName), - mFunctionName(aFunctionName), - mOriginal(nsnull), - mHook(aHook), - mIgnoreModule(aExcludeOurModule ? ThisModule() : nsnull), - mHooking(PR_TRUE) -{ - //printf("DHWImportHooker hooking %s, function %s\n",aModuleName, aFunctionName); - - if(!gLock) - gLock = PR_NewLock(); - PR_Lock(gLock); - - EnsureImageHlpInitialized(); - dhwEnsureImageHlpInitialized(); // for the extra ones we care about. - - if(!gRealGetProcAddress) - gRealGetProcAddress = ::GetProcAddress; - - mOriginal = gRealGetProcAddress(::GetModuleHandleA(aModuleName), - aFunctionName), - - mNext = gHooks; - gHooks = this; - - PatchAllModules(); - - PR_Unlock(gLock); -} - -DHWImportHooker::~DHWImportHooker() -{ - PR_Lock(gLock); - - mHooking = PR_FALSE; - PatchAllModules(); - - if(gHooks == this) - gHooks = mNext; - else - { - for(DHWImportHooker* cur = gHooks; cur; cur = cur->mNext) - { - if(cur->mNext == this) - { - cur->mNext = mNext; - break; - } - } - PR_ASSERT(cur); //we were not in the list! - } - - if(!gHooks) - { - PRLock* theLock = gLock; - gLock = nsnull; - PR_Unlock(theLock); - PR_DestroyLock(theLock); - } - if (gLock) - PR_Unlock(gLock); -} - -static BOOL CALLBACK ModuleEnumCallback(LPSTR ModuleName, - ULONG ModuleBase, - ULONG ModuleSize, - PVOID UserContext) -{ - //printf("Module Name %s\n",ModuleName); - DHWImportHooker* self = (DHWImportHooker*) UserContext; - HMODULE aModule = (HMODULE) ModuleBase; - return self->PatchOneModule(aModule, ModuleName); -} - -PRBool -DHWImportHooker::PatchAllModules() -{ - return dhwEnumerateLoadedModules(::GetCurrentProcess(), - ModuleEnumCallback, this); -} - -PRBool -DHWImportHooker::PatchOneModule(HMODULE aModule, const char* name) -{ - if(aModule == mIgnoreModule) - { - return PR_TRUE; - } - - // do the fun stuff... - - PIMAGE_IMPORT_DESCRIPTOR desc; - uint32 size; - - desc = (PIMAGE_IMPORT_DESCRIPTOR) - dhwImageDirectoryEntryToData(aModule, PR_TRUE, - IMAGE_DIRECTORY_ENTRY_IMPORT, &size); - - if(!desc) - { - return PR_TRUE; - } - - for(; desc->Name; desc++) - { - const char* entryModuleName = (const char*) - ((char*)aModule + desc->Name); - if(!lstrcmpi(entryModuleName, mModuleName)) - break; - } - - if(!desc->Name) - { - return PR_TRUE; - } - - PIMAGE_THUNK_DATA thunk = (PIMAGE_THUNK_DATA) - ((char*) aModule + desc->FirstThunk); - - for(; thunk->u1.Function; thunk++) - { - PROC original; - PROC replacement; - - if(mHooking) - { - original = mOriginal; - replacement = mHook; - } - else - { - original = mHook; - replacement = mOriginal; - } - - PROC* ppfn = (PROC*) &thunk->u1.Function; - if(*ppfn == original) - { - DWORD dwDummy; - VirtualProtect(ppfn, sizeof(ppfn), PAGE_EXECUTE_READWRITE, &dwDummy); - BOOL result = WriteProcessMemory(GetCurrentProcess(), - ppfn, &replacement, sizeof(replacement), nsnull); - if (!result) //failure - { - printf("failure name %s func %x\n",name,*ppfn); - DWORD error = GetLastError(); - return PR_TRUE; - } - else - { - // printf("success name %s func %x\n",name,*ppfn); - DWORD filler = result+1; - return result; - } - } - - } - return PR_TRUE; -} - -PRBool -DHWImportHooker::ModuleLoaded(HMODULE aModule, DWORD flags) -{ - //printf("ModuleLoaded\n"); - if(aModule && !(flags & LOAD_LIBRARY_AS_DATAFILE)) - { - PR_Lock(gLock); - // We don't know that the newly loaded module didn't drag in implicitly - // linked modules, so we patch everything in sight. - for(DHWImportHooker* cur = gHooks; cur; cur = cur->mNext) - cur->PatchAllModules(); - PR_Unlock(gLock); - } - return PR_TRUE; -} - -// static -HMODULE WINAPI -DHWImportHooker::LoadLibraryW(PCWSTR path) -{ - //wprintf(L"LoadLibraryW %s\n",path); - DHW_DECLARE_FUN_TYPE(HMODULE, __stdcall, LOADLIBRARYW_, (PCWSTR)); - HMODULE hmod = DHW_ORIGINAL(LOADLIBRARYW_, getLoadLibraryWHooker())(path); - ModuleLoaded(hmod, 0); - return hmod; -} - - -// static -HMODULE WINAPI -DHWImportHooker::LoadLibraryExW(PCWSTR path, HANDLE file, DWORD flags) -{ - //wprintf(L"LoadLibraryExW %s\n",path); - DHW_DECLARE_FUN_TYPE(HMODULE, __stdcall, LOADLIBRARYEXW_, (PCWSTR, HANDLE, DWORD)); - HMODULE hmod = DHW_ORIGINAL(LOADLIBRARYEXW_, getLoadLibraryExWHooker())(path, file, flags); - ModuleLoaded(hmod, flags); - return hmod; -} - -// static -HMODULE WINAPI -DHWImportHooker::LoadLibraryA(PCSTR path) -{ - //printf("LoadLibraryA %s\n",path); - - DHW_DECLARE_FUN_TYPE(HMODULE, __stdcall, LOADLIBRARYA_, (PCSTR)); - HMODULE hmod = DHW_ORIGINAL(LOADLIBRARYA_, getLoadLibraryAHooker())(path); - ModuleLoaded(hmod, 0); - return hmod; -} - -// static -HMODULE WINAPI -DHWImportHooker::LoadLibraryExA(PCSTR path, HANDLE file, DWORD flags) -{ - //printf("LoadLibraryExA %s\n",path); - DHW_DECLARE_FUN_TYPE(HMODULE, __stdcall, LOADLIBRARYEXA_, (PCSTR, HANDLE, DWORD)); - HMODULE hmod = DHW_ORIGINAL(LOADLIBRARYEXA_, getLoadLibraryExAHooker())(path, file, flags); - ModuleLoaded(hmod, flags); - return hmod; -} -// static -FARPROC WINAPI -DHWImportHooker::GetProcAddress(HMODULE aModule, PCSTR aFunctionName) -{ - FARPROC pfn = gRealGetProcAddress(aModule, aFunctionName); - - if(pfn) - { - PR_Lock(gLock); - for(DHWImportHooker* cur = gHooks; cur; cur = cur->mNext) - { - if(pfn == cur->mOriginal) - { - pfn = cur->mHook; - break; - } - } - PR_Unlock(gLock); - } - return pfn; -} - - diff --git a/mozilla/tools/trace-malloc/lib/nsDebugHelpWin32.h b/mozilla/tools/trace-malloc/lib/nsDebugHelpWin32.h deleted file mode 100644 index d8dc2989614..00000000000 --- a/mozilla/tools/trace-malloc/lib/nsDebugHelpWin32.h +++ /dev/null @@ -1,248 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * John Bandhauer - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* Win32 x86 code for stack walking, symbol resolution, and function hooking */ - -#ifndef __nsDebugHelpWin32_h__ -#define __nsDebugHelpWin32_h__ - -#if defined(_WIN32) && defined(_M_IX86) - #ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN - #endif - #include - #include - #include -#else - #error "nsDebugHelpWin32.h should only be included in Win32 x86 builds" -#endif - -// XXX temporary hack... -//#include "hacky_defines.h" - - -/***************************************************************************/ -// useful macros... - -#define DHW_DECLARE_FUN_TYPE(retval_, conv_, typename_, args_) \ - typedef retval_ ( conv_ * typename_ ) args_ ; - -#ifdef DHW_IMPLEMENT_GLOBALS -#define DHW_DECLARE_FUN_GLOBAL(typename_, name_) typename_ dhw##name_ -#else -#define DHW_DECLARE_FUN_GLOBAL(typename_, name_) extern typename_ dhw##name_ -#endif - -#define DHW_DECLARE_FUN_PROTO(retval_, conv_, name_, args_) \ - retval_ conv_ name_ args_ - -#define DHW_DECLARE_FUN_STATIC_PROTO(retval_, name_, args_) \ - static retval_ conv_ name_ args_ - -#define DHW_DECLARE_FUN_TYPE_AND_PROTO(name_, retval_, conv_, typename_, args_) \ - DHW_DECLARE_FUN_TYPE(retval_, conv_, typename_, args_); \ - DHW_DECLARE_FUN_PROTO(retval_, conv_, name_, args_) - -#define DHW_DECLARE_FUN_TYPE_AND_STATIC_PROTO(name_, retval_, conv_, typename_, args_) \ - DHW_DECLARE_FUN_TYPE(retval_, conv_, typename_, args_); \ - DHW_DECLARE_FUN_STATIC_PROTO(retval_, conv_, name_, args_) - -#define DHW_DECLARE_FUN_TYPE_AND_GLOBAL(typename_, name_, retval_, conv_, args_) \ - DHW_DECLARE_FUN_TYPE(retval_, conv_, typename_, args_); \ - DHW_DECLARE_FUN_GLOBAL(typename_, name_) - - -/**********************************************************/ -// These are used to get 'original' function addresses from DHWImportHooker. - -#define DHW_DECLARE_ORIGINAL(type_, name_, hooker_) \ - type_ name_ = (type_) hooker_ . GetOriginalFunction() - -#define DHW_DECLARE_ORIGINAL_PTR(type_, name_, hooker_) \ - type_ name_ = (type_) hooker_ -> GetOriginalFunction() - -#define DHW_ORIGINAL(type_, hooker_) \ - ((type_) hooker_ . GetOriginalFunction()) - -#define DHW_ORIGINAL_PTR(type_, hooker_) \ - ((type_) hooker_ -> GetOriginalFunction()) - -/***************************************************************************/ -// Global declarations of entry points into ImgHelp functions -#if 0 -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(SYMINITIALIZEPROC, SymInitialize, \ - BOOL, __stdcall, (HANDLE, LPSTR, BOOL)); - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(SYMSETOPTIONS, SymSetOptions, \ - DWORD, __stdcall, (DWORD)); - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(SYMGETOPTIONS, SymGetOptions, \ - DWORD, __stdcall, ()); - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(SYMGETMODULEINFO, SymGetModuleInfo, \ - BOOL, __stdcall, (HANDLE, DWORD, PIMAGEHLP_MODULE)); - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(SYMGETSYMFROMADDRPROC, SymGetSymFromAddr, \ - BOOL, __stdcall, (HANDLE, DWORD, PDWORD, PIMAGEHLP_SYMBOL)); - -#endif - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(ENUMERATELOADEDMODULES, EnumerateLoadedModules, \ - BOOL, __stdcall, (HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID)); - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(IMAGEDIRECTORYENTRYTODATA, ImageDirectoryEntryToData, \ - PVOID, __stdcall, (PVOID, BOOL, USHORT, PULONG)); - -// We aren't using any of the below yet... - -/* -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(SYMCLEANUPPROC, SymCleanup, \ - BOOL, __stdcall, (HANDLE)); - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(STACKWALKPROC, StackWalk, \ - BOOL, - __stdcall, - (DWORD, HANDLE, HANDLE, LPSTACKFRAME, LPVOID, \ - PREAD_PROCESS_MEMORY_ROUTINE, \ - PFUNCTION_TABLE_ACCESS_ROUTINE, \ - PGET_MODULE_BASE_ROUTINE, \ - PTRANSLATE_ADDRESS_ROUTINE)); - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(SYMFUNCTIONTABLEACCESSPROC, SymFunctionTableAccess, \ - LPVOID, __stdcall, (HANDLE, DWORD)); - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(SYMGETMODULEBASEPROC, SymGetModuleBase, \ - DWORD, __stdcall, (HANDLE, DWORD)); - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(SYMLOADMODULE, SymLoadModule, \ - DWORD, __stdcall, (HANDLE, HANDLE, PSTR, PSTR, DWORD, DWORD)); - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(UNDECORATESYMBOLNAME, _UnDecorateSymbolName, \ - DWORD, __stdcall, (LPCSTR, LPSTR, DWORD, DWORD)); - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(SYMUNDNAME, SymUnDName, \ - BOOL, __stdcall, (PIMAGEHLP_SYMBOL, LPSTR, DWORD)); - -DHW_DECLARE_FUN_TYPE_AND_GLOBAL(SYMGETLINEFROMADDR, SymGetLineFromAddr, \ - BOOL, __stdcall, (HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE)); - -*/ - -/***************************************************************************/ - -extern PRBool -dhwEnsureImageHlpInitialized(); - -/***************************************************************************/ - -DHW_DECLARE_FUN_TYPE(FARPROC, __stdcall, GETPROCADDRESS, (HMODULE, PCSTR)); - -class DHWImportHooker -{ -public: - - DHWImportHooker(const char* aModuleName, - const char* aFunctionName, - PROC aHook, - PRBool aExcludeOurModule = PR_FALSE); - - ~DHWImportHooker(); - - PROC GetOriginalFunction() {return mOriginal;} - - PRBool PatchAllModules(); - PRBool PatchOneModule(HMODULE aModule, const char* name); - static PRBool ModuleLoaded(HMODULE aModule, DWORD flags); - - - // I think that these should be made not static members, but allocated - // things created in an explicit static 'init' method and cleaned up in - // an explicit static 'finish' method. This would allow the application - // to have proper lifetime control over all the hooks. - - static DHWImportHooker &getLoadLibraryWHooker(); - static DHWImportHooker &getLoadLibraryExWHooker(); - static DHWImportHooker &getLoadLibraryAHooker(); - static DHWImportHooker &getLoadLibraryExAHooker(); - static DHWImportHooker &getGetProcAddressHooker(); - - static HMODULE WINAPI LoadLibraryA(PCSTR path); - -private: - DHWImportHooker* mNext; - const char* mModuleName; - const char* mFunctionName; - PROC mOriginal; - PROC mHook; - HMODULE mIgnoreModule; - PRBool mHooking; - -private: - static PRLock* gLock; - static DHWImportHooker* gHooks; - static GETPROCADDRESS gRealGetProcAddress; - - static HMODULE WINAPI LoadLibraryW(PCWSTR path); - static HMODULE WINAPI LoadLibraryExW(PCWSTR path, HANDLE file, DWORD flags); - static HMODULE WINAPI LoadLibraryExA(PCSTR path, HANDLE file, DWORD flags); - - static FARPROC WINAPI GetProcAddress(HMODULE aModule, PCSTR aFunctionName); -}; - -/***************************************************************************/ -// This supports the _CrtSetAllocHook based hooking. -// This system sucks because you don't get to see the allocated pointer. I -// don't think it appropriate for nsTraceMalloc, but is useful as a means to make -// malloc fail for testing purposes. -#if 0 //comment out this stuff. not necessary - -class DHWAllocationSizeDebugHook -{ -public: - virtual PRBool AllocHook(size_t size) = 0; - virtual PRBool ReallocHook(size_t size, size_t sizeOld) = 0; - virtual PRBool FreeHook(size_t size) = 0; -}; - -extern PRBool dhwSetAllocationSizeDebugHook(DHWAllocationSizeDebugHook* hook); -extern PRBool dhwClearAllocationSizeDebugHook(); - -/***************************************************************************/ -#endif //0 - -#endif /* __nsDebugHelpWin32_h__ */ diff --git a/mozilla/tools/trace-malloc/lib/nsDemangle.cpp b/mozilla/tools/trace-malloc/lib/nsDemangle.cpp deleted file mode 100644 index 83b96070eaf..00000000000 --- a/mozilla/tools/trace-malloc/lib/nsDemangle.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is trace-malloc/nsDemangle.cpp. - * - * The Initial Developer of the Original Code is - * The Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifdef MOZ_DEMANGLE_SYMBOLS - -#include -#include - -extern "C" char *nsDemangle(const char *symbol); - -char *nsDemangle(const char *symbol) { - return abi::__cxa_demangle(symbol, 0, 0, 0); -} - -#endif diff --git a/mozilla/tools/trace-malloc/lib/nsStackFrameWin.cpp b/mozilla/tools/trace-malloc/lib/nsStackFrameWin.cpp deleted file mode 100644 index 231dbc6574d..00000000000 --- a/mozilla/tools/trace-malloc/lib/nsStackFrameWin.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is nsStackFrameWin.h code, released - * December 20, 2000. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Michael Judge, 20-December-2000 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nscore.h" -#include "windows.h" -#include "imagehlp.h" -#include "stdio.h" -#include "nsStackFrameWin.h" - -// Define these as static pointers so that we can load the DLL on the -// fly (and not introduce a link-time dependency on it). Tip o' the -// hat to Matt Pietrick for this idea. See: -// -// http://msdn.microsoft.com/library/periodic/period97/F1/D3/S245C6.htm -// - - -PR_BEGIN_EXTERN_C - -SYMSETOPTIONSPROC _SymSetOptions; - -SYMINITIALIZEPROC _SymInitialize; - -SYMCLEANUPPROC _SymCleanup; - -STACKWALKPROC _StackWalk; - -SYMFUNCTIONTABLEACCESSPROC _SymFunctionTableAccess; - -SYMGETMODULEBASEPROC _SymGetModuleBase; - -SYMGETSYMFROMADDRPROC _SymGetSymFromAddr; - -SYMLOADMODULE _SymLoadModule; - -SYMUNDNAME _SymUnDName; - -SYMGETMODULEINFO _SymGetModuleInfo; - -ENUMLOADEDMODULES _EnumerateLoadedModules; - -SYMGETLINEFROMADDRPROC _SymGetLineFromAddr; - -PR_END_EXTERN_C - - - - -PRBool -EnsureImageHlpInitialized() -{ - static PRBool gInitialized = PR_FALSE; - - if (! gInitialized) { - HMODULE module = ::LoadLibrary("IMAGEHLP.DLL"); - if (!module) return PR_FALSE; - - _SymSetOptions = (SYMSETOPTIONSPROC) ::GetProcAddress(module, "SymSetOptions"); - if (!_SymSetOptions) return PR_FALSE; - - _SymInitialize = (SYMINITIALIZEPROC) ::GetProcAddress(module, "SymInitialize"); - if (!_SymInitialize) return PR_FALSE; - - _SymCleanup = (SYMCLEANUPPROC)GetProcAddress(module, "SymCleanup"); - if (!_SymCleanup) return PR_FALSE; - - _StackWalk = (STACKWALKPROC)GetProcAddress(module, "StackWalk"); - if (!_StackWalk) return PR_FALSE; - - _SymFunctionTableAccess = (SYMFUNCTIONTABLEACCESSPROC) GetProcAddress(module, "SymFunctionTableAccess"); - if (!_SymFunctionTableAccess) return PR_FALSE; - - _SymGetModuleBase = (SYMGETMODULEBASEPROC)GetProcAddress(module, "SymGetModuleBase"); - if (!_SymGetModuleBase) return PR_FALSE; - - _SymGetSymFromAddr = (SYMGETSYMFROMADDRPROC)GetProcAddress(module, "SymGetSymFromAddr"); - if (!_SymGetSymFromAddr) return PR_FALSE; - - _SymLoadModule = (SYMLOADMODULE)GetProcAddress(module, "SymLoadModule"); - if (!_SymLoadModule) return PR_FALSE; - - _SymUnDName = (SYMUNDNAME)GetProcAddress(module, "SymUnDName"); - if (!_SymUnDName) return PR_FALSE; - - _SymGetModuleInfo = (SYMGETMODULEINFO)GetProcAddress(module, "SymGetModuleInfo"); - if (!_SymGetModuleInfo) return PR_FALSE; - - _EnumerateLoadedModules = (ENUMLOADEDMODULES)GetProcAddress(module, "EnumerateLoadedModules"); - if (!_EnumerateLoadedModules) return PR_FALSE; - - _SymGetLineFromAddr = (SYMGETLINEFROMADDRPROC)GetProcAddress(module, "SymGetLineFromAddr"); - if (!_SymGetLineFromAddr) return PR_FALSE; - - gInitialized = PR_TRUE; - } - - return gInitialized; -} - -/* - * Callback used by SymGetModuleInfoEspecial - */ -static BOOL CALLBACK callbackEspecial(LPSTR aModuleName, ULONG aModuleBase, ULONG aModuleSize, PVOID aUserContext) -{ - BOOL retval = TRUE; - DWORD addr = (DWORD)aUserContext; - - /* - * You'll want to control this if we are running on an - * architecture where the addresses go the other direction. - * Not sure this is even a realistic consideration. - */ - const BOOL addressIncreases = TRUE; - - /* - * If it falls in side the known range, load the symbols. - */ - if(addressIncreases - ? (addr >= aModuleBase && addr <= (aModuleBase + aModuleSize)) - : (addr <= aModuleBase && addr >= (aModuleBase - aModuleSize)) - ) - { - BOOL loadRes = FALSE; - HANDLE process = GetCurrentProcess(); - - loadRes = _SymLoadModule(process, NULL, aModuleName, NULL, aModuleBase, aModuleSize); - PR_ASSERT(FALSE != loadRes); - } - - return retval; -} - -/* - * SymGetModuleInfoEspecial - * - * Attempt to determine the module information. - * Bug 112196 says this DLL may not have been loaded at the time - * SymInitialize was called, and thus the module information - * and symbol information is not available. - * This code rectifies that problem. - */ -BOOL SymGetModuleInfoEspecial(HANDLE aProcess, DWORD aAddr, PIMAGEHLP_MODULE aModuleInfo, PIMAGEHLP_LINE aLineInfo) -{ - BOOL retval = FALSE; - - /* - * Init the vars if we have em. - */ - aModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULE); - if (nsnull != aLineInfo) { - aLineInfo->SizeOfStruct = sizeof(IMAGEHLP_LINE); - } - - /* - * Give it a go. - * It may already be loaded. - */ - retval = _SymGetModuleInfo(aProcess, aAddr, aModuleInfo); - - if (FALSE == retval) { - BOOL enumRes = FALSE; - - /* - * Not loaded, here's the magic. - * Go through all the modules. - */ - enumRes = _EnumerateLoadedModules(aProcess, callbackEspecial, (PVOID)aAddr); - if(FALSE != enumRes) - { - /* - * One final go. - * If it fails, then well, we have other problems. - */ - retval = _SymGetModuleInfo(aProcess, aAddr, aModuleInfo); - } - } - - /* - * If we got module info, we may attempt line info as well. - * We will not report failure if this does not work. - */ - if (FALSE != retval && nsnull != aLineInfo && nsnull != _SymGetLineFromAddr) { - DWORD displacement = 0; - BOOL lineRes = FALSE; - - lineRes = _SymGetLineFromAddr(aProcess, aAddr, &displacement, aLineInfo); - } - - return retval; -} - -PRBool -EnsureSymInitialized() -{ - static PRBool gInitialized = PR_FALSE; - - if (! gInitialized) { - if (! EnsureImageHlpInitialized()) - return PR_FALSE; - _SymSetOptions(SYMOPT_LOAD_LINES | SYMOPT_UNDNAME); - gInitialized = _SymInitialize(GetCurrentProcess(), 0, TRUE); - } - return gInitialized; -} - - -/** - * Walk the stack, translating PC's found into strings and recording the - * chain in aBuffer. For this to work properly, the dll's must be rebased - * so that the address in the file agrees with the address in memory. - * Otherwise StackWalk will return FALSE when it hits a frame in a dll's - * whose in memory address doesn't match it's in-file address. - * - * Fortunately, there is a handy dandy routine in IMAGEHLP.DLL that does - * the rebasing and accordingly I've made a tool to use it to rebase the - * DLL's in one fell swoop (see xpcom/tools/windows/rebasedlls.cpp). - */ - - -void -DumpStackToFile(FILE* aStream) -{ - HANDLE myProcess = ::GetCurrentProcess(); - HANDLE myThread = ::GetCurrentThread(); - BOOL ok; - - ok = EnsureSymInitialized(); - if (! ok) - return; - - // Get the context information for this thread. That way we will - // know where our sp, fp, pc, etc. are and can fill in the - // STACKFRAME with the initial values. - CONTEXT context; - context.ContextFlags = CONTEXT_FULL; - ok = GetThreadContext(myThread, &context); - if (! ok) - return; - - // Setup initial stack frame to walk from - STACKFRAME frame; - memset(&frame, 0, sizeof(frame)); - frame.AddrPC.Offset = context.Eip; - frame.AddrPC.Mode = AddrModeFlat; - frame.AddrStack.Offset = context.Esp; - frame.AddrStack.Mode = AddrModeFlat; - frame.AddrFrame.Offset = context.Ebp; - frame.AddrFrame.Mode = AddrModeFlat; - - // Now walk the stack and map the pc's to symbol names - int skip = 2; - while (1) { - ok = _StackWalk(IMAGE_FILE_MACHINE_I386, - myProcess, - myThread, - &frame, - &context, - 0, // read process memory routine - _SymFunctionTableAccess, // function table access routine - _SymGetModuleBase, // module base routine - 0); // translate address routine - - if (!ok) { - LPVOID lpMsgBuf; - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR) &lpMsgBuf, - 0, - NULL - ); - fprintf(aStream, "### ERROR: WalkStack: %s", lpMsgBuf); - fflush(aStream); - LocalFree( lpMsgBuf ); - } - if (!ok || frame.AddrPC.Offset == 0) - break; - - if (skip-- > 0) - continue; - - // - // Attempt to load module info before we attempt to reolve the symbol. - // This just makes sure we get good info if available. - // - IMAGEHLP_MODULE modInfo; - modInfo.SizeOfStruct = sizeof(modInfo); - BOOL modInfoRes = TRUE; - modInfoRes = SymGetModuleInfoEspecial(myProcess, frame.AddrPC.Offset, &modInfo, nsnull); - - char buf[sizeof(IMAGEHLP_SYMBOL) + 512]; - PIMAGEHLP_SYMBOL symbol = (PIMAGEHLP_SYMBOL) buf; - symbol->SizeOfStruct = sizeof(buf); - symbol->MaxNameLength = 512; - - DWORD displacement; - ok = _SymGetSymFromAddr(myProcess, - frame.AddrPC.Offset, - &displacement, - symbol); - - if (ok) { - fprintf(aStream, "%s+0x%08X\n", symbol->Name, displacement); - } - else { - fprintf(aStream, "0x%08X\n", frame.AddrPC.Offset); - } - } -} - diff --git a/mozilla/tools/trace-malloc/lib/nsStackFrameWin.h b/mozilla/tools/trace-malloc/lib/nsStackFrameWin.h deleted file mode 100644 index e8b2aa6d306..00000000000 --- a/mozilla/tools/trace-malloc/lib/nsStackFrameWin.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is nsStackFrameWin.h code, released - * December 20, 2000. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Michael Judge, 20-December-2000 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef nsStackFrameWin_h___ -#define nsStackFrameWin_h___ - - -#if defined(_WIN32) && defined(_M_IX86) // WIN32 x86 stack walking code -#include "nspr.h" -#include -#include - -// Define these as static pointers so that we can load the DLL on the -// fly (and not introduce a link-time dependency on it). Tip o' the -// hat to Matt Pietrick for this idea. See: -// -// http://msdn.microsoft.com/library/periodic/period97/F1/D3/S245C6.htm -// -PR_BEGIN_EXTERN_C - -typedef DWORD (__stdcall *SYMSETOPTIONSPROC)(DWORD); -extern SYMSETOPTIONSPROC _SymSetOptions; - -typedef BOOL (__stdcall *SYMINITIALIZEPROC)(HANDLE, LPSTR, BOOL); -extern SYMINITIALIZEPROC _SymInitialize; - -typedef BOOL (__stdcall *SYMCLEANUPPROC)(HANDLE); -extern SYMCLEANUPPROC _SymCleanup; - -typedef BOOL (__stdcall *STACKWALKPROC)(DWORD, - HANDLE, - HANDLE, - LPSTACKFRAME, - LPVOID, - PREAD_PROCESS_MEMORY_ROUTINE, - PFUNCTION_TABLE_ACCESS_ROUTINE, - PGET_MODULE_BASE_ROUTINE, - PTRANSLATE_ADDRESS_ROUTINE); -extern STACKWALKPROC _StackWalk; - -typedef LPVOID (__stdcall *SYMFUNCTIONTABLEACCESSPROC)(HANDLE, DWORD); -extern SYMFUNCTIONTABLEACCESSPROC _SymFunctionTableAccess; - -typedef DWORD (__stdcall *SYMGETMODULEBASEPROC)(HANDLE, DWORD); -extern SYMGETMODULEBASEPROC _SymGetModuleBase; - -typedef BOOL (__stdcall *SYMGETSYMFROMADDRPROC)(HANDLE, DWORD, PDWORD, PIMAGEHLP_SYMBOL); -extern SYMGETSYMFROMADDRPROC _SymGetSymFromAddr; - -typedef DWORD ( __stdcall *SYMLOADMODULE)(HANDLE, HANDLE, PSTR, PSTR, DWORD, DWORD); -extern SYMLOADMODULE _SymLoadModule; - -typedef DWORD ( __stdcall *SYMUNDNAME)(PIMAGEHLP_SYMBOL, PSTR, DWORD); -extern SYMUNDNAME _SymUnDName; - -typedef DWORD ( __stdcall *SYMGETMODULEINFO)( HANDLE, DWORD, PIMAGEHLP_MODULE); -extern SYMGETMODULEINFO _SymGetModuleInfo; - -typedef BOOL ( __stdcall *ENUMLOADEDMODULES)( HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID); -extern ENUMLOADEDMODULES _EnumerateLoadedModules; - -typedef BOOL (__stdcall *SYMGETLINEFROMADDRPROC)(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE); -extern SYMGETLINEFROMADDRPROC _SymGetLineFromAddr; - -PRBool EnsureSymInitialized(); - -PRBool EnsureImageHlpInitialized(); - -/* - * SymGetModuleInfoEspecial - * - * Attempt to determine the module information. - * Bug 112196 says this DLL may not have been loaded at the time - * SymInitialize was called, and thus the module information - * and symbol information is not available. - * This code rectifies that problem. - * Line information is optional. - */ -BOOL SymGetModuleInfoEspecial(HANDLE aProcess, DWORD aAddr, PIMAGEHLP_MODULE aModuleInfo, PIMAGEHLP_LINE aLineInfo); - - -void DumpStackToFile(FILE* out); - -PR_END_EXTERN_C - -#endif //WIN32 - -#endif //nsStackFrameWin_h___ - - diff --git a/mozilla/tools/trace-malloc/lib/nsTraceMalloc.c b/mozilla/tools/trace-malloc/lib/nsTraceMalloc.c deleted file mode 100644 index 24f566ecab1..00000000000 --- a/mozilla/tools/trace-malloc/lib/nsTraceMalloc.c +++ /dev/null @@ -1,2275 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is nsTraceMalloc.c/bloatblame.c code, released - * April 19, 2000. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Brendan Eich, 14-April-2000 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifdef NS_TRACE_MALLOC - /* - * TODO: - * - fix my_dladdr so it builds its own symbol tables from bfd - * - extend logfile so 'F' record tells free stack - * - diagnose rusty's SMP realloc oldsize corruption bug - * - #ifdef __linux__/x86 and port to other platforms - * - unify calltree with gc/boehm somehow (common utility lib?) - */ -#include -#include -#include -#include -#include -#include -#ifdef XP_UNIX -#include -#include -#include -#endif -#include "plhash.h" -#include "pratom.h" -#include "prlog.h" -#include "prmon.h" -#include "prprf.h" -#include "prenv.h" -#include "prnetdb.h" -#include "nsTraceMalloc.h" -#include "nscore.h" - -#ifdef XP_WIN32 -#include "nsStackFrameWin.h" -#include /*for timeb*/ -#include /*for fstat*/ - -#include /*for write*/ -#include "nsTraceMallocCallbacks.h" - -#define WRITE_FLAGS "w" - -#endif /* WIN32 */ - -#ifdef XP_UNIX -#define WRITE_FLAGS "w" - -#ifdef MOZ_DEMANGLE_SYMBOLS -char *nsDemangle(const char *); -#endif - -extern __ptr_t __libc_malloc(size_t); -extern __ptr_t __libc_calloc(size_t, size_t); -extern __ptr_t __libc_realloc(__ptr_t, size_t); -extern void __libc_free(__ptr_t); - -/* XXX I wish dladdr could find local text symbols (static functions). */ -#define __USE_GNU 1 -#include - -#if 1 -#define my_dladdr dladdr -#else -/* XXX this version, which uses libbfd, runs mozilla clean out of memory! */ -#include -#include /* damn dladdr ignores local symbols! */ -#include - -extern struct link_map *_dl_loaded; - -static int my_dladdr(const void *address, Dl_info *info) -{ - const ElfW(Addr) addr = (ElfW(Addr)) address; - struct link_map *lib, *matchlib; - unsigned int n, size; - bfd *abfd; - PTR minisyms; - long nsyms; - bfd_byte *mini, *endmini; - asymbol *sym, *storage; - bfd_vma target, symaddr; - static const char *sname; - - /* Find the highest-addressed object not greater than address. */ - matchlib = NULL; - for (lib = _dl_loaded; lib; lib = lib->l_next) { - if (lib->l_addr != 0 && /* 0 means map not set up yet? */ - lib->l_addr <= addr && - (!matchlib || matchlib->l_addr < lib->l_addr)) { - matchlib = lib; - } - } - if (!matchlib) - return 0; - - /* - * We know the address lies within matchlib, if it's in any shared object. - * Make sure it isn't past the end of matchlib's segments. - */ - n = (size_t) matchlib->l_phnum; - if (n > 0) { - do { - --n; - } while (matchlib->l_phdr[n].p_type != PT_LOAD); - if (addr >= (matchlib->l_addr + - matchlib->l_phdr[n].p_vaddr + - matchlib->l_phdr[n].p_memsz)) { - /* Off the end of the highest-addressed shared object. */ - return 0; - } - } - - /* - * Now we know what object the address lies in. Set up info for a file - * match, then find the greatest info->dli_saddr <= addr. - */ - info->dli_fname = matchlib->l_name; - info->dli_fbase = (void*) matchlib->l_addr; - info->dli_sname = NULL; - info->dli_saddr = NULL; - - /* Ah, the joys of libbfd.... */ - abfd = bfd_openr(matchlib->l_name, "elf32-i386"); - if (!abfd) - return 0; - if (!bfd_check_format(abfd, bfd_object)) { - printf("%s is not an object file, according to libbfd.\n", - matchlib->l_name); - return 0; - } - nsyms = bfd_read_minisymbols(abfd, 0, &minisyms, &size); - if (nsyms < 0) { - bfd_close(abfd); - return 0; - } - - if (nsyms > 0) { - storage = bfd_make_empty_symbol(abfd); - if (!storage) { - bfd_close(abfd); - return 0; - } - target = (bfd_vma) addr - (bfd_vma) matchlib->l_addr; - endmini = (bfd_byte*) minisyms + nsyms * size; - - for (mini = (bfd_byte*) minisyms; mini < endmini; mini += size) { - sym = bfd_minisymbol_to_symbol(abfd, 0, (const PTR)mini, storage); - if (!sym) { - bfd_close(abfd); - return 0; - } - if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK)) { - symaddr = sym->value + sym->section->vma; - if (symaddr == 0 || symaddr > target) - continue; - if (!info->dli_sname || info->dli_saddr < (void*) symaddr) { - info->dli_sname = sym->name; - info->dli_saddr = (void*) symaddr; - } - } - } - - /* Emulate dladdr by allocating and owning info->dli_sname's storage. */ - if (info->dli_sname) { - if (sname) - __libc_free((void*) sname); - sname = strdup(info->dli_sname); - if (!sname) - return 0; - info->dli_sname = sname; - } - } - bfd_close(abfd); - return 1; -} -#endif /* 0 */ - -#else /* !XP_UNIX */ - -#define __libc_malloc(x) malloc(x) -#define __libc_calloc(x, y) calloc(x,y) -#define __libc_realloc(x, y) realloc(x,y) -#define __libc_free(x) free(x) - -/* - * Ok we need to load malloc, free, realloc, and calloc from the dll and store - * the function pointers somewhere. All other dlls that link with this library - * should have their malloc overridden to call this one. - */ -typedef void * (__stdcall *MALLOCPROC)(size_t); -typedef void * (__stdcall *REALLOCPROC)(void *, size_t); -typedef void * (__stdcall *CALLOCPROC)(size_t,size_t); -typedef void (__stdcall *FREEPROC)(void *); - -/*debug types*/ -#ifdef _DEBUG -typedef void * (__stdcall *MALLOCDEBUGPROC) ( size_t, int, const char *, int); -typedef void * (__stdcall *CALLOCDEBUGPROC) ( size_t, size_t, int, const char *, int); -typedef void * (__stdcall *REALLOCDEBUGPROC) ( void *, size_t, int, const char *, int); -typedef void (__stdcall *FREEDEBUGPROC) ( void *, int); -#endif - -struct AllocationFuncs -{ - MALLOCPROC malloc_proc; - CALLOCPROC calloc_proc; - REALLOCPROC realloc_proc; - FREEPROC free_proc; -#ifdef _DEBUG - MALLOCDEBUGPROC malloc_debug_proc; - CALLOCDEBUGPROC calloc_debug_proc; - REALLOCDEBUGPROC realloc_debug_proc; - FREEDEBUGPROC free_debug_proc; -#endif - int prevent_reentry; -}gAllocFuncs; - -#endif /* !XP_UNIX */ - -typedef struct logfile logfile; - -#define STARTUP_TMBUFSIZE (16 * 1024) -#define LOGFILE_TMBUFSIZE (16 * 1024) - -struct logfile { - int fd; - int lfd; /* logical fd, dense among all logfiles */ - char *buf; - int bufsize; - int pos; - uint32 size; - uint32 simsize; - logfile *next; - logfile **prevp; -}; - -static char default_buf[STARTUP_TMBUFSIZE]; -static logfile default_logfile = - {-1, 0, default_buf, STARTUP_TMBUFSIZE, 0, 0, 0, NULL, NULL}; -static logfile *logfile_list = NULL; -static logfile **logfile_tail = &logfile_list; -static logfile *logfp = &default_logfile; -static PRMonitor *tmmon = NULL; -static char *sdlogname = NULL; /* filename for shutdown leak log */ - -/* - * This counter suppresses tracing, in case any tracing code needs to malloc, - * and it must be tested and manipulated only within tmmon. - */ -static uint32 suppress_tracing = 0; - -#define TM_ENTER_MONITOR() \ - PR_BEGIN_MACRO \ - if (tmmon) \ - PR_EnterMonitor(tmmon); \ - PR_END_MACRO - -#define TM_EXIT_MONITOR() \ - PR_BEGIN_MACRO \ - if (tmmon) \ - PR_ExitMonitor(tmmon); \ - PR_END_MACRO - -/* We don't want more than 32 logfiles open at once, ok? */ -typedef uint32 lfd_set; - -#define LFD_SET_STATIC_INITIALIZER 0 -#define LFD_SET_SIZE 32 - -#define LFD_ZERO(s) (*(s) = 0) -#define LFD_BIT(i) ((uint32)1 << (i)) -#define LFD_TEST(i,s) (LFD_BIT(i) & *(s)) -#define LFD_SET(i,s) (*(s) |= LFD_BIT(i)) -#define LFD_CLR(i,s) (*(s) &= ~LFD_BIT(i)) - -static logfile *get_logfile(int fd) -{ - logfile *fp; - int lfd; - - for (fp = logfile_list; fp; fp = fp->next) { - if (fp->fd == fd) - return fp; - } - lfd = 0; -retry: - for (fp = logfile_list; fp; fp = fp->next) { - if (fp->fd == lfd) { - if (++lfd >= LFD_SET_SIZE) - return NULL; - goto retry; - } - } - fp = __libc_malloc(sizeof(logfile) + LOGFILE_TMBUFSIZE); - if (!fp) - return NULL; - fp->fd = fd; - fp->lfd = lfd; - fp->buf = (char*) (fp + 1); - fp->bufsize = LOGFILE_TMBUFSIZE; - fp->pos = 0; - fp->size = fp->simsize = 0; - fp->next = NULL; - fp->prevp = logfile_tail; - *logfile_tail = fp; - logfile_tail = &fp->next; - return fp; -} - -static void flush_logfile(logfile *fp) -{ - int len, cnt, fd; - char *bp; - - len = fp->pos; - if (len == 0) - return; - fp->pos = 0; - fd = fp->fd; - if (fd >= 0) { - fp->size += len; - bp = fp->buf; - do { - cnt = write(fd, bp, len); - if (cnt <= 0) { - printf("### nsTraceMalloc: write failed or wrote 0 bytes!\n"); - return; - } - bp += cnt; - len -= cnt; - } while (len > 0); - } - fp->simsize += len; -} - -static void log_byte(logfile *fp, char byte) -{ - if (fp->pos == fp->bufsize) - flush_logfile(fp); - fp->buf[fp->pos++] = byte; -} - -static void log_string(logfile *fp, const char *str) -{ - int len, rem, cnt; - - len = strlen(str); - while ((rem = fp->pos + len - fp->bufsize) > 0) { - cnt = len - rem; - strncpy(&fp->buf[fp->pos], str, cnt); - str += cnt; - fp->pos += cnt; - flush_logfile(fp); - len = rem; - } - strncpy(&fp->buf[fp->pos], str, len); - fp->pos += len; - - /* Terminate the string. */ - log_byte(fp, '\0'); -} - -static void log_filename(logfile* fp, const char* filename) -{ - if (strlen(filename) < 512) { - char *bp, *cp, buf[512]; - - bp = strstr(strcpy(buf, filename), "mozilla"); - if (!bp) - bp = buf; - - for (cp = bp; *cp; cp++) { - if (*cp == '\\') - *cp = '/'; - } - - filename = bp; - } - log_string(fp, filename); -} - -static void log_uint32(logfile *fp, uint32 ival) -{ - if (ival < 0x80) { - /* 0xxx xxxx */ - log_byte(fp, (char) ival); - } else if (ival < 0x4000) { - /* 10xx xxxx xxxx xxxx */ - log_byte(fp, (char) ((ival >> 8) | 0x80)); - log_byte(fp, (char) (ival & 0xff)); - } else if (ival < 0x200000) { - /* 110x xxxx xxxx xxxx xxxx xxxx */ - log_byte(fp, (char) ((ival >> 16) | 0xc0)); - log_byte(fp, (char) ((ival >> 8) & 0xff)); - log_byte(fp, (char) (ival & 0xff)); - } else if (ival < 0x10000000) { - /* 1110 xxxx xxxx xxxx xxxx xxxx xxxx xxxx */ - log_byte(fp, (char) ((ival >> 24) | 0xe0)); - log_byte(fp, (char) ((ival >> 16) & 0xff)); - log_byte(fp, (char) ((ival >> 8) & 0xff)); - log_byte(fp, (char) (ival & 0xff)); - } else { - /* 1111 0000 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx */ - log_byte(fp, (char) 0xf0); - log_byte(fp, (char) ((ival >> 24) & 0xff)); - log_byte(fp, (char) ((ival >> 16) & 0xff)); - log_byte(fp, (char) ((ival >> 8) & 0xff)); - log_byte(fp, (char) (ival & 0xff)); - } -} - -static void log_event1(logfile *fp, char event, uint32 serial) -{ - log_byte(fp, event); - log_uint32(fp, (uint32) serial); -} - -static void log_event2(logfile *fp, char event, uint32 serial, size_t size) -{ - log_event1(fp, event, serial); - log_uint32(fp, (uint32) size); -} - -static void log_event3(logfile *fp, char event, uint32 serial, size_t oldsize, - size_t size) -{ - log_event2(fp, event, serial, oldsize); - log_uint32(fp, (uint32) size); -} - -static void log_event4(logfile *fp, char event, uint32 serial, uint32 ui2, - uint32 ui3, uint32 ui4) -{ - log_event3(fp, event, serial, ui2, ui3); - log_uint32(fp, ui4); -} - -static void log_event5(logfile *fp, char event, uint32 serial, uint32 ui2, - uint32 ui3, uint32 ui4, uint32 ui5) -{ - log_event4(fp, event, serial, ui2, ui3, ui4); - log_uint32(fp, ui5); -} - -static void log_event6(logfile *fp, char event, uint32 serial, uint32 ui2, - uint32 ui3, uint32 ui4, uint32 ui5, uint32 ui6) -{ - log_event5(fp, event, serial, ui2, ui3, ui4, ui5); - log_uint32(fp, ui6); -} - -static void log_event7(logfile *fp, char event, uint32 serial, uint32 ui2, - uint32 ui3, uint32 ui4, uint32 ui5, uint32 ui6, - uint32 ui7) -{ - log_event6(fp, event, serial, ui2, ui3, ui4, ui5, ui6); - log_uint32(fp, ui7); -} - -static void log_event8(logfile *fp, char event, uint32 serial, uint32 ui2, - uint32 ui3, uint32 ui4, uint32 ui5, uint32 ui6, - uint32 ui7, uint32 ui8) -{ - log_event7(fp, event, serial, ui2, ui3, ui4, ui5, ui6, ui7); - log_uint32(fp, ui8); -} - -typedef struct callsite callsite; - -struct callsite { - uint32 pc; - uint32 serial; - lfd_set lfdset; - char *name; - const char *library; - int offset; - callsite *parent; - callsite *siblings; - callsite *kids; -}; - -/* NB: these counters are incremented and decremented only within tmmon. */ -static uint32 library_serial_generator = 0; -static uint32 method_serial_generator = 0; -static uint32 callsite_serial_generator = 0; -static uint32 tmstats_serial_generator = 0; -static uint32 filename_serial_generator = 0; - -/* Root of the tree of callsites, the sum of all (cycle-compressed) stacks. */ -static callsite calltree_root = - {0, 0, LFD_SET_STATIC_INITIALIZER, NULL, NULL, 0, NULL, NULL, NULL}; - -/* Basic instrumentation. */ -static nsTMStats tmstats = NS_TMSTATS_STATIC_INITIALIZER; - -/* Parent with the most kids (tmstats.calltree_maxkids). */ -static callsite *calltree_maxkids_parent; - -/* Calltree leaf for path with deepest stack backtrace. */ -static callsite *calltree_maxstack_top; - -/* Last site (i.e., calling pc) that recurred during a backtrace. */ -static callsite *last_callsite_recurrence; - -static void log_tmstats(logfile *fp) -{ - log_event1(fp, TM_EVENT_STATS, ++tmstats_serial_generator); - log_uint32(fp, tmstats.calltree_maxstack); - log_uint32(fp, tmstats.calltree_maxdepth); - log_uint32(fp, tmstats.calltree_parents); - log_uint32(fp, tmstats.calltree_maxkids); - log_uint32(fp, tmstats.calltree_kidhits); - log_uint32(fp, tmstats.calltree_kidmisses); - log_uint32(fp, tmstats.calltree_kidsteps); - log_uint32(fp, tmstats.callsite_recurrences); - log_uint32(fp, tmstats.backtrace_calls); - log_uint32(fp, tmstats.backtrace_failures); - log_uint32(fp, tmstats.btmalloc_failures); - log_uint32(fp, tmstats.dladdr_failures); - log_uint32(fp, tmstats.malloc_calls); - log_uint32(fp, tmstats.malloc_failures); - log_uint32(fp, tmstats.calloc_calls); - log_uint32(fp, tmstats.calloc_failures); - log_uint32(fp, tmstats.realloc_calls); - log_uint32(fp, tmstats.realloc_failures); - log_uint32(fp, tmstats.free_calls); - log_uint32(fp, tmstats.null_free_calls); - log_uint32(fp, calltree_maxkids_parent ? calltree_maxkids_parent->serial - : 0); - log_uint32(fp, calltree_maxstack_top ? calltree_maxstack_top->serial : 0); -} - -static void *generic_alloctable(void *pool, PRSize size) -{ - return __libc_malloc(size); -} - -static void generic_freetable(void *pool, void *item) -{ - __libc_free(item); -} - -typedef struct lfdset_entry { - PLHashEntry base; - lfd_set lfdset; -} lfdset_entry; - -static PLHashEntry *lfdset_allocentry(void *pool, const void *key) -{ - lfdset_entry *le = __libc_malloc(sizeof *le); - if (le) - LFD_ZERO(&le->lfdset); - return &le->base; -} - -static void lfdset_freeentry(void *pool, PLHashEntry *he, PRUintn flag) -{ - lfdset_entry *le; - - if (flag != HT_FREE_ENTRY) - return; - le = (lfdset_entry*) he; - __libc_free((void*) le); -} - -static PLHashAllocOps lfdset_hashallocops = { - generic_alloctable, generic_freetable, - lfdset_allocentry, lfdset_freeentry -}; - -/* Table of library pathnames mapped to to logged 'L' record serial numbers. */ -static PLHashTable *libraries = NULL; - -/* Table of filename pathnames mapped to logged 'G' record serial numbers. */ -static PLHashTable *filenames = NULL; - -/* Table mapping method names to logged 'N' record serial numbers. */ -static PLHashTable *methods = NULL; - -#ifdef XP_WIN32 - -/* - * Realease builds seem to take more stackframes. - */ -#define MAX_STACKFRAMES 512 -#define MAX_UNMANGLED_NAME_LEN 256 - -static callsite *calltree(int skip) -{ - logfile *fp = logfp; - HANDLE myProcess; - HANDLE myThread; - CONTEXT context; - int ok, maxstack, offset; - int getSymRes = 0; - STACKFRAME frame[MAX_STACKFRAMES]; - uint32 library_serial, method_serial; - int framenum; - uint32 pc; - uint32 depth, nkids; - callsite *parent, **csp, *tmp; - callsite *site = NULL; - char *demangledname; - const char *library; - IMAGEHLP_MODULE imagehelp; - char buf[sizeof(IMAGEHLP_SYMBOL) + 512]; - PIMAGEHLP_SYMBOL symbol; - char *method, *slash; - PLHashNumber hash; - PLHashEntry **hep, *he; - lfdset_entry *le; - char* noname = "noname"; - IMAGEHLP_LINE imagehelpLine; - const char* filename = NULL; - uint32 linenumber = 0; - uint32 filename_serial = 0; - - imagehelp.SizeOfStruct = sizeof(imagehelp); - framenum = 0; - myProcess = GetCurrentProcess(); - myThread = GetCurrentThread(); - - ok = EnsureSymInitialized(); - if (! ok) - return 0; - - /* - * Get the context information for this thread. That way we will know - * where our sp, fp, pc, etc. are, and we can fill in the STACKFRAME with - * the initial values. - */ - context.ContextFlags = CONTEXT_FULL; - ok = GetThreadContext(myThread, &context); - if (! ok) - return 0; - - /* Setup initial stack frame from which to walk. */ - memset(&(frame[0]), 0, sizeof(frame[0])); - frame[0].AddrPC.Offset = context.Eip; - frame[0].AddrPC.Mode = AddrModeFlat; - frame[0].AddrStack.Offset = context.Esp; - frame[0].AddrStack.Mode = AddrModeFlat; - frame[0].AddrFrame.Offset = context.Ebp; - frame[0].AddrFrame.Mode = AddrModeFlat; - for (;framenum < MAX_STACKFRAMES;) { - PIMAGEHLP_SYMBOL symbol = (PIMAGEHLP_SYMBOL) buf; - if (framenum) - memcpy(&(frame[framenum]),&(frame[framenum-1]),sizeof(STACKFRAME)); - - ok = _StackWalk(IMAGE_FILE_MACHINE_I386, - myProcess, - myThread, - &(frame[framenum]), - &context, - 0, /* read process memory hook */ - _SymFunctionTableAccess,/* function table access hook */ - _SymGetModuleBase, /* module base hook */ - 0); /* translate address hook */ - - if (!ok) - break; - if (skip) { - /* skip tells us to skip the first skip amount of stackframes */ - skip--; - continue; - } - if (frame[framenum].AddrPC.Offset == 0) - break; - - framenum++; - - /* - * Time to increase the number of stack frames? - */ - if (framenum >= MAX_STACKFRAMES) - break; - } - - depth = framenum; - maxstack = (depth > tmstats.calltree_maxstack); - if (maxstack) - tmstats.calltree_maxstack = depth; - - /* Reverse the stack again, finding and building a path in the tree. */ - parent = &calltree_root; - while (0 < framenum) { - DWORD displacement;/*used for getsymfromaddr*/ - - pc = frame[--framenum].AddrPC.Offset; - - csp = &parent->kids; - while ((site = *csp) != NULL) { - if (site->pc == pc) { - tmstats.calltree_kidhits++; - - /* Put the most recently used site at the front of siblings. */ - *csp = site->siblings; - site->siblings = parent->kids; - parent->kids = site; - - /* Check whether we've logged for this site and logfile yet. */ - if (!LFD_TEST(fp->lfd, &site->lfdset)) { - /* - * Some other logfile put this site in the calltree. We - * must log an event for site, and possibly first for its - * method and/or library. Note the code after the while - * loop that tests if (!site). - */ - break; - } - - /* Site already built and logged to fp -- go up the stack. */ - goto upward; - } - tmstats.calltree_kidsteps++; - csp = &site->siblings; - } - - if (!site) { - tmstats.calltree_kidmisses++; - - /* Check for recursion: see if pc is on our ancestor line. */ - for (site = parent; site; site = site->parent) { - if (site->pc == pc) { - tmstats.callsite_recurrences++; - last_callsite_recurrence = site; - goto upward; - } - } - } - - /* - * Not in tree at all, or not logged to fp: let's find our symbolic - * callsite info. XXX static syms are masked by nearest lower global - * Load up the info for the dll. - */ - memset(&imagehelpLine, 0, sizeof(imagehelpLine)); - if (!SymGetModuleInfoEspecial(myProcess, - frame[framenum].AddrPC.Offset, - &imagehelp, &imagehelpLine)) { - library = noname; - filename = noname; - linenumber = 0; - } else { - library = imagehelp.ModuleName; - filename = imagehelpLine.FileName; - linenumber = imagehelpLine.LineNumber; - - if ('\0' == filename) { - filename = noname; - linenumber = 0; - } - } - - /* Check whether we need to emit a library trace record. */ - library_serial = 0; - if (library) { - if (!libraries) { - libraries = PL_NewHashTable(100, PL_HashString, - PL_CompareStrings, PL_CompareValues, - &lfdset_hashallocops, NULL); - if (!libraries) { - tmstats.btmalloc_failures++; - return NULL; - } - } - hash = PL_HashString(library); - hep = PL_HashTableRawLookup(libraries, hash, library); - he = *hep; - library = strdup(library); /* strdup it always? */ - if (he) { - library_serial = (uint32) he->value; - le = (lfdset_entry *) he; - if (LFD_TEST(fp->lfd, &le->lfdset)) { - /* We already logged an event on fp for this library. */ - le = NULL; - } - } else { -/* library = strdup(library); */ - if (library) { - library_serial = ++library_serial_generator; - he = PL_HashTableRawAdd(libraries, hep, hash, library, - (void*) library_serial); - } - if (!he) { - tmstats.btmalloc_failures++; - return NULL; - } - le = (lfdset_entry *) he; - } - if (le) { - /* Need to log an event to fp for this lib. */ - slash = strrchr(library, '/'); - if (slash) - library = slash + 1; - log_event1(fp, TM_EVENT_LIBRARY, library_serial); - log_string(fp, library); - LFD_SET(fp->lfd, &le->lfdset); - } - } - - /* Check whether we need to emit a filename trace record. */ - filename_serial = 0; - if (filename) { - if (!filenames) { - filenames = PL_NewHashTable(100, PL_HashString, - PL_CompareStrings, PL_CompareValues, - &lfdset_hashallocops, NULL); - if (!filenames) { - tmstats.btmalloc_failures++; - return NULL; - } - } - hash = PL_HashString(filename); - hep = PL_HashTableRawLookup(filenames, hash, filename); - he = *hep; - if (he) { - filename_serial = (uint32) he->value; - le = (lfdset_entry *) he; - if (LFD_TEST(fp->lfd, &le->lfdset)) { - /* We already logged an event on fp for this filename. */ - le = NULL; - } - } else { - filename = strdup(filename); - if (filename) { - filename_serial = ++filename_serial_generator; - he = PL_HashTableRawAdd(filenames, hep, hash, filename, - (void*) filename_serial); - } - if (!he) { - tmstats.btmalloc_failures++; - return NULL; - } - le = (lfdset_entry *) he; - } - if (le) { - /* Need to log an event to fp for this filename. */ - log_event1(fp, TM_EVENT_FILENAME, filename_serial); - log_filename(fp, filename); - LFD_SET(fp->lfd, &le->lfdset); - } - } - - symbol = (PIMAGEHLP_SYMBOL) buf; - symbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL); - symbol->MaxNameLength = sizeof(buf) - sizeof(IMAGEHLP_SYMBOL); - symbol->Name[symbol->MaxNameLength] = '\0'; - - getSymRes = _SymGetSymFromAddr(myProcess, - frame[framenum].AddrPC.Offset, - &displacement, - symbol); - - /* Now find the demangled method name and pc offset in it. */ - if (0 != getSymRes) { - demangledname = (char *)malloc(MAX_UNMANGLED_NAME_LEN); - if (!_SymUnDName(symbol,demangledname,MAX_UNMANGLED_NAME_LEN)) { - free(demangledname); - return 0; - } - method = demangledname; - offset = (char*)pc - (char*)(symbol->Address); - } - else { - method = noname; - offset = pc; - } - - /* Emit an 'N' (for New method, 'M' is for malloc!) event if needed. */ - method_serial = 0; - if (!methods) { - methods = PL_NewHashTable(10000, PL_HashString, - PL_CompareStrings, PL_CompareValues, - &lfdset_hashallocops, NULL); - if (!methods) { - tmstats.btmalloc_failures++; - if (method != noname) { - free((void*) method); - } - return NULL; - } - } - hash = PL_HashString(method); - hep = PL_HashTableRawLookup(methods, hash, method); - he = *hep; - if (he) { - method_serial = (uint32) he->value; - if (method != noname) { - free((void*) method); - } - method = (char *) he->key; - le = (lfdset_entry *) he; - if (LFD_TEST(fp->lfd, &le->lfdset)) { - /* We already logged an event on fp for this method. */ - le = NULL; - } - } else { - method_serial = ++method_serial_generator; - he = PL_HashTableRawAdd(methods, hep, hash, method, - (void*) method_serial); - if (!he) { - tmstats.btmalloc_failures++; - if (method != noname) { - free((void*) method); - } - return NULL; - } - le = (lfdset_entry *) he; - } - if (le) { - log_event4(fp, TM_EVENT_METHOD, method_serial, library_serial, - filename_serial, linenumber); - log_string(fp, method); - LFD_SET(fp->lfd, &le->lfdset); - } - - /* Create a new callsite record. */ - if (!site) { - site = malloc(sizeof(callsite)); - if (!site) { - tmstats.btmalloc_failures++; - return NULL; - } - - /* Update parent and max-kids-per-parent stats. */ - if (!parent->kids) - tmstats.calltree_parents++; - nkids = 1; - for (tmp = parent->kids; tmp; tmp = tmp->siblings) - nkids++; - if (nkids > tmstats.calltree_maxkids) { - tmstats.calltree_maxkids = nkids; - calltree_maxkids_parent = parent; - } - - /* Insert the new site into the tree. */ - site->pc = pc; - site->serial = ++callsite_serial_generator; - LFD_ZERO(&site->lfdset); - site->name = method; - site->offset = offset; - site->parent = parent; - site->siblings = parent->kids; - site->library = library; - parent->kids = site; - site->kids = NULL; - } - - /* Log the site with its parent, method, and offset. */ - log_event4(fp, TM_EVENT_CALLSITE, site->serial, parent->serial, - method_serial, offset); - LFD_SET(fp->lfd, &site->lfdset); - - upward: - parent = site; - } - - if (maxstack) - calltree_maxstack_top = site; - depth = 0; - for (tmp = site; tmp; tmp = tmp->parent) - depth++; - if (depth > tmstats.calltree_maxdepth) - tmstats.calltree_maxdepth = depth; - return site; -} - -#else /*XP_UNIX*/ - -static callsite *calltree(uint32 *bp) -{ - logfile *fp = logfp; - uint32 *bpup, *bpdown, pc; - uint32 depth, nkids; - callsite *parent, *site, **csp, *tmp; - Dl_info info; - int ok, len, maxstack, offset; - uint32 library_serial, method_serial; - const char *library, *symbol; - char *method, *slash; - PLHashNumber hash; - PLHashEntry **hep, *he; - lfdset_entry *le; - uint32 filename_serial; - uint32 linenumber; - const char* filename; - - /* Reverse the stack frame list to avoid recursion. */ - bpup = NULL; - for (depth = 0; ; depth++) { - bpdown = (uint32*) bp[0]; - bp[0] = (uint32) bpup; - if ((uint32*) bpdown[0] < bpdown) - break; - bpup = bp; - bp = bpdown; - } - maxstack = (depth > tmstats.calltree_maxstack); - if (maxstack) - tmstats.calltree_maxstack = depth; - - /* Reverse the stack again, finding and building a path in the tree. */ - parent = &calltree_root; - do { - bpup = (uint32*) bp[0]; - bp[0] = (uint32) bpdown; - pc = bp[1]; - - csp = &parent->kids; - while ((site = *csp) != NULL) { - if (site->pc == pc) { - tmstats.calltree_kidhits++; - - /* Put the most recently used site at the front of siblings. */ - *csp = site->siblings; - site->siblings = parent->kids; - parent->kids = site; - - /* Check whether we've logged for this site and logfile yet. */ - if (!LFD_TEST(fp->lfd, &site->lfdset)) { - /* - * Some other logfile put this site in the calltree. We - * must log an event for site, and possibly first for its - * method and/or library. Note the code after the while - * loop that tests if (!site). - */ - break; - } - - /* Site already built and logged to fp -- go up the stack. */ - goto upward; - } - tmstats.calltree_kidsteps++; - csp = &site->siblings; - } - - if (!site) { - tmstats.calltree_kidmisses++; - - /* Check for recursion: see if pc is on our ancestor line. */ - for (site = parent; site; site = site->parent) { - if (site->pc == pc) { - tmstats.callsite_recurrences++; - last_callsite_recurrence = site; - goto upward; - } - } - } - - /* - * Not in tree at all, or not logged to fp: let's find our symbolic - * callsite info. XXX static syms are masked by nearest lower global - */ - info.dli_fname = info.dli_sname = NULL; - ok = my_dladdr((void*) pc, &info); - if (ok < 0) { - tmstats.dladdr_failures++; - return NULL; - } - - /* - * One day, if someone figures out how to get filename and line - * number info, this is the place to fill it all in. - */ - filename = "noname"; - linenumber = 0; - - /* Check whether we need to emit a library trace record. */ - library_serial = 0; - library = info.dli_fname; - if (library) { - if (!libraries) { - libraries = PL_NewHashTable(100, PL_HashString, - PL_CompareStrings, PL_CompareValues, - &lfdset_hashallocops, NULL); - if (!libraries) { - tmstats.btmalloc_failures++; - return NULL; - } - } - hash = PL_HashString(library); - hep = PL_HashTableRawLookup(libraries, hash, library); - he = *hep; - if (he) { - library_serial = (uint32) he->value; - le = (lfdset_entry *) he; - if (LFD_TEST(fp->lfd, &le->lfdset)) { - /* We already logged an event on fp for this library. */ - le = NULL; - } - } else { - library = strdup(library); - if (library) { - library_serial = ++library_serial_generator; - he = PL_HashTableRawAdd(libraries, hep, hash, library, - (void*) library_serial); - } - if (!he) { - tmstats.btmalloc_failures++; - return NULL; - } - le = (lfdset_entry *) he; - } - if (le) { - /* Need to log an event to fp for this lib. */ - slash = strrchr(library, '/'); - if (slash) - library = slash + 1; - log_event1(fp, TM_EVENT_LIBRARY, library_serial); - log_string(fp, library); - LFD_SET(fp->lfd, &le->lfdset); - } - } - - /* Check whether we need to emit a filename trace record. */ - filename_serial = 0; - if (filename) { - if (!filenames) { - filenames = PL_NewHashTable(100, PL_HashString, - PL_CompareStrings, PL_CompareValues, - &lfdset_hashallocops, NULL); - if (!filenames) { - tmstats.btmalloc_failures++; - return NULL; - } - } - hash = PL_HashString(filename); - hep = PL_HashTableRawLookup(filenames, hash, filename); - he = *hep; - if (he) { - filename_serial = (uint32) he->value; - le = (lfdset_entry *) he; - if (LFD_TEST(fp->lfd, &le->lfdset)) { - /* We already logged an event on fp for this filename. */ - le = NULL; - } - } else { - if (filename) { - filename_serial = ++filename_serial_generator; - he = PL_HashTableRawAdd(filenames, hep, hash, filename, - (void*) filename_serial); - } - if (!he) { - tmstats.btmalloc_failures++; - return NULL; - } - le = (lfdset_entry *) he; - } - if (le) { - /* Need to log an event to fp for this filename. */ - log_event1(fp, TM_EVENT_FILENAME, filename_serial); - log_filename(fp, filename); - LFD_SET(fp->lfd, &le->lfdset); - } - } - - /* Now find the demangled method name and pc offset in it. */ - symbol = info.dli_sname; - offset = (char*)pc - (char*)info.dli_saddr; - method = NULL; -#ifdef MOZ_DEMANGLE_SYMBOLS - if (symbol && (len = strlen(symbol)) != 0) { - method = nsDemangle(symbol); - } -#endif - if (info.dli_fbase == (void*)0x8048000) { - /* we're in the binary */ - info.dli_fbase = 0; - } - if (!method) { - method = symbol - ? strdup(symbol) - : PR_smprintf("%s+%X", - info.dli_fname ? info.dli_fname : "main", - (char*)pc - (char*)info.dli_fbase); - } - if (!method) { - tmstats.btmalloc_failures++; - return NULL; - } - - /* Emit an 'N' (for New method, 'M' is for malloc!) event if needed. */ - method_serial = 0; - if (!methods) { - methods = PL_NewHashTable(10000, PL_HashString, - PL_CompareStrings, PL_CompareValues, - &lfdset_hashallocops, NULL); - if (!methods) { - tmstats.btmalloc_failures++; - free((void*) method); - return NULL; - } - } - hash = PL_HashString(method); - hep = PL_HashTableRawLookup(methods, hash, method); - he = *hep; - if (he) { - method_serial = (uint32) he->value; - free((void*) method); - method = (char *) he->key; - le = (lfdset_entry *) he; - if (LFD_TEST(fp->lfd, &le->lfdset)) { - /* We already logged an event on fp for this method. */ - le = NULL; - } - } else { - method_serial = ++method_serial_generator; - he = PL_HashTableRawAdd(methods, hep, hash, method, - (void*) method_serial); - if (!he) { - tmstats.btmalloc_failures++; - free((void*) method); - return NULL; - } - le = (lfdset_entry *) he; - } - if (le) { - log_event4(fp, TM_EVENT_METHOD, method_serial, library_serial, - filename_serial, linenumber); - log_string(fp, method); - LFD_SET(fp->lfd, &le->lfdset); - } - - /* Create a new callsite record. */ - if (!site) { - site = __libc_malloc(sizeof(callsite)); - if (!site) { - tmstats.btmalloc_failures++; - return NULL; - } - - /* Update parent and max-kids-per-parent stats. */ - if (!parent->kids) - tmstats.calltree_parents++; - nkids = 1; - for (tmp = parent->kids; tmp; tmp = tmp->siblings) - nkids++; - if (nkids > tmstats.calltree_maxkids) { - tmstats.calltree_maxkids = nkids; - calltree_maxkids_parent = parent; - } - - /* Insert the new site into the tree. */ - site->pc = pc; - site->serial = ++callsite_serial_generator; - LFD_ZERO(&site->lfdset); - site->name = method; - site->library = info.dli_fname; - site->offset = (char*)pc - (char*)info.dli_fbase; - site->parent = parent; - site->siblings = parent->kids; - parent->kids = site; - site->kids = NULL; - } - - /* Log the site with its parent, method, and offset. */ - log_event4(fp, TM_EVENT_CALLSITE, site->serial, parent->serial, - method_serial, offset); - LFD_SET(fp->lfd, &site->lfdset); - - upward: - parent = site; - bpdown = bp; - bp = bpup; - } while (bp); - - if (maxstack) - calltree_maxstack_top = site; - depth = 0; - for (tmp = site; tmp; tmp = tmp->parent) - depth++; - if (depth > tmstats.calltree_maxdepth) - tmstats.calltree_maxdepth = depth; - return site; -} - -#endif - -#ifdef XP_WIN32 - -callsite * -backtrace(int skip) -{ - callsite *site; - - tmstats.backtrace_calls++; - suppress_tracing++; - - site = calltree(skip); - if (!site) { - tmstats.backtrace_failures++; - /* PR_ASSERT(tmstats.backtrace_failures < 100); */ - } - suppress_tracing--; - return site; -} - -#else /*XP_UNIX*/ - -callsite * -backtrace(int skip) -{ - jmp_buf jb; - uint32 *bp, *bpdown; - callsite *site, **key; - PLHashNumber hash; - PLHashEntry **hep, *he; - int i, n; - - tmstats.backtrace_calls++; - suppress_tracing++; - setjmp(jb); - - /* Stack walking code adapted from Kipp's "leaky". */ - bp = (uint32*) jb[0].__jmpbuf[JB_BP]; - while (--skip >= 0) { - bpdown = (uint32*) *bp++; - if (bpdown < bp) - break; - bp = bpdown; - } - - site = calltree(bp); - if (!site) { - tmstats.backtrace_failures++; - PR_ASSERT(tmstats.backtrace_failures < 100); - } - suppress_tracing--; - return site; -} - - -#endif /* XP_UNIX */ - - -typedef struct allocation { - PLHashEntry entry; - size_t size; - FILE *trackfp; /* for allocation tracking */ -} allocation; - -#define ALLOC_HEAP_SIZE 150000 - -static allocation alloc_heap[ALLOC_HEAP_SIZE]; -static allocation *alloc_freelist = NULL; -static int alloc_heap_initialized = 0; - -static PLHashEntry *alloc_allocentry(void *pool, const void *key) -{ - allocation **listp, *alloc; - int n; - - if (!alloc_heap_initialized) { - n = ALLOC_HEAP_SIZE; - listp = &alloc_freelist; - for (alloc = alloc_heap; --n >= 0; alloc++) { - *listp = alloc; - listp = (allocation**) &alloc->entry.next; - } - *listp = NULL; - alloc_heap_initialized = 1; - } - - listp = &alloc_freelist; - alloc = *listp; - if (!alloc) - return __libc_malloc(sizeof(allocation)); - *listp = (allocation*) alloc->entry.next; - return &alloc->entry; -} - -static void alloc_freeentry(void *pool, PLHashEntry *he, PRUintn flag) -{ - allocation *alloc; - - if (flag != HT_FREE_ENTRY) - return; - alloc = (allocation*) he; - if ((PRUptrdiff)(alloc - alloc_heap) < (PRUptrdiff)ALLOC_HEAP_SIZE) { - alloc->entry.next = &alloc_freelist->entry; - alloc_freelist = alloc; - } else { - __libc_free((void*) alloc); - } -} - -static PLHashAllocOps alloc_hashallocops = { - generic_alloctable, generic_freetable, - alloc_allocentry, alloc_freeentry -}; - -static PLHashNumber hash_pointer(const void *key) -{ - return (PLHashNumber) key; -} - -static PLHashTable *allocations = NULL; - -static PLHashTable *new_allocations(void) -{ - allocations = PL_NewHashTable(200000, hash_pointer, - PL_CompareValues, PL_CompareValues, - &alloc_hashallocops, NULL); - return allocations; -} - -#define get_allocations() (allocations ? allocations : new_allocations()) - -#ifdef XP_UNIX - -__ptr_t malloc(size_t size) -{ - PRUint32 start, end; - __ptr_t *ptr; - callsite *site; - PLHashEntry *he; - allocation *alloc; - - start = PR_IntervalNow(); - ptr = __libc_malloc(size); - end = PR_IntervalNow(); - TM_ENTER_MONITOR(); - tmstats.malloc_calls++; - if (!ptr) { - tmstats.malloc_failures++; - } else if (suppress_tracing == 0) { - site = backtrace(1); - if (site) - log_event5(logfp, TM_EVENT_MALLOC, - site->serial, start, end - start, - (uint32)NS_PTR_TO_INT32(ptr), size); - if (get_allocations()) { - suppress_tracing++; - he = PL_HashTableAdd(allocations, ptr, site); - suppress_tracing--; - if (he) { - alloc = (allocation*) he; - alloc->size = size; - alloc->trackfp = NULL; - } - } - } - TM_EXIT_MONITOR(); - return ptr; -} - -__ptr_t calloc(size_t count, size_t size) -{ - PRUint32 start, end; - __ptr_t *ptr; - callsite *site; - PLHashEntry *he; - allocation *alloc; - - start = PR_IntervalNow(); - ptr = __libc_calloc(count, size); - end = PR_IntervalNow(); - TM_ENTER_MONITOR(); - tmstats.calloc_calls++; - if (!ptr) { - tmstats.calloc_failures++; - } else if (suppress_tracing == 0) { - site = backtrace(1); - size *= count; - if (site) { - log_event5(logfp, TM_EVENT_CALLOC, - site->serial, start, end - start, - (uint32)NS_PTR_TO_INT32(ptr), size); - } - if (get_allocations()) { - suppress_tracing++; - he = PL_HashTableAdd(allocations, ptr, site); - suppress_tracing--; - if (he) { - alloc = (allocation*) he; - alloc->size = size; - alloc->trackfp = NULL; - } - } - } - TM_EXIT_MONITOR(); - return ptr; -} - -__ptr_t realloc(__ptr_t ptr, size_t size) -{ - PRUint32 start, end; - __ptr_t oldptr; - callsite *oldsite, *site; - size_t oldsize; - PLHashNumber hash; - PLHashEntry **hep, *he; - allocation *alloc; - FILE *trackfp = NULL; - - TM_ENTER_MONITOR(); - tmstats.realloc_calls++; - if (suppress_tracing == 0) { - oldptr = ptr; - oldsite = NULL; - oldsize = 0; - he = NULL; - if (oldptr && get_allocations()) { - hash = hash_pointer(oldptr); - hep = PL_HashTableRawLookup(allocations, hash, oldptr); - he = *hep; - if (he) { - oldsite = (callsite*) he->value; - alloc = (allocation*) he; - oldsize = alloc->size; - trackfp = alloc->trackfp; - if (trackfp) { - fprintf(alloc->trackfp, - "\nrealloc(%p, %u), oldsize %u, alloc site %p\n", - (void*) ptr, size, oldsize, (void*) oldsite); - NS_TraceStack(1, trackfp); - } - } - } - } - TM_EXIT_MONITOR(); - - start = PR_IntervalNow(); - ptr = __libc_realloc(ptr, size); - end = PR_IntervalNow(); - - TM_ENTER_MONITOR(); - if (!ptr && size) { - /* - * When realloc() fails, the original block is not freed or moved, so - * we'll leave the allocation entry untouched. - */ - tmstats.realloc_failures++; - } else if (suppress_tracing == 0) { - site = backtrace(1); - if (site) { - log_event8(logfp, TM_EVENT_REALLOC, - site->serial, start, end - start, - (uint32)NS_PTR_TO_INT32(ptr), size, - oldsite ? oldsite->serial : 0, - (uint32)NS_PTR_TO_INT32(oldptr), oldsize); - } - if (ptr && allocations) { - suppress_tracing++; - if (ptr != oldptr) { - /* - * If we're reallocating (not merely allocating new space by - * passing null to realloc) and realloc has moved the block, - * free oldptr. - */ - if (he) - PL_HashTableRemove(allocations, oldptr); - - /* Record the new allocation now, setting he. */ - he = PL_HashTableAdd(allocations, ptr, site); - } else { - /* - * If we haven't yet recorded an allocation (possibly due to - * a temporary memory shortage), do it now. - */ - if (!he) - he = PL_HashTableAdd(allocations, ptr, site); - } - suppress_tracing--; - if (he) { - alloc = (allocation*) he; - alloc->size = size; - alloc->trackfp = trackfp; - } - } - } - TM_EXIT_MONITOR(); - return ptr; -} - -void free(__ptr_t ptr) -{ - PLHashEntry **hep, *he; - callsite *site; - allocation *alloc; - uint32 serial = 0, size = 0; - PRUint32 start, end; - - TM_ENTER_MONITOR(); - tmstats.free_calls++; - if (!ptr) { - tmstats.null_free_calls++; - } else if (suppress_tracing == 0) { - if (get_allocations()) { - hep = PL_HashTableRawLookup(allocations, hash_pointer(ptr), ptr); - he = *hep; - if (he) { - site = (callsite*) he->value; - if (site) { - alloc = (allocation*) he; - serial = site->serial; - size = alloc->size; - if (alloc->trackfp) { - fprintf(alloc->trackfp, "\nfree(%p), alloc site %p\n", - (void*) ptr, (void*) site); - NS_TraceStack(1, alloc->trackfp); - } - } - PL_HashTableRawRemove(allocations, hep, he); - } - } - } - TM_EXIT_MONITOR(); - - start = PR_IntervalNow(); - __libc_free(ptr); - end = PR_IntervalNow(); - - if (size != 0) { - TM_ENTER_MONITOR(); - log_event5(logfp, TM_EVENT_FREE, - serial, start, end - start, - (uint32)NS_PTR_TO_INT32(ptr), size); - TM_EXIT_MONITOR(); - } -} - -#endif /* XP_UNIX */ - -static const char magic[] = NS_TRACE_MALLOC_MAGIC; - -static void -log_header(int logfd) -{ - uint32 ticksPerSec = PR_htonl(PR_TicksPerSecond()); - (void) write(logfd, magic, NS_TRACE_MALLOC_MAGIC_SIZE); - (void) write(logfd, &ticksPerSec, sizeof ticksPerSec); -} - -PR_IMPLEMENT(void) NS_TraceMallocStartup(int logfd) -{ - /* We must be running on the primordial thread. */ - PR_ASSERT(suppress_tracing == 0); - PR_ASSERT(logfp == &default_logfile); - suppress_tracing = (logfd < 0); - - if (suppress_tracing == 0) { - /* Log everything in logfp (aka default_logfile)'s buffer to logfd. */ - logfp->fd = logfd; - logfile_list = &default_logfile; - logfp->prevp = &logfile_list; - logfile_tail = &logfp->next; - log_header(logfd); - } - - atexit(NS_TraceMallocShutdown); - tmmon = PR_NewMonitor(); - -#ifdef XP_WIN32 - /* Register listeners for win32. */ - if (suppress_tracing == 0) { - StartupHooker(); - } -#endif -} - - -/* - * Options for log files, with the log file name either as the next option - * or separated by '=' (e.g. "./mozilla --trace-malloc * malloc.log" or - * "./mozilla --trace-malloc=malloc.log"). - */ -static const char TMLOG_OPTION[] = "--trace-malloc"; -static const char SDLOG_OPTION[] = "--shutdown-leaks"; - -#define SHOULD_PARSE_ARG(name_, log_, arg_) \ - (0 == strncmp(arg_, name_, sizeof(name_) - 1)) - -#define PARSE_ARG(name_, log_, argv_, i_, consumed_) \ - PR_BEGIN_MACRO \ - char _nextchar = argv_[i_][sizeof(name_) - 1]; \ - if (_nextchar == '=') { \ - log_ = argv_[i_] + sizeof(name_); \ - consumed_ = 1; \ - } else if (_nextchar == '\0') { \ - log_ = argv_[i_+1]; \ - consumed_ = 2; \ - } \ - PR_END_MACRO - -PR_IMPLEMENT(int) NS_TraceMallocStartupArgs(int argc, char* argv[]) -{ - int i, logfd = -1, consumed, logflags; - char *tmlogname = NULL; /* note global |sdlogname| */ - - /* - * Look for the --trace-malloc option early, to avoid missing - * early mallocs (we miss static constructors whose output overflows the - * log file's static 16K output buffer). - */ - for (i = 1; i < argc; i += consumed) { - consumed = 0; - if (SHOULD_PARSE_ARG(TMLOG_OPTION, tmlogname, argv[i])) - PARSE_ARG(TMLOG_OPTION, tmlogname, argv, i, consumed); - else if (SHOULD_PARSE_ARG(SDLOG_OPTION, sdlogname, argv[i])) - PARSE_ARG(SDLOG_OPTION, sdlogname, argv, i, consumed); - - if (consumed) { -#ifndef XP_WIN32 /* If we don't comment this out, it will crash Windows. */ - int j; - /* Now remove --trace-malloc and its argument from argv. */ - argc -= consumed; - for (j = i; j < argc; ++j) - argv[j] = argv[j+consumed]; - argv[argc] = NULL; - consumed = 0; /* don't advance next iteration */ -#endif - } else { - consumed = 1; - } - } - - if (tmlogname) { -#ifdef XP_UNIX - int pipefds[2]; -#endif - - switch (*tmlogname) { -#ifdef XP_UNIX - case '|': - if (pipe(pipefds) == 0) { - pid_t pid = fork(); - if (pid == 0) { - /* In child: set up stdin, parse args, and exec. */ - int maxargc, nargc; - char **nargv, *token; - - if (pipefds[0] != 0) { - dup2(pipefds[0], 0); - close(pipefds[0]); - } - close(pipefds[1]); - - tmlogname = strtok(tmlogname + 1, " \t"); - maxargc = 3; - nargv = (char **) malloc((maxargc+1) * sizeof(char *)); - if (!nargv) exit(1); - nargc = 0; - nargv[nargc++] = tmlogname; - while ((token = strtok(NULL, " \t")) != NULL) { - if (nargc == maxargc) { - maxargc *= 2; - nargv = (char**) - realloc(nargv, (maxargc+1) * sizeof(char*)); - if (!nargv) exit(1); - } - nargv[nargc++] = token; - } - nargv[nargc] = NULL; - - (void) setsid(); - execvp(tmlogname, nargv); - exit(127); - } - - if (pid > 0) { - /* In parent: set logfd to the pipe's write side. */ - close(pipefds[0]); - logfd = pipefds[1]; - } - } - if (logfd < 0) { - fprintf(stderr, - "%s: can't pipe to trace-malloc child process %s: %s\n", - argv[0], tmlogname, strerror(errno)); - exit(1); - } - break; -#endif /*XP_UNIX*/ - case '-': - /* Don't log from startup, but do prepare to log later. */ - /* XXX traditional meaning of '-' as option argument is "stdin" or "stdout" */ - if (tmlogname[1] == '\0') - break; - /* FALL THROUGH */ - - default: - logflags = O_CREAT | O_WRONLY | O_TRUNC; -#if defined(XP_WIN32) - /* - * Avoid translations on WIN32. - */ - logflags |= O_BINARY; -#endif - logfd = open(tmlogname, logflags, 0644); - if (logfd < 0) { - fprintf(stderr, - "%s: can't create trace-malloc log named %s: %s\n", - argv[0], tmlogname, strerror(errno)); - exit(1); - } - break; - } - } - - NS_TraceMallocStartup(logfd); - return argc; -} - -PR_IMPLEMENT(void) NS_TraceMallocShutdown() -{ - logfile *fp; - - if (sdlogname) - NS_TraceMallocDumpAllocations(sdlogname); - - if (tmstats.backtrace_failures) { - fprintf(stderr, - "TraceMalloc backtrace failures: %lu (malloc %lu dladdr %lu)\n", - (unsigned long) tmstats.backtrace_failures, - (unsigned long) tmstats.btmalloc_failures, - (unsigned long) tmstats.dladdr_failures); - } - while ((fp = logfile_list) != NULL) { - logfile_list = fp->next; - log_tmstats(fp); - flush_logfile(fp); - if (fp->fd >= 0) { - close(fp->fd); - fp->fd = -1; - } - if (fp != &default_logfile) { - if (fp == logfp) - logfp = &default_logfile; - free((void*) fp); - } - } - if (tmmon) { - PRMonitor *mon = tmmon; - tmmon = NULL; - PR_DestroyMonitor(mon); - } -#ifdef XP_WIN32 - if (suppress_tracing == 0) { - ShutdownHooker(); - } -#endif -} - -PR_IMPLEMENT(void) NS_TraceMallocDisable() -{ - logfile *fp; - - TM_ENTER_MONITOR(); - for (fp = logfile_list; fp; fp = fp->next) - flush_logfile(fp); - suppress_tracing++; - TM_EXIT_MONITOR(); -} - -PR_IMPLEMENT(void) NS_TraceMallocEnable() -{ - TM_ENTER_MONITOR(); - suppress_tracing--; - TM_EXIT_MONITOR(); -} - -PR_IMPLEMENT(int) NS_TraceMallocChangeLogFD(int fd) -{ - logfile *oldfp, *fp; - struct stat sb; - - TM_ENTER_MONITOR(); - oldfp = logfp; - if (oldfp->fd != fd) { - flush_logfile(oldfp); - fp = get_logfile(fd); - if (!fp) - return -2; - if (fd >= 0 && fstat(fd, &sb) == 0 && sb.st_size == 0) - log_header(fd); - logfp = fp; - } - TM_EXIT_MONITOR(); - return oldfp->fd; -} - -static PRIntn -lfd_clr_enumerator(PLHashEntry *he, PRIntn i, void *arg) -{ - lfdset_entry *le = (lfdset_entry*) he; - logfile *fp = (logfile*) arg; - - LFD_CLR(fp->lfd, &le->lfdset); - return HT_ENUMERATE_NEXT; -} - -static void -lfd_clr_walk(callsite *site, logfile *fp) -{ - callsite *kid; - - LFD_CLR(fp->lfd, &site->lfdset); - for (kid = site->kids; kid; kid = kid->siblings) - lfd_clr_walk(kid, fp); -} - -PR_IMPLEMENT(void) -NS_TraceMallocCloseLogFD(int fd) -{ - logfile *fp; - - TM_ENTER_MONITOR(); - - fp = get_logfile(fd); - if (fp) { - flush_logfile(fp); - if (fp == &default_logfile) { - /* Leave default_logfile in logfile_list with an fd of -1. */ - fp->fd = -1; - - /* NB: we can never free lfd 0, it belongs to default_logfile. */ - PR_ASSERT(fp->lfd == 0); - } else { - /* Clear fp->lfd in all possible lfdsets. */ - PL_HashTableEnumerateEntries(libraries, lfd_clr_enumerator, fp); - PL_HashTableEnumerateEntries(methods, lfd_clr_enumerator, fp); - lfd_clr_walk(&calltree_root, fp); - - /* Unlink fp from logfile_list, freeing lfd for reallocation. */ - *fp->prevp = fp->next; - if (!fp->next) { - PR_ASSERT(logfile_tail == &fp->next); - logfile_tail = fp->prevp; - } - - /* Reset logfp if we must, then free fp. */ - if (fp == logfp) - logfp = &default_logfile; - free((void*) fp); - } - } - - TM_EXIT_MONITOR(); - close(fd); -} - -PR_IMPLEMENT(void) -NS_TraceMallocLogTimestamp(const char *caption) -{ - logfile *fp; -#ifdef XP_UNIX - struct timeval tv; -#endif -#ifdef XP_WIN32 - struct _timeb tb; -#endif - - TM_ENTER_MONITOR(); - - fp = logfp; - log_byte(fp, TM_EVENT_TIMESTAMP); - -#ifdef XP_UNIX - gettimeofday(&tv, NULL); - log_uint32(fp, (uint32) tv.tv_sec); - log_uint32(fp, (uint32) tv.tv_usec); -#endif -#ifdef XP_WIN32 - _ftime(&tb); - log_uint32(fp, (uint32) tb.time); - log_uint32(fp, (uint32) tb.millitm); -#endif - log_string(fp, caption); - - TM_EXIT_MONITOR(); -} - -static PRIntn -allocation_enumerator(PLHashEntry *he, PRIntn i, void *arg) -{ - allocation *alloc = (allocation*) he; - FILE *ofp = (FILE*) arg; - callsite *site = (callsite*) he->value; - - extern const char* nsGetTypeName(const void* ptr); - unsigned *p, *end; - - fprintf(ofp, "0x%08X <%s> (%lu)\n", - (unsigned) he->key, - nsGetTypeName(he->key), - (unsigned long) alloc->size); - - end = (unsigned*)(((char*) he->key) + alloc->size); - for (p = (unsigned*)he->key; p < end; ++p) - fprintf(ofp, "\t0x%08X\n", *p); - - while (site) { - if (site->name || site->parent) { - fprintf(ofp, "%s[%s +0x%X]\n", - site->name, site->library, site->offset); - } - site = site->parent; - } - fputc('\n', ofp); - return HT_ENUMERATE_NEXT; -} - -PR_IMPLEMENT(void) -NS_TraceStack(int skip, FILE *ofp) -{ - callsite *site; - - site = backtrace(skip + 1); - while (site) { - if (site->name || site->parent) { - fprintf(ofp, "%s[%s +0x%X]\n", - site->name, site->library, site->offset); - } - site = site->parent; - } -} - -PR_IMPLEMENT(int) -NS_TraceMallocDumpAllocations(const char *pathname) -{ - FILE *ofp; - int rv; - ofp = fopen(pathname, WRITE_FLAGS); - if (!ofp) - return -1; - if (allocations) - PL_HashTableEnumerateEntries(allocations, allocation_enumerator, ofp); - rv = ferror(ofp) ? -1 : 0; - fclose(ofp); - return rv; -} - -PR_IMPLEMENT(void) -NS_TraceMallocFlushLogfiles() -{ - logfile *fp; - - TM_ENTER_MONITOR(); - - for (fp = logfile_list; fp; fp = fp->next) - flush_logfile(fp); - - TM_EXIT_MONITOR(); -} - -PR_IMPLEMENT(void) -NS_TrackAllocation(void* ptr, FILE *ofp) -{ - PLHashEntry **hep; - allocation *alloc; - - fprintf(ofp, "Trying to track %p\n", (void*) ptr); - setlinebuf(ofp); - - TM_ENTER_MONITOR(); - if (get_allocations()) { - hep = PL_HashTableRawLookup(allocations, hash_pointer(ptr), ptr); - alloc = (allocation*) *hep; - if (alloc) { - fprintf(ofp, "Tracking %p\n", (void*) ptr); - alloc->trackfp = ofp; - } else { - fprintf(ofp, "Not tracking %p\n", (void*) ptr); - } - } - TM_EXIT_MONITOR(); -} - -#ifdef XP_WIN32 - -PR_IMPLEMENT(void) -MallocCallback(void *ptr, size_t size, PRUint32 start, PRUint32 end) -{ - callsite *site; - PLHashEntry *he; - allocation *alloc; - - TM_ENTER_MONITOR(); - tmstats.malloc_calls++; - if (!ptr) { - tmstats.malloc_failures++; - } else if (suppress_tracing == 0) { - site = backtrace(4); - if (site) - log_event5(logfp, TM_EVENT_MALLOC, - site->serial, start, end - start, - (uint32)NS_PTR_TO_INT32(ptr), size); - if (get_allocations()) { - suppress_tracing++; - he = PL_HashTableAdd(allocations, ptr, site); - suppress_tracing--; - if (he) { - alloc = (allocation*) he; - alloc->size = size; - } - } - } - TM_EXIT_MONITOR(); -} - -PR_IMPLEMENT(void) -CallocCallback(void *ptr, size_t count, size_t size, PRUint32 start, PRUint32 end) -{ - callsite *site; - PLHashEntry *he; - allocation *alloc; - - TM_ENTER_MONITOR(); - tmstats.calloc_calls++; - if (!ptr) { - tmstats.calloc_failures++; - } else if (suppress_tracing == 0) { - site = backtrace(1); - size *= count; - if (site) - log_event5(logfp, TM_EVENT_CALLOC, - site->serial, start, end - start, - (uint32)NS_PTR_TO_INT32(ptr), size); - if (get_allocations()) { - suppress_tracing++; - he = PL_HashTableAdd(allocations, ptr, site); - suppress_tracing--; - if (he) { - alloc = (allocation*) he; - alloc->size = size; - } - } - } - TM_EXIT_MONITOR(); -} - -PR_IMPLEMENT(void) -ReallocCallback(void * oldptr, void *ptr, size_t size, PRUint32 start, PRUint32 end) -{ - callsite *oldsite, *site; - size_t oldsize; - PLHashNumber hash; - PLHashEntry **hep, *he; - allocation *alloc; - - TM_ENTER_MONITOR(); - tmstats.realloc_calls++; - if (suppress_tracing == 0) { - oldsite = NULL; - oldsize = 0; - he = NULL; - if (oldptr && get_allocations()) { - hash = hash_pointer(oldptr); - hep = PL_HashTableRawLookup(allocations, hash, oldptr); - he = *hep; - if (he) { - oldsite = (callsite*) he->value; - alloc = (allocation*) he; - oldsize = alloc->size; - } - } - } - if (!ptr && size) { - tmstats.realloc_failures++; - - /* - * When realloc() fails, the original block is not freed or moved, so - * we'll leave the allocation entry untouched. - */ - } else if (suppress_tracing == 0) { - site = backtrace(1); - if (site) { - log_event8(logfp, TM_EVENT_REALLOC, - site->serial, start, end - start, - (uint32)NS_PTR_TO_INT32(ptr), size, - oldsite ? oldsite->serial : 0, - (uint32)NS_PTR_TO_INT32(oldptr), oldsize); - } - if (ptr && allocations) { - suppress_tracing++; - if (ptr != oldptr) { - /* - * If we're reallocating (not allocating new space by passing - * null to realloc) and realloc moved the block, free oldptr. - */ - if (he) - PL_HashTableRawRemove(allocations, hep, he); - - /* Record the new allocation now, setting he. */ - he = PL_HashTableAdd(allocations, ptr, site); - } else { - /* - * If we haven't yet recorded an allocation (possibly due to a - * temporary memory shortage), do it now. - */ - if (!he) - he = PL_HashTableAdd(allocations, ptr, site); - } - suppress_tracing--; - if (he) { - alloc = (allocation*) he; - alloc->size = size; - } - } - } - TM_EXIT_MONITOR(); -} - -PR_IMPLEMENT(void) -FreeCallback(void * ptr, PRUint32 start, PRUint32 end) -{ - PLHashEntry **hep, *he; - callsite *site; - allocation *alloc; - - TM_ENTER_MONITOR(); - tmstats.free_calls++; - if (!ptr) { - tmstats.null_free_calls++; - } else if (suppress_tracing == 0) { - if (get_allocations()) { - hep = PL_HashTableRawLookup(allocations, hash_pointer(ptr), ptr); - he = *hep; - if (he) { - site = (callsite*) he->value; - if (site) { - alloc = (allocation*) he; - log_event5(logfp, TM_EVENT_FREE, - site->serial, start, end - start, - (uint32)NS_PTR_TO_INT32(ptr), alloc->size); - } - PL_HashTableRawRemove(allocations, hep, he); - } - } - } - TM_EXIT_MONITOR(); -} - -#endif /*XP_WIN32*/ - -#endif /* NS_TRACE_MALLOC */ diff --git a/mozilla/tools/trace-malloc/lib/nsTraceMalloc.h b/mozilla/tools/trace-malloc/lib/nsTraceMalloc.h deleted file mode 100644 index 9d821a32903..00000000000 --- a/mozilla/tools/trace-malloc/lib/nsTraceMalloc.h +++ /dev/null @@ -1,231 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is nsTraceMalloc.c/bloatblame.c code, released - * April 19, 2000. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Brendan Eich, 14-April-2000 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef nsTraceMalloc_h___ -#define nsTraceMalloc_h___ - -#include /* for FILE */ -#include "prtypes.h" - -#ifdef XP_WIN -#define setlinebuf(stream) setvbuf((stream), (char *)NULL, _IOLBF, 0) -#endif - -PR_BEGIN_EXTERN_C - -/** - * Magic "number" at start of a trace-malloc log file. Inspired by the PNG - * magic string, which inspired XPCOM's typelib (.xpt) file magic. See the - * NS_TraceMallocStartup comment (below) for magic number differences in log - * file structure. - */ -#define NS_TRACE_MALLOC_MAGIC "XPCOM\nTMLog08\r\n\032" -#define NS_TRACE_MALLOC_MAGIC_SIZE 16 - -/** - * Trace-malloc stats, traced via the 'Z' event at the end of a log file. - */ -typedef struct nsTMStats { - uint32 calltree_maxstack; - uint32 calltree_maxdepth; - uint32 calltree_parents; - uint32 calltree_maxkids; - uint32 calltree_kidhits; - uint32 calltree_kidmisses; - uint32 calltree_kidsteps; - uint32 callsite_recurrences; - uint32 backtrace_calls; - uint32 backtrace_failures; - uint32 btmalloc_failures; - uint32 dladdr_failures; - uint32 malloc_calls; - uint32 malloc_failures; - uint32 calloc_calls; - uint32 calloc_failures; - uint32 realloc_calls; - uint32 realloc_failures; - uint32 free_calls; - uint32 null_free_calls; -} nsTMStats; - -#define NS_TMSTATS_STATIC_INITIALIZER {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} - -/** - * Call NS_TraceMallocStartup with a valid file descriptor to enable logging - * of compressed malloc traces, including callsite chains. Integers may be - * unsigned serial numbers, sizes, or offsets, and require at most 32 bits. - * They're encoded as follows: - * 0-127 0xxxxxxx (binary, one byte) - * 128-16383 10xxxxxx xxxxxxxx - * 16384-0x1fffff 110xxxxx xxxxxxxx xxxxxxxx - * 0x200000-0xfffffff 1110xxxx xxxxxxxx xxxxxxxx xxxxxxxx - * 0x10000000-0xffffffff 11110000 xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx - * Strings are NUL-terminated ASCII. - * - * Event Operands (magic TMLog01) - * 'L' library serial, shared object filename string - * 'N' method serial, library serial, demangled name string - * 'S' site serial, parent serial, method serial, calling pc offset - * 'M' site serial, malloc size - * 'C' site serial, calloc size - * 'R' site serial, realloc oldsize, realloc size - * 'F' site serial, free size - * - * Event Operands (magic TMLog02) - * 'Z' serialized struct tmstats (20 unsigned integers), - * maxkids parent callsite serial, - * maxstack top callsite serial - * - * Event Operands (magic TMLog03) - * 'T' seconds, microseconds, caption - * - * Event Operands (magic TMLog04) - * 'R' site serial, realloc size, old site serial, realloc oldsize - * - * Event Operands (magic TMLog05) - * 'M' site serial, address, malloc size - * 'C' site serial, address, calloc size - * 'R' site serial, address, realloc size, old site serial, - * old address, old size - * 'F' site serial, address, free size - * - * Event Operands (magic TMLog06) - * 'M' site serial, interval, address, malloc size - * 'C' site serial, interval, address, calloc size - * 'R' site serial, interval, address, realloc size, old site serial, - * old address, old size - * 'F' site serial, interval, address, free size - * - * Event Operands (magic TMLog07) - * no one documented their changes. - * best of luck.... - * - * Event Operands (magic TMLog08) - * 'G' filename serial, source filename string. - * 'N' method serial, library serial, source filename serial, - * source file linenumber, demangled name string - * - * See tools/trace-malloc/bloatblame.c for an example log-file reader. - */ -#define TM_EVENT_LIBRARY 'L' -#define TM_EVENT_FILENAME 'G' -#define TM_EVENT_METHOD 'N' -#define TM_EVENT_CALLSITE 'S' -#define TM_EVENT_MALLOC 'M' -#define TM_EVENT_CALLOC 'C' -#define TM_EVENT_REALLOC 'R' -#define TM_EVENT_FREE 'F' -#define TM_EVENT_STATS 'Z' -#define TM_EVENT_TIMESTAMP 'T' - -PR_EXTERN(void) NS_TraceMallocStartup(int logfd); - -/** - * Initialize malloc tracing, using the ``standard'' startup arguments. - */ -PR_EXTERN(int) NS_TraceMallocStartupArgs(int argc, char* argv[]); - -/** - * Stop all malloc tracing, flushing any buffered events to the logfile. - */ -PR_EXTERN(void) NS_TraceMallocShutdown(void); - -/** - * Disable malloc tracing. - */ -PR_EXTERN(void) NS_TraceMallocDisable(void); - -/** - * Enable malloc tracing. - */ -PR_EXTERN(void) NS_TraceMallocEnable(void); - -/** - * Change the log file descriptor, flushing any buffered output to the old - * fd, and writing NS_TRACE_MALLOC_MAGIC to the new file if it is zero length. - * Return the old fd, so the caller can swap open fds. Return -2 on failure, - * which means malloc failure. - */ -PR_EXTERN(int) NS_TraceMallocChangeLogFD(int fd); - -/** - * Close the file descriptor fd and forget any bookkeeping associated with it. - * Do nothing if fd is -1. - */ -PR_EXTERN(void) NS_TraceMallocCloseLogFD(int fd); - -/** - * Emit a timestamp event with the given caption to the current log file. - */ -PR_EXTERN(void) NS_TraceMallocLogTimestamp(const char *caption); - -/** - * Walk the stack, dumping frames in standard form to ofp. If skip is 0, - * exclude the frames for NS_TraceStack and anything it calls to do the walk. - * If skip is less than 0, include -skip such frames. If skip is positive, - * exclude that many frames leading to the call to NS_TraceStack. - */ -PR_EXTERN(void) -NS_TraceStack(int skip, FILE *ofp); - -/** - * Dump a human-readable listing of current allocations and their compressed - * stack backtraces to the file named by pathname. Beware this file may have - * very long lines. - * - * Return -1 on error with errno set by the system, 0 on success. - */ -PR_EXTERN(int) -NS_TraceMallocDumpAllocations(const char *pathname); - -/** - * Flush all logfile buffers. - */ -PR_EXTERN(void) -NS_TraceMallocFlushLogfiles(void); - -/** - * Track all realloc and free calls operating on a given allocation. - */ -PR_EXTERN(void) -NS_TrackAllocation(void* ptr, FILE *ofp); - -PR_END_EXTERN_C - -#endif /* nsTraceMalloc_h___ */ diff --git a/mozilla/tools/trace-malloc/lib/nsTraceMallocCallbacks.h b/mozilla/tools/trace-malloc/lib/nsTraceMallocCallbacks.h deleted file mode 100644 index 5705ca38272..00000000000 --- a/mozilla/tools/trace-malloc/lib/nsTraceMallocCallbacks.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef NSTRACEMALLOCCALLBACKS_H -#define NSTRACEMALLOCCALLBACKS_H - -PR_BEGIN_EXTERN_C - - -PR_EXTERN(void) StartupHooker();/*implemented in TraceMalloc.cpp*/ -PR_EXTERN(void) ShutdownHooker(); - -PR_EXTERN(void) MallocCallback(void *aPtr, size_t aSize, PRUint32 start, PRUint32 end);/*implemented in nsTraceMalloc.c*/ -PR_EXTERN(void) CallocCallback(void *aPtr, size_t aCount, size_t aSize, PRUint32 start, PRUint32 end); -PR_EXTERN(void) ReallocCallback(void *aPin, void* aPout, size_t aSize, PRUint32 start, PRUint32 end); -PR_EXTERN(void) FreeCallback(void *aPtr, PRUint32 start, PRUint32 end); - - -PR_END_EXTERN_C - - -#endif //NSTRACEMALLOCCALLBACKS_H - diff --git a/mozilla/tools/trace-malloc/lib/nsTypeInfo.cpp b/mozilla/tools/trace-malloc/lib/nsTypeInfo.cpp deleted file mode 100644 index 3458d3e2184..00000000000 --- a/mozilla/tools/trace-malloc/lib/nsTypeInfo.cpp +++ /dev/null @@ -1,297 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is nsTypeInfo.cpp code, released - * November 27, 2000. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Patrick C. Beard - * Chris Waterson - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - typeinfo.cpp - - Speculatively use RTTI on a random object. If it contains a pointer at offset 0 - that is in the current process' address space, and that so on, then attempt to - use C++ RTTI's typeid operation to obtain the name of the type. - - by Patrick C. Beard. - */ - -#include -#include - -extern "C" const char* nsGetTypeName(void* ptr); - -class IUnknown { -public: - virtual long QueryInterface() = 0; - virtual long AddRef() = 0; - virtual long Release() = 0; -}; - -#if defined(MACOS) - -#include - -class AddressSpace { -public: - AddressSpace(); - Boolean contains(void* ptr); -private: - ProcessInfoRec mInfo; -}; - -AddressSpace::AddressSpace() -{ - ProcessSerialNumber psn = { 0, kCurrentProcess }; - mInfo.processInfoLength = sizeof(mInfo); - ::GetProcessInformation(&psn, &mInfo); -} - -Boolean AddressSpace::contains(void* ptr) -{ - UInt32 start = UInt32(mInfo.processLocation); - return (UInt32(ptr) >= start && UInt32(ptr) < (start + mInfo.processSize)); -} - -const char* nsGetTypeName(void* ptr) -{ - // construct only one of these per process. - static AddressSpace space; - - // sanity check the vtable pointer, before trying to use RTTI on the object. - void** vt = *(void***)ptr; - if (vt && !(unsigned(vt) & 0x3) && space.contains(vt) && space.contains(*vt)) { - IUnknown* u = static_cast(ptr); - const char* type = typeid(*u).name(); - // make sure it looks like a C++ identifier. - if (type && (isalnum(type[0]) || type[0] == '_')) - return type; - } - return "void*"; -} - -#endif - -// New, more "portable" Linux code is below, but this might be a useful -// model for other platforms, so keeping. -//#if defined(linux) -#if 0 - -#include -#include - -static jmp_buf context; - -static void handler(int signum) -{ - longjmp(context, signum); -} - -#define attempt() setjmp(context) - -class Signaller { -public: - Signaller(int signum); - ~Signaller(); - -private: - typedef void (*handler_t) (int signum); - int mSignal; - handler_t mOldHandler; -}; - -Signaller::Signaller(int signum) - : mSignal(signum), mOldHandler(signal(signum, &handler)) -{ -} - -Signaller::~Signaller() -{ - signal(mSignal, mOldHandler); -} - -// The following are pointers that bamboozle our otherwise feeble -// attempts to "safely" collect type names. -// -// XXX this kind of sucks because it means that anyone trying to use -// this without NSPR will get unresolved symbols when this library -// loads. It's also not very extensible. Oh well: FIX ME! -extern "C" { - // from nsprpub/pr/src/io/priometh.c (libnspr4.so) - extern void* _pr_faulty_methods; -}; - -static inline int -sanity_check_vtable_i386(void** vt) -{ - // Now that we're "safe" inside the signal handler, we can - // start poking around. If we're really an object with - // RTTI, then the second entry in the vtable should point - // to a function. - // - // Let's see if the second entry: - // - // 1) looks like a 4-byte aligned pointer - // - // 2) points to something that looks like the following - // i386 instructions: - // - // 55 push %ebp - // 89e5 mov %esp,%ebp - // 53 push %ebx - // - // or - // - // 55 push %ebp - // 89e5 mov %esp,%ebp - // 56 push %esi - // - // (which is the standard function prologue generated - // by egcs, plus a ``signature'' instruction that appears - // in the typeid() function's implementation). - unsigned char** fp1 = reinterpret_cast(vt) + 1; - - // Does it look like an address? - unsigned char* ip = *fp1; - if ((unsigned(ip) & 3) != 0) - return 0; - - // Does it look like it refers to the standard prologue? - static unsigned char prologue[] = { 0x55, 0x89, 0xE5 }; - for (unsigned i = 0; i < sizeof(prologue); ++i) - if (*ip++ != prologue[i]) - return 0; - - // Is the next instruction a `push %ebx' or `push %esi'? - if (*ip == 0x53 || *ip == 0x56) { - return 1; - } - - // Nope. There's another variant that has a `sub' instruction, - // followed by a `cmpl' and a `jne'. Check for that. - if (ip[0] == 0x83 && ip[1] == 0xec // sub - && ip[3] == 0x83 && ip[4] == 0x3d // cmpl - && ip[10] == 0x75 // jne - ) { - return 1; - } - - return 0; -} - -static inline int -sanity_check_vtable_ppc(void** vt) -{ - // XXX write me! - return 1; -} - -#if defined(__i386) -# define SANITY_CHECK_VTABLE(vt) (sanity_check_vtable_i386(vt)) -#elif defined(PPC) -# define SANITY_CHECK_VTABLE(vt) (sanity_check_vtable_ppc(vt)) -#else -# define SANITY_CHECK_VTABLE(vt) (1) -#endif - -const char* nsGetTypeName(void* ptr) -{ - // sanity check the vtable pointer, before trying to use RTTI on the object. - void** vt = *(void***)ptr; - if (vt && !(unsigned(vt) & 3) && (vt != &_pr_faulty_methods)) { - Signaller s1(SIGSEGV); - if (attempt() == 0) { - if (SANITY_CHECK_VTABLE(vt)) { - // Looks like a function: what the hell, let's call it. - IUnknown* u = static_cast(ptr); - const char* type = typeid(*u).name(); - // EGCS seems to prefix a length string. - while (isdigit(*type)) ++type; - return type; - } - } - } - return "void*"; -} - -#endif - -#if defined(linux) - -#define __USE_GNU -#include -#include -#include - -const char* nsGetTypeName(void* ptr) -{ -#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ - const int expected_offset = 8; - const char vtable_sym_start[] = "_ZTV"; - const int vtable_sym_start_length = sizeof(vtable_sym_start) - 1; -#else - const int expected_offset = 0; - const char vtable_sym_start[] = "__vt_"; - const int vtable_sym_start_length = sizeof(vtable_sym_start) - 1; -#endif - void* vt = *(void**)ptr; - Dl_info info; - // If dladdr fails, if we're not at the expected offset in the vtable, - // or if the symbol name isn't a vtable symbol name, return "void*". - if ( !dladdr(vt, &info) || - ((char*)info.dli_saddr) + expected_offset != vt || - !info.dli_sname || - strncmp(info.dli_sname, vtable_sym_start, vtable_sym_start_length)) - return "void*"; - - // skip the garbage at the beginning of things like - // __vt_14nsRootBoxFrame (gcc 2.96) or _ZTV14nsRootBoxFrame (gcc 3.0) - const char* rv = info.dli_sname + vtable_sym_start_length; - while (*rv && isdigit(*rv)) - ++rv; - return rv; -} - -#endif - -#ifdef XP_WIN32 -const char* nsGetTypeName(void* ptr) -{ - //TODO: COMPLETE THIS - return "void*"; -} - -#endif //XP_WIN32 diff --git a/mozilla/tools/trace-malloc/lib/nsWinTraceMalloc.cpp b/mozilla/tools/trace-malloc/lib/nsWinTraceMalloc.cpp deleted file mode 100644 index b27b4da357d..00000000000 --- a/mozilla/tools/trace-malloc/lib/nsWinTraceMalloc.cpp +++ /dev/null @@ -1,439 +0,0 @@ - -#include -#include - -#include "prtypes.h" -#include "prlock.h" -#include "nscore.h" -#include "nsAutoLock.h" - -#include "nsStackFrameWin.h" -#include "nsDebugHelpWin32.h" -#include "nsTraceMallocCallbacks.h" - -// XXX These are *very* quick hacks and need improvement! - -static PRBool GetSymbolFromAddress(uint32 addr, char* outBuf) -{ - PRBool ok; - ok = EnsureSymInitialized(); - if(!ok) - return ok; - - char buf[sizeof(IMAGEHLP_SYMBOL) + 512]; - PIMAGEHLP_SYMBOL symbol = (PIMAGEHLP_SYMBOL) buf; - symbol->SizeOfStruct = sizeof(buf); - symbol->MaxNameLength = 512; - - DWORD displacement; - - ok = SymGetSymFromAddr(::GetCurrentProcess(), - addr, - &displacement, - symbol); - - if(ok) - { - char buf2[512]; - sprintf(buf2, "%s+0x%08X", symbol->Name, displacement); - strcat(outBuf, buf2); - } - else - strcat(outBuf, "dunno"); - return ok; -} - -static PRBool GetModuleFromAddress(uint32 addr, char* outBuf) -{ - PRBool ok; - ok = EnsureSymInitialized(); - if(!ok) - return ok; - - - IMAGEHLP_MODULE module; - module.SizeOfStruct = sizeof(IMAGEHLP_MODULE); - - ok = SymGetModuleInfo(::GetCurrentProcess(), - addr, - &module); - - if(ok) - strcat(outBuf, module.ModuleName); - else - strcat(outBuf, "dunno"); - return ok; -} - -/***************************************************************************/ -#ifdef VERBOSE -#define SHOW(x_, buf_) \ - printf(#x_" = %#x... %s\n", x_, \ - (buf_[0] = 0, \ - GetModuleFromAddress((uint32)x_, buf_), \ - strcat(buf," :: "), \ - GetSymbolFromAddress((uint32)x_, buf_), \ - buf_)); -#else -#define SHOW(x_, buf_) -#endif //VERBOSE - - -/***************************************************************************/ - -#ifdef VERBOSE -// XXX This is a quick hack to show that x86 Win32 stack walking can be done -// with this sort of loop following the bp. - -void dumpStack() -{ - uint32* bp_; - uint32* bpdown; - uint32 pc; - - char buf[512]; - - _asm { mov bp_ , ebp } - - /* Stack walking code adapted from Kipp's "leaky". */ - while (1) { - bpdown = (uint32*) *bp_++; - pc = *bp_; - // These addresses are iffy... - if (pc < 0x00400000 || pc > 0x7fffffff || bpdown < bp_) - break; - SHOW(pc, buf); - bp_ = bpdown; - } - printf("\n"); -} -#endif - -char* _stdcall call2(void* v) -{ -// dumpStack(); -// return 0; - - return (char *)malloc(123); -} - -int call1(char c, int i, double d, ... ) -{ - free(call2(0)); - return 0; -} - -/***************************************************************************/ -// shows how to use the dhw stuff to hook imported functions - - -static BOOL g_lockOut = FALSE; //stop reentrancy - -DHW_DECLARE_FUN_TYPE_AND_PROTO(dhw_malloc, void*, __cdecl, MALLOC_, (size_t)); - -DHWImportHooker &getMallocHooker() -{ - static DHWImportHooker gMallocHooker("MSVCRTD.dll", "malloc", (PROC) dhw_malloc); - return gMallocHooker; -} - -void * __cdecl dhw_malloc( size_t size ) -{ - PRUint32 start = PR_IntervalNow(); - void* result = DHW_ORIGINAL(MALLOC_, getMallocHooker())(size); - PRUint32 end = PR_IntervalNow(); - if (g_lockOut) - return result; - g_lockOut = TRUE; -#ifdef VERBOSE - printf("* malloc called to get %d bytes. returned %#x\n", size, result); -#endif - MallocCallback(result, size, start, end); -// dumpStack(); -// printf("\n"); - g_lockOut = FALSE; - return result; -} - -DHW_DECLARE_FUN_TYPE_AND_PROTO(dhw_calloc, void*, __cdecl, CALLOC_, (size_t,size_t)); - -DHWImportHooker &getCallocHooker() -{ - static DHWImportHooker gCallocHooker("MSVCRTD.dll", "calloc", (PROC) dhw_calloc); - return gCallocHooker; -} - -void * __cdecl dhw_calloc( size_t count, size_t size ) -{ - PRUint32 start = PR_IntervalNow(); - void* result = DHW_ORIGINAL(CALLOC_, getCallocHooker())(count,size); - PRUint32 end = PR_IntervalNow(); - if (g_lockOut) - return result; - g_lockOut = TRUE; -#ifdef VERBOSE - printf("* calloc called to get %d many of %d bytes. returned %#x\n", count, size, result); -#endif - CallocCallback(result, count, size, start, end); -// dumpStack(); -// printf("\n"); - g_lockOut = FALSE; - return result; -} - -DHW_DECLARE_FUN_TYPE_AND_PROTO(dhw_free, void, __cdecl, FREE_, (void*)); -DHWImportHooker &getFreeHooker() -{ - static DHWImportHooker gFreeHooker("MSVCRTD.dll", "free", (PROC) dhw_free); - return gFreeHooker; -} - -void __cdecl dhw_free( void* p ) -{ - PRUint32 start = PR_IntervalNow(); - DHW_ORIGINAL(FREE_, getFreeHooker())(p); - PRUint32 end = PR_IntervalNow(); - if (g_lockOut) - return; - g_lockOut = TRUE; -#ifdef VERBOSE - printf("* free called for %#x\n", p); -#endif - FreeCallback(p, start, end); -// dumpStack(); -// printf("\n"); - g_lockOut = FALSE; -} - - -DHW_DECLARE_FUN_TYPE_AND_PROTO(dhw_realloc, void*, __cdecl, REALLOC_, (void*, size_t)); -DHWImportHooker &getReallocHooker() -{ - static DHWImportHooker gReallocHooker("MSVCRTD.dll", "realloc", (PROC) dhw_realloc); - return gReallocHooker; -} - -void * __cdecl dhw_realloc(void * pin, size_t size) -{ - PRUint32 start = PR_IntervalNow(); - void* pout = DHW_ORIGINAL(REALLOC_, getReallocHooker())(pin, size); - PRUint32 end = PR_IntervalNow(); - if (g_lockOut) - return pout; - g_lockOut = TRUE; - -#ifdef VERBOSE - printf("* realloc called to resize to %d. old ptr: %#x. new ptr: %#x\n", - size, pin, pout); -#endif - ReallocCallback(pin, pout, size, start, end); -// dumpStack(); -// printf("\n"); - g_lockOut = FALSE; - return pout; -} - -// Note the mangled name! -DHW_DECLARE_FUN_TYPE_AND_PROTO(dhw_new, void*, __cdecl, NEW_, (size_t)); -DHWImportHooker &getNewHooker() -{ - static DHWImportHooker gNewHooker("MSVCRTD.dll", "??2@YAPAXI@Z", (PROC) dhw_new); - return gNewHooker; -} - -void * __cdecl dhw_new(size_t size) -{ - PRUint32 start = PR_IntervalNow(); - void* result = DHW_ORIGINAL(NEW_, getNewHooker())(size); - PRUint32 end = PR_IntervalNow(); - if (g_lockOut) - return result; - g_lockOut = TRUE; - -#ifdef VERBOSE - printf("* new called to get %d bytes. returned %#x\n", size, result); - dumpStack(); -#endif - MallocCallback(result, size, start, end);//do we need a different one for new? -// printf("\n"); - g_lockOut = FALSE; - return result; -} - -// Note the mangled name! -DHW_DECLARE_FUN_TYPE_AND_PROTO(dhw_delete, void, __cdecl, DELETE_, (void*)); -DHWImportHooker &getDeleteHooker() -{ - static DHWImportHooker gDeleteHooker("MSVCRTD.dll", "??3@YAXPAX@Z", (PROC) dhw_delete); - return gDeleteHooker; -} - -void __cdecl dhw_delete(void* p) -{ - PRUint32 start = PR_IntervalNow(); - DHW_ORIGINAL(DELETE_, getDeleteHooker())(p); - PRUint32 end = PR_IntervalNow(); - if (g_lockOut) - return; - g_lockOut = TRUE; -#ifdef VERBOSE - printf("* delete called for %#x\n", p); - dumpStack(); -#endif - FreeCallback(p, start, end); -// printf("\n"); - g_lockOut = FALSE; -} - - - - -/***************************************************************************/ -// A demonstration of using the _CrtSetAllocHook based hooking. -// This system sucks because you don't get to see the allocated pointer. -#if 0 -class myAllocationSizePrinter : public DHWAllocationSizeDebugHook -{ -public: - PRBool AllocHook(size_t size) - { - alloc_calls++ ; - total_mem += size; - if(verbosity) - { - printf("alloc called to get %d bytes.\n", size); - dumpStack(); - } - return PR_TRUE; - } - - PRBool ReallocHook(size_t size, size_t sizeOld) - { - realloc_calls++ ; - total_mem += size; - total_mem -= sizeOld; - if(verbosity) - { - printf("realloc called to size to %d bytes. Old size: %d.\n", - size, sizeOld); - dumpStack(); - } - return PR_TRUE; - } - - PRBool FreeHook(size_t size) - { - free_calls++ ; - total_mem -= size; - if(verbosity) - { - printf("free called to release %d bytes.\n", size); - dumpStack(); - } - return PR_TRUE; - } - - myAllocationSizePrinter(int v) - : verbosity(v), - alloc_calls(0), - realloc_calls(0), - free_calls(0), - total_mem(0) {} - virtual ~myAllocationSizePrinter(){} - - void report() - { - printf("%d allocs, %d reallocs, %d frees, %d bytes leaked\n", - alloc_calls, realloc_calls, free_calls, total_mem); - } - -private: - void dumpStack() - { - if(verbosity == 2) - ::dumpStack(); - } - - int verbosity; - int alloc_calls; - int realloc_calls; - int free_calls; - size_t total_mem; -}; -#endif - - - - -/*C Callbacks*/ -PR_IMPLEMENT(void) -StartupHooker() -{ - if (!EnsureSymInitialized()) - return; - - //run through get all hookers - DHWImportHooker &loadlibraryW = DHWImportHooker::getLoadLibraryWHooker(); - DHWImportHooker &loadlibraryExW = DHWImportHooker::getLoadLibraryExWHooker(); - DHWImportHooker &loadlibraryA = DHWImportHooker::getLoadLibraryAHooker(); - DHWImportHooker &loadlibraryExA = DHWImportHooker::getLoadLibraryExAHooker(); - DHWImportHooker &mallochooker = getMallocHooker(); - DHWImportHooker &reallochooker = getReallocHooker(); - DHWImportHooker &callochooker = getCallocHooker(); - DHWImportHooker &freehooker = getFreeHooker(); - DHWImportHooker &newhooker = getNewHooker(); - DHWImportHooker &deletehooker = getDeleteHooker(); - printf("Startup Hooker\n"); -} - -PR_IMPLEMENT(void) -ShutdownHooker() -{ -} - - - -#if 0 - -int main() -{ - // A demonstration of using the (sucky) _CrtSetAllocHook based hooking. - myAllocationSizePrinter ap(0); - dhwSetAllocationSizeDebugHook(&ap); - - // show that the ImportHooker is hooking calls from loaded dll - DHW_DECLARE_FUN_TYPE(void, __stdcall, SOMECALL_, (void)); - HMODULE module = ::LoadLibrary("Other.dll"); - if(module) { - SOMECALL_ _SomeCall = (SOMECALL_) GetProcAddress(module, "SomeCall"); - if(_SomeCall) - _SomeCall(); - } - - // show that the ImportHooker is hooking sneaky calls made from this dll. - HMODULE module2 = ::LoadLibrary("MSVCRTD.dll"); - if(module2) { - MALLOC_ _sneakyMalloc = (MALLOC_) GetProcAddress(module2, "malloc"); - if(_sneakyMalloc) - { - void* p = _sneakyMalloc(987); - free(p); - } - } - - call1('x', 1, 1.0, "hi there", 2); - - char* p = new char[10]; - delete p; - - void* v = malloc(10); - v = realloc(v, 15); - v = realloc(v, 5); - free(v);` - - ap.report(); - dhwClearAllocationSizeDebugHook(); - return 0; -} -#endif //0 - diff --git a/mozilla/tools/trace-malloc/lib/tm.def b/mozilla/tools/trace-malloc/lib/tm.def deleted file mode 100644 index 1c41dd09713..00000000000 --- a/mozilla/tools/trace-malloc/lib/tm.def +++ /dev/null @@ -1,51 +0,0 @@ -; ***** BEGIN LICENSE BLOCK ***** -; Version: MPL 1.1/GPL 2.0/LGPL 2.1 -; -; The contents of this file are subject to the Mozilla Public License Version -; 1.1 (the "License"); you may not use this file except in compliance with -; the License. You may obtain a copy of the License at -; http://www.mozilla.org/MPL/ -; -; Software distributed under the License is distributed on an "AS IS" basis, -; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -; for the specific language governing rights and limitations under the -; License. -; -; The Original Code is mozilla.org code. -; -; The Initial Developer of the Original Code is -; Netscape Communications Corporation. -; Portions created by the Initial Developer are Copyright (C) 2003 -; the Initial Developer. All Rights Reserved. -; -; Contributor(s): -; -; Alternatively, the contents of this file may be used under the terms of -; either the GNU General Public License Version 2 or later (the "GPL"), or -; the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -; in which case the provisions of the GPL or the LGPL are applicable instead -; of those above. If you wish to allow use of your version of this file only -; under the terms of either the GPL or the LGPL, and not to allow others to -; use your version of this file under the terms of the MPL, indicate your -; decision by deleting the provisions above and replace them with the notice -; and other provisions required by the GPL or the LGPL. If you do not delete -; the provisions above, a recipient may use your version of this file under -; the terms of any one of the MPL, the GPL or the LGPL. -; -; ***** END LICENSE BLOCK ***** - -LIBRARY tracemalloc.dll - -EXPORTS - -NS_TraceMallocStartup -NS_TraceMallocStartupArgs -NS_TraceMallocShutdown -NS_TraceMallocDisable -NS_TraceMallocEnable -NS_TraceMallocChangeLogFD -NS_TraceMallocCloseLogFD -NS_TraceMallocLogTimestamp -NS_TraceStack -NS_TraceMallocDumpAllocations -NS_TraceMallocFlushLogfiles diff --git a/mozilla/tools/trace-malloc/live-bloat.html b/mozilla/tools/trace-malloc/live-bloat.html deleted file mode 100644 index 0f8d4a9aed7..00000000000 --- a/mozilla/tools/trace-malloc/live-bloat.html +++ /dev/null @@ -1,8 +0,0 @@ - - -Live Bloat Dump - - - - - \ No newline at end of file diff --git a/mozilla/tools/trace-malloc/makefile.win b/mozilla/tools/trace-malloc/makefile.win deleted file mode 100755 index 9c0328fa84b..00000000000 --- a/mozilla/tools/trace-malloc/makefile.win +++ /dev/null @@ -1,105 +0,0 @@ -#!nmake -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH=..\.. - -REQUIRES=xpcom - -include <$(DEPTH)\config\config.mak> - -MAKE_OBJ_TYPE=EXE -PROG1 = .\$(OBJDIR)\bloatblame.exe -PROG2 = .\$(OBJDIR)\spacetrace.exe -PROG3 = .\$(OBJDIR)\leakstats.exe - -LIB1 = .\$(OBJDIR)\tmreader.lib - -PROGRAMS = $(PROG1) $(PROG2) $(PROG3) - -C_OBJS=.\$(OBJDIR)\spacecategory.obj .\$(OBJDIR)\formdata.obj -CPP_OBJS=.\$(OBJDIR)\tmreader.obj - -LINCS= $(LINCS) \ - -I$(DEPTH)\config\os2 \ - $(NULL) - -LLIBS= $(LLIBS) \ - $(DIST)\lib\xpcom.lib \ - $(LIBNSPR) \ - $(LIB1) \ - $(NULL) - -!if "" != "$(HAVE_BOUTELL_GD)" -LCFLAGS= $(LCFLAGS) \ - -DHAVE_BOUTELL_GD \ - $(NULL) - -LLIBS= $(LLIBS) \ - $(DIST)\lib\zlib_s.lib \ - $(HAVE_BOUTELL_GD)\gd.lib \ - $(NULL) - -LINCS= $(LINCS) \ - -I$(HAVE_BOUTELL_GD) \ - $(NULL) -!endif - -.DEFAULT: install - -include <$(DEPTH)\config\rules.mak> - -install:: $(PROGRAMS) - -for %p in ($(PROGRAMS)) do $(MAKE_INSTALL) %p $(DIST)\bin - $(MAKE_INSTALL) rules.txt $(DIST)\bin - -clobber:: - -for %p in ($(PROGRAMS)) do $(RM) %p $(DIST)\bin\%p - -$(CPP_OBJS): $(OBJDIR) -$(C_OBJS): $(OBJDIR) - -$(LIB1): $(CPP_OBJS) $(C_OBJS) - $(RM) $@ - lib /nologo /out:$@ $** - -$(PROG1): $(LIB1) bloatblame.c - -$(PROG2): $(LIB1) spacetrace.c - -$(PROG3): $(LIB1) leakstats.c - diff --git a/mozilla/tools/trace-malloc/merge.pl b/mozilla/tools/trace-malloc/merge.pl deleted file mode 100755 index d664e6d7392..00000000000 --- a/mozilla/tools/trace-malloc/merge.pl +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/perl - -$argv = $ARGV[0]; -open( bloatFile, $argv ) or die "Can't open $argv: $!\n"; -while () { - if (/name=/) { - ($td,$name,$func,$a,$ntd) = split(/>/, $_); - ($fname, $memSize) = split( / /, $func ); - ($trash, $linkName) = split( /"/, $name ); - $namesLinks{$fname} = $linkName; - if ($namesSizes{$fname}) { - $namesSizes{$fname} = $namesSizes{$fname} + $memSize; - } - else { - $namesSizes{$fname} = $memSize; - } - } -} - -$argv = $ARGV[1]; -if ($argv) -{ - open( bloatFile, $argv ) or die "Can't open $argv: $!\n"; - while () { - if (/name=/) { - ($td,$name,$func,$a,$ntd) = split(/>/, $_); - ($fname, $memSize) = split( / /, $func ); - $namesSizes{$fname} = $namesSizes{$fname} - $memSize; - } - } -} - -sub byvalue { $namesSizes{$b} <=> $namesSizes{$a} } - - -print ''; -print "\n\n"; -print "Bloat Blame Delta\n"; -print ''; -print "\n\n\n\n"; -print "\n"; - -foreach $key (sort byvalue keys %namesSizes) { - if ($namesSizes{$key}) - { - print "\n"; - print ' \n"; - print " \n"; - print "\n" - } -} - -print "
Memory AllocatedFunction NameLink
', $namesSizes{$key}," ", $key, "
\n"; diff --git a/mozilla/tools/trace-malloc/rules.txt b/mozilla/tools/trace-malloc/rules.txt deleted file mode 100644 index acdc46c623f..00000000000 --- a/mozilla/tools/trace-malloc/rules.txt +++ /dev/null @@ -1,448 +0,0 @@ -# Categorization rules for spacetrace -# -# This file defines the stack frame rules that will categorize -# allocations that spacetrace processes. The format of this file is -# -# -# initial string match for stack frame n -# initial string match for stack frame n+1 -# initial string match for stack frame n+2 -# -# The key in the matching rule is that for every rule, we provide a -# snippet of the stack frame - contiguous substring matches. -# categorynames and rules substring matches are case sensitive -# -# Predefined Categories -# "All" - All allocations [default] -# "uncategorized" - All allocations that dont match any category -# -# -# Suresh Duddi -########################################################################### -# NOTE: This is still under definition -########################################################################### -# General principle of categorization: -# -# - Each category, in general, denotes a module or feature. -# -# - We assign each allocation to the module/feature that directly -# caused the allocation irrespective of which higher level module -# caused the allocation. There are very few exceptions usually when -# an allocation belongs both to a feature-category and to a -# module-category. -# -# bookmarks -# Bookmarks. Mainly initialization. Does not include menu cost. -# css -# Cascading style sheets -# dom -# Memory held by DOM. -# font -# All font stuff -# global-history -# html -# html parsing and layout -# layout -# reflow, frames, line, view -# images -# All images. -# jar -# jar, zip -# js -# javascript -# necko -# All protocol and uri stuff. All urls created accounted here -# preferences -# Preferences stuff. All js cost for preferences is included here. -## rdf -# Most of the rdf allocations. rdf cost from xul, chromeregistry, -# is assigned to xul. -# -# wallet -# Form cache. -# -# xbl -# xbl stuff. Includes js in xbl. -# xpcom -# xpcom, xpt. Allocations for creations of objects are assigned -# onto the respective modules -# xul -# XUL parsing and layout. Includes rdf overhead from xul like -# nsChromeRegistry -# - - -# - -# =========================================================================== -# Leaf rules. We categorize them out first. -# All allocations matching these rules DO belong to the category. -# =========================================================================== - - -nsXULPrototypeScript::Deserialize - - -XSupportsLocale - - -/usr/X11R6/lib/libX11.so - - -JS_Init - - -NS_NewPermanentAtom - - -gfxImageFrame::Init - - -gif_write - - -imgRequest::OnDataAvailable - - -imgLoader:: - - -jinit_master_decompress - - -jinit_marker_reader - - -jinit_marker_decompress - - -nsJPEGDecoder:: - - -nsGIFDecoder2:: - - -nsZipArchive::BuildFileList - - -nsZipArchive::ReadInit - - -nsJARChannel::Open - - -NS_InitXPCOM2 - -# xpt file loads - -xptiInterfaceInfoManager::LoadFile - - -nsGenericModule::Initialize - - -nsStringBundle - - -nsLocale:: - - -nsCharsetConverterManager:: - - -nsDiskCacheDevice::Init - - -nsCacheEntryDescriptor::nsTransportWrapper::OpenOutputStream - - -nsSocketTransport:: - - -nsCacheService:: - - -nsDiskCacheStreamIO:: - - -nsHttpResponseHead:: - - -WLLT - - -nsXULElement::Create - - -nsXULAttribute::Create - - -nsXULDocument::AddElementToMap - - -XULContentSinkImpl::AddAttributes - - -XULContentSinkImpl::CreateElement - - -nsXULElement::SetAttr - - -nsXULDocument::InsertElement - - -NS_NewXULContentBuilder - - -nsXULElement::AppendChildTo - - -nsXBLPrototypeHandler::AppendHandlerText( - - -FrameArena::AllocateFrame - - -nsGlobalHistory::OpenDB - - -nsFontCache:: - - -nsFontMetricsGTK:: - - -nsFont::nsFont - - -gtk_init - - -RDFServiceImpl::GetResource - - -RDFContentSinkImpl::AddProperties - - -RDFContainerImpl::AppendElement - - -RDFXMLDataSourceImpl::Assert - - -NS_NewRDFInMemoryDataSource - - -CSSLoaderImpl::ParseSheet - - -CSSParserImpl::Parse( - - -NS_NewCSS - - -RuleHash::AppendRule - - -nsRuleNode::GetStyleData - - -SelectorList:: - - -CSSRuleProcessor::RulesMatching - - -CSSStyleSheetImpl::Clone - - -nsHttpHeaderArray:: - - -nsScanner::Append - - -nsHTMLTokenizer:: - - -NS_NewHTMLTokenizer - - -nsSlidingString:: - - -nsParser:: - - -nsIParserService:: - - -nsCParserNode:: - - -CNavDTD::CNavDTD - - -nsHTMLDocument:: - - -IncrementalReflow::AddCommand - - -nsBlockFrame:: - - -nsBoxFrame:: - - -nsImageFrame:: - - -nsInlineFrame:: - - -nsLeafFrame:: - - -nsLineLayout:: - - -nsReflowPath::EnsureSubtreeFor - - -nsSliderFrame:: - - -nsScrollBoxFrame:: - - -nsTextFrame:: - - -nsTableRowFrame:: - - -nsTableRowGroupFrame:: - - -nsViewManager:: - - -PresShell::ProcessReflowCommands - - -# ====================================================================== -# Rules that match higher up on the stack -# These go later. -# ====================================================================== - - -PREF_ - - -nsBookmarksService:: - - -nsXBLService::LoadBindings - - -nsXBLBinding::ExecuteAttachedHandler - - -nsXULDocument::LoadScript - - -nsXULDocument::ExecuteScript - - -XULContentSinkImpl::Open - - -RDFContentSinkImpl::HandleEndElement - - -HTMLContentSink::AddAttributes - - -HTMLContentSink::OpenContainer - - -HTMLContentSink::CloseContainer - -# XXX whom to account LoadImage to? I am going with images. - -imgLoader::LoadImage - - -StackArena:: - -# ====================================================================== -# Even more genralized rules. There could be lots of activity that -# happens below them in the stack. But we are sure we have categorized -# a lot of them by using the rules above and know the category of the -# most of the rest. -# ====================================================================== - - -RDFContentSinkImpl:: - - -nsGenericDOMDataNode:: - - -nsDOMClassInfo:: - - -nsDOMSOFactory:: - - -nsXULTemplateBuilder:: - - -XULContentSinkImpl::HandleEndElement - - -nsChromeRegistry:: - - -nsJSContext::EvaluateString - -# Almost all of what is left with XULContentSink belongs to xul -# Also, this was roughly 0.3% of startup memory - -XULContentSinkImpl:: - -# XXX this is a wild guess -> html What remains here is about -# XXX 1.5% of startup footprint - -HTMLContentSink:: - - -nsXBLContentSink:: - - -nsXBLStreamListener::OnDataAvailable - - -nsIOService::NewURI - - -nsIOService::NewChannelFromURI - - -nsSegmentedBuffer::AppendNewSegment - - -nsHttpChannel:: - -# Catchalls to help categorize -# ---------------------------------------------------------------------- - -js_ - -# Everything else -# ---------------------------------------------------------------------- -# -# This is a predefined category. Dont create it yourself. diff --git a/mozilla/tools/trace-malloc/spacecategory.c b/mozilla/tools/trace-malloc/spacecategory.c deleted file mode 100644 index f544c4f54fd..00000000000 --- a/mozilla/tools/trace-malloc/spacecategory.c +++ /dev/null @@ -1,996 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is spacecategory.c code, released - * Apr 12, 2002. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Suresh Duddi , 12-April-2002 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* -** spacecategory.c -** -** Cagtegorizes each allocation using a predefined set of rules -** and presents a tree of categories for browsing. -*/ - -/* -** Required include files. -*/ -#include "spacetrace.h" -#include -#include - -/* -** Ugh, MSVC6's qsort is too slow... -*/ -#include "nsQuickSort.h" - -#if defined(HAVE_BOUTELL_GD) -/* -** See http://www.boutell.com/gd for the GD graphics library. -** Ports for many platorms exist. -** Your box may already have the lib (mine did, redhat 7.1 workstation). -*/ -#include -#include -#include -#include -#endif /* HAVE_BOUTELL_GD */ - -/* -** AddRule -** -** Add a rule into the list of rules maintainted in global -*/ -int -AddRule(STGlobals * g, STCategoryRule * rule) -{ - if (g->mNRules % ST_ALLOC_STEP == 0) { - /* Need more space */ - STCategoryRule **newrules; - - newrules = (STCategoryRule **) realloc(g->mCategoryRules, - (g->mNRules + - ST_ALLOC_STEP) * - sizeof(STCategoryRule *)); - if (!newrules) { - REPORT_ERROR(__LINE__, AddRule_No_Memory); - return -1; - } - g->mCategoryRules = newrules; - } - g->mCategoryRules[g->mNRules++] = rule; - return 0; -} - -/* -** AddChild -** -** Add the node as a child of the parent node -*/ -int -AddChild(STCategoryNode * parent, STCategoryNode * child) -{ - if (parent->nchildren % ST_ALLOC_STEP == 0) { - /* need more space */ - STCategoryNode **newnodes; - - newnodes = (STCategoryNode **) realloc(parent->children, - (parent->nchildren + - ST_ALLOC_STEP) * - sizeof(STCategoryNode *)); - if (!newnodes) { - REPORT_ERROR(__LINE__, AddChild_No_Memory); - return -1; - } - parent->children = newnodes; - } - parent->children[parent->nchildren++] = child; - return 0; -} - -int -ReParent(STCategoryNode * parent, STCategoryNode * child) -{ - PRUint32 i; - - if (child->parent == parent) - return 0; - - /* Remove child from old parent */ - if (child->parent) { - for (i = 0; i < child->parent->nchildren; i++) { - if (child->parent->children[i] == child) { - /* Remove child from list */ - if (i + 1 < child->parent->nchildren) - memmove(&child->parent->children[i], - &child->parent->children[i + 1], - (child->parent->nchildren - i - - 1) * sizeof(STCategoryNode *)); - child->parent->nchildren--; - break; - } - } - } - - /* Add child into new parent */ - AddChild(parent, child); - - return 0; -} - -/* -** findCategoryNode -** -** Given a category name, finds the Node corresponding to the category -*/ -STCategoryNode * -findCategoryNode(const char *catName, STGlobals * g) -{ - PRUint32 i; - - for (i = 0; i < g->mNCategoryMap; i++) { - if (!strcmp(g->mCategoryMap[i]->categoryName, catName)) - return g->mCategoryMap[i]->node; - } - - /* Check if we are looking for the root node */ - if (!strcmp(catName, ST_ROOT_CATEGORY_NAME)) - return &g->mCategoryRoot; - - return NULL; -} - -/* -** AddCategoryNode -** -** Adds a mapping between a category and its Node into the categoryMap -*/ -int -AddCategoryNode(STCategoryNode * node, STGlobals * g) -{ - if (g->mNCategoryMap % ST_ALLOC_STEP == 0) { - /* Need more space */ - STCategoryMapEntry **newmap = - (STCategoryMapEntry **) realloc(g->mCategoryMap, - (g->mNCategoryMap + - ST_ALLOC_STEP) * - sizeof(STCategoryMapEntry *)); - if (!newmap) { - REPORT_ERROR(__LINE__, AddCategoryNode_No_Memory); - return -1; - } - g->mCategoryMap = newmap; - - } - g->mCategoryMap[g->mNCategoryMap] = - (STCategoryMapEntry *) calloc(1, sizeof(STCategoryMapEntry)); - if (!g->mCategoryMap[g->mNCategoryMap]) { - REPORT_ERROR(__LINE__, AddCategoryNode_No_Memory); - return -1; - } - g->mCategoryMap[g->mNCategoryMap]->categoryName = node->categoryName; - g->mCategoryMap[g->mNCategoryMap]->node = node; - g->mNCategoryMap++; - return 0; -} - -/* -** NewCategoryNode -** -** Creates a new category node for category name 'catname' and makes -** 'parent' its parent. -*/ -STCategoryNode * -NewCategoryNode(const char *catName, STCategoryNode * parent, STGlobals * g) -{ - STCategoryNode *node; - - node = (STCategoryNode *) calloc(1, sizeof(STCategoryNode)); - if (!node) - return NULL; - - node->runs = - (STRun **) calloc(g->mCommandLineOptions.mContexts, sizeof(STRun *)); - if (NULL == node->runs) { - free(node); - return NULL; - } - - node->categoryName = catName; - - /* Set parent of child */ - node->parent = parent; - - /* Set child in parent */ - AddChild(parent, node); - - /* Add node into mapping table */ - AddCategoryNode(node, g); - - return node; -} - -/* -** ProcessCategoryLeafRule -** -** Add this into the tree as a leaf node. It doesnt know who its parent is. For now we make -** root as its parent -*/ -int -ProcessCategoryLeafRule(STCategoryRule * leafRule, STCategoryNode * root, - STGlobals * g) -{ - STCategoryRule *rule; - STCategoryNode *node; - - rule = (STCategoryRule *) calloc(1, sizeof(STCategoryRule)); - if (!rule) - return -1; - - /* Take ownership of all elements of rule */ - *rule = *leafRule; - - /* Find/Make a STCategoryNode and add it into the tree */ - node = findCategoryNode(rule->categoryName, g); - if (!node) - node = NewCategoryNode(rule->categoryName, root, g); - - /* Make sure rule knows which node to access */ - rule->node = node; - - /* Add rule into rulelist */ - AddRule(g, rule); - - return 0; -} - -/* -** ProcessCategoryParentRule -** -** Rule has all the children of category as patterns. Sets up the tree so that -** the parent child relationship is honored. -*/ -int -ProcessCategoryParentRule(STCategoryRule * parentRule, STCategoryNode * root, - STGlobals * g) -{ - STCategoryNode *node; - STCategoryNode *child; - PRUint32 i; - - /* Find the parent node in the tree. If not make one and add it into the tree */ - node = findCategoryNode(parentRule->categoryName, g); - if (!node) { - node = NewCategoryNode(parentRule->categoryName, root, g); - if (!node) - return -1; - } - - /* For every child node, Find/Create it and make it the child of this node */ - for (i = 0; i < parentRule->npats; i++) { - child = findCategoryNode(parentRule->pats[i], g); - if (!child) { - child = NewCategoryNode(parentRule->pats[i], node, g); - if (!child) - return -1; - } - else { - /* Reparent child to node. This is because when we created the node - ** we would have created it as the child of root. Now we need to - ** remove it from root's child list and add it into this node - */ - ReParent(node, child); - } - } - - return 0; -} - -/* -** initCategories -** -** Initialize all categories. This reads in a file that says how to categorize -** each callsite, creates a tree of these categories and makes a list of these -** patterns in order for matching -*/ -int -initCategories(STGlobals * g) -{ - FILE *fp; - char buf[1024], *in; - int n; - PRBool inrule, leaf; - STCategoryRule rule; - - fp = fopen(g->mCommandLineOptions.mCategoryFile, "r"); - if (!fp) { - /* It isnt an error to not have a categories file */ - REPORT_INFO("No categories file."); - return -1; - } - - inrule = PR_FALSE; - leaf = PR_FALSE; - - memset(&rule, 0, sizeof(rule)); - - while (fgets(buf, sizeof(buf), fp) != NULL) { - /* Lose the \n */ - n = strlen(buf); - if (buf[n - 1] == '\n') - buf[--n] = '\0'; - in = buf; - - /* skip comments */ - if (*in == '#') - continue; - - /* skip empty lines. If we are in a rule, end the rule. */ - while (*in && isspace(*in)) - in++; - if (*in == '\0') { - if (inrule) { - /* End the rule : leaf or non-leaf */ - if (leaf) - ProcessCategoryLeafRule(&rule, &g->mCategoryRoot, g); - else - /* non-leaf */ - ProcessCategoryParentRule(&rule, &g->mCategoryRoot, g); - inrule = PR_FALSE; - memset(&rule, 0, sizeof(rule)); - } - continue; - } - - /* if we are in a rule acculumate */ - if (inrule) { - rule.pats[rule.npats] = strdup(in); - rule.patlen[rule.npats++] = strlen(in); - } - else if (*in == '<') { - /* Start a category */ - inrule = PR_TRUE; - leaf = PR_TRUE; - - /* Get the category name */ - in++; - n = strlen(in); - if (in[n - 1] == '>') - in[n - 1] = '\0'; - rule.categoryName = strdup(in); - } - else { - /* this is a non-leaf category. Should be of the form CategoryName - ** followed by list of child category names one per line - */ - inrule = PR_TRUE; - leaf = PR_FALSE; - rule.categoryName = strdup(in); - } - } - - /* If we were in a rule when processing the last line, end the rule */ - if (inrule) { - /* End the rule : leaf or non-leaf */ - if (leaf) - ProcessCategoryLeafRule(&rule, &g->mCategoryRoot, g); - else - /* non-leaf */ - ProcessCategoryParentRule(&rule, &g->mCategoryRoot, g); - } - - /* Add the final "uncategorized" category. We make new memory locations - ** for all these to conform to the general principle of all strings are allocated - ** so it makes release logic very simple. - */ - memset(&rule, 0, sizeof(rule)); - rule.categoryName = strdup("uncategorized"); - rule.pats[0] = strdup(""); - rule.patlen[0] = 0; - rule.npats = 1; - ProcessCategoryLeafRule(&rule, &g->mCategoryRoot, g); - - return 0; -} - -/* -** callsiteMatchesRule -** -** Returns the corresponding node if callsite matches the rule. Rule is a sequence -** of patterns that must match contiguously the callsite. -*/ -int -callsiteMatchesRule(tmcallsite * aCallsite, STCategoryRule * aRule) -{ - PRUint32 patnum = 0; - const char *methodName = NULL; - - while (patnum < aRule->npats && aCallsite && aCallsite->method) { - methodName = tmmethodnode_name(aCallsite->method); - if (!methodName) - return 0; - if (!*aRule->pats[patnum] - || !strncmp(methodName, aRule->pats[patnum], - aRule->patlen[patnum])) { - /* We have matched so far. Proceed up the stack and to the next pattern */ - patnum++; - aCallsite = aCallsite->parent; - } - else { - /* Deal with mismatch */ - if (patnum > 0) { - /* contiguous mismatch. Stop */ - return 0; - } - /* We still haven't matched the first pattern. Proceed up the stack without - ** moving to the next pattern. - */ - aCallsite = aCallsite->parent; - } - } - - if (patnum == aRule->npats) { - /* all patterns matched. We have a winner. */ -#if defined(DEBUG_dp) && 0 - fprintf(stderr, "[%s] match\n", aRule->categoryName); -#endif - return 1; - } - - return 0; -} - -#ifdef DEBUG_dp -PRIntervalTime _gMatchTime = 0; -PRUint32 _gMatchCount = 0; -PRUint32 _gMatchRules = 0; -#endif - -/* -** matchAllocation -** -** Runs through all rules and returns the node corresponding to -** a match of the allocation. -*/ -STCategoryNode * -matchAllocation(STGlobals * g, STAllocation * aAllocation) -{ -#ifdef DEBUG_dp - PRIntervalTime start = PR_IntervalNow(); -#endif - PRUint32 rulenum; - STCategoryNode *node = NULL; - STCategoryRule *rule; - - for (rulenum = 0; rulenum < g->mNRules; rulenum++) { -#ifdef DEBUG_dp - _gMatchRules++; -#endif - rule = g->mCategoryRules[rulenum]; - if (callsiteMatchesRule(aAllocation->mEvents[0].mCallsite, rule)) { - node = rule->node; - break; - } - } -#ifdef DEBUG_dp - _gMatchCount++; - _gMatchTime += PR_IntervalNow() - start; -#endif - return node; -} - -/* -** categorizeAllocation -** -** Given an allocation, it adds it into the category tree at the right spot -** by comparing the allocation to the rules and adding into the right node. -** Also, does propogation of cost upwards in the tree. -** The root of the tree is in the globls as the tree is dependent on the -** category file (options) rather than the run. -*/ -int -categorizeAllocation(STOptions * inOptions, STContext * inContext, - STAllocation * aAllocation, STGlobals * g) -{ - /* Run through the rules in order to see if this allcation matches - ** any of them. - */ - STCategoryNode *node; - - node = matchAllocation(g, aAllocation); - if (!node) { - /* ugh! it should atleast go into the "uncategorized" node. wierd! - */ - REPORT_ERROR(__LINE__, categorizeAllocation); - return -1; - } - - /* Create run for node if not already */ - if (!node->runs[inContext->mIndex]) { - /* - ** Create run with positive timestamp as we can harvest it later - ** for callsite details summarization - */ - node->runs[inContext->mIndex] = - createRun(inContext, PR_IntervalNow()); - if (!node->runs[inContext->mIndex]) { - REPORT_ERROR(__LINE__, categorizeAllocation_No_Memory); - return -1; - } - } - - /* Add allocation into node. We expand the table of allocations in steps */ - if (node->runs[inContext->mIndex]->mAllocationCount % ST_ALLOC_STEP == 0) { - /* Need more space */ - STAllocation **allocs; - - allocs = - (STAllocation **) realloc(node->runs[inContext->mIndex]-> - mAllocations, - (node->runs[inContext->mIndex]-> - mAllocationCount + - ST_ALLOC_STEP) * - sizeof(STAllocation *)); - if (!allocs) { - REPORT_ERROR(__LINE__, categorizeAllocation_No_Memory); - return -1; - } - node->runs[inContext->mIndex]->mAllocations = allocs; - } - node->runs[inContext->mIndex]->mAllocations[node-> - runs[inContext->mIndex]-> - mAllocationCount++] = - aAllocation; - - /* - ** Make sure run's stats are calculated. We dont go update the parents of allocation - ** at this time. That will happen when we focus on this category. This updating of - ** stats will provide us fast categoryreports. - */ - recalculateAllocationCost(inOptions, inContext, - node->runs[inContext->mIndex], aAllocation, - PR_FALSE); - - /* Propogate upwards the statistics */ - /* XXX */ -#if defined(DEBUG_dp) && 0 - fprintf(stderr, "DEBUG: [%s] match\n", node->categoryName); -#endif - return 0; -} - -typedef PRBool STCategoryNodeProcessor(STRequest * inRequest, - STOptions * inOptions, - STContext * inContext, - void *clientData, - STCategoryNode * node); - -PRBool -freeNodeRunProcessor(STRequest * inRequest, STOptions * inOptions, - STContext * inContext, void *clientData, - STCategoryNode * node) -{ - if (node->runs && node->runs[inContext->mIndex]) { - freeRun(node->runs[inContext->mIndex]); - node->runs[inContext->mIndex] = NULL; - } - return PR_TRUE; -} - -PRBool -freeNodeRunsProcessor(STRequest * inRequest, STOptions * inOptions, - STContext * inContext, void *clientData, - STCategoryNode * node) -{ - if (node->runs) { - PRUint32 loop = 0; - - for (loop = 0; loop < globals.mCommandLineOptions.mContexts; loop++) { - if (node->runs[loop]) { - freeRun(node->runs[loop]); - node->runs[loop] = NULL; - } - } - - free(node->runs); - node->runs = NULL; - } - - return PR_TRUE; -} - -#if defined(DEBUG_dp) -PRBool -printNodeProcessor(STRequest * inRequest, STOptions * inOptions, - STContext * inContext, void *clientData, - STCategoryNode * node) -{ - STCategoryNode *root = (STCategoryNode *) clientData; - - fprintf(stderr, "%-25s [ %9s size", node->categoryName, - FormatNumber(node->run ? node->run->mStats[inContext->mIndex]. - mSize : 0)); - fprintf(stderr, ", %5.1f%%", - node->run ? ((double) node->run->mStats[inContext->mIndex].mSize / - root->run->mStats[inContext->mIndex].mSize * - 100) : 0); - fprintf(stderr, ", %7s allocations ]\n", - FormatNumber(node->run ? node->run->mStats[inContext->mIndex]. - mCompositeCount : 0)); - return PR_TRUE; -} - -#endif - -typedef struct __struct_optcon -{ - STOptions *mOptions; - STContext *mContext; -} -optcon; - -/* -** compareNode -** -** qsort callback. -** Compare the nodes as specified by the options. -*/ -int -compareNode(const void *aNode1, const void *aNode2, void *aContext) -{ - int retval = 0; - STCategoryNode *node1, *node2; - PRUint32 a, b; - optcon *oc = (optcon *) aContext; - - if (!aNode1 || !aNode2 || !oc->mOptions || !oc->mContext) - return 0; - - node1 = *((STCategoryNode **) aNode1); - node2 = *((STCategoryNode **) aNode2); - - if (node1 && node2) { - if (oc->mOptions->mOrderBy == ST_COUNT) { - a = (node1->runs[oc->mContext->mIndex]) ? node1->runs[oc-> - mContext-> - mIndex]-> - mStats[oc->mContext->mIndex].mCompositeCount : 0; - b = (node2->runs[oc->mContext->mIndex]) ? node2->runs[oc-> - mContext-> - mIndex]-> - mStats[oc->mContext->mIndex].mCompositeCount : 0; - } - else { - /* Default is by size */ - a = (node1->runs[oc->mContext->mIndex]) ? node1->runs[oc-> - mContext-> - mIndex]-> - mStats[oc->mContext->mIndex].mSize : 0; - b = (node2->runs[oc->mContext->mIndex]) ? node2->runs[oc-> - mContext-> - mIndex]-> - mStats[oc->mContext->mIndex].mSize : 0; - } - if (a < b) - retval = __LINE__; - else - retval = -__LINE__; - } - return retval; -} - -PRBool -sortNodeProcessor(STRequest * inRequest, STOptions * inOptions, - STContext * inContext, void *clientData, - STCategoryNode * node) -{ - if (node->nchildren) { - optcon context; - - context.mOptions = inOptions; - context.mContext = inContext; - - NS_QuickSort(node->children, node->nchildren, - sizeof(STCategoryNode *), compareNode, &context); - } - - return PR_TRUE; -} - - -/* -** walkTree -** -** General purpose tree walker. Issues callback for each node. -** If 'maxdepth' > 0, then stops after processing that depth. Root is -** depth 0, the nodes below it are depth 1 etc... -*/ -#define MODINC(n, mod) ((n+1) % mod) - -void -walkTree(STCategoryNode * root, STCategoryNodeProcessor func, - STRequest * inRequest, STOptions * inOptions, STContext * inContext, - void *clientData, int maxdepth) -{ - STCategoryNode *nodes[1024], *node; - PRUint32 begin, end, i; - int ret = 0; - int curdepth = 0, ncurdepth = 0; - - nodes[0] = root; - begin = 0; - end = 1; - ncurdepth = 1; - while (begin != end) { - node = nodes[begin]; - ret = (*func) (inRequest, inOptions, inContext, clientData, node); - if (ret == PR_FALSE) { - /* Abort */ - break; - } - begin = MODINC(begin, 1024); - for (i = 0; i < node->nchildren; i++) { - nodes[end] = node->children[i]; - end = MODINC(end, 1024); - } - /* Depth tracking. Do it only if walkTree is contrained by a maxdepth */ - if (maxdepth > 0 && --ncurdepth == 0) { - /* - ** No more children in current depth. The rest of the nodes - ** we have in our list should be nodes in the depth below us. - */ - ncurdepth = (begin < end) ? (end - begin) : (1024 - begin + end); - if (++curdepth > maxdepth) { - /* - ** Gone too deep. Stop. - */ - break; - } - } - } - return; -} - -int -freeRule(STCategoryRule * rule) -{ - PRUint32 i; - char *p = (char *) rule->categoryName; - - PR_FREEIF(p); - - for (i = 0; i < rule->npats; i++) - free(rule->pats[i]); - - free(rule); - return 0; -} - -void -freeNodeRuns(STCategoryNode * root) -{ - walkTree(root, freeNodeRunsProcessor, NULL, NULL, NULL, NULL, 0); -} - -void -freeNodeMap(STGlobals * g) -{ - PRUint32 i; - - /* all nodes are in the map table. Just delete all of those. */ - for (i = 0; i < g->mNCategoryMap; i++) { - free(g->mCategoryMap[i]->node); - free(g->mCategoryMap[i]); - } - free(g->mCategoryMap); -} - -int -freeCategories(STGlobals * g) -{ - PRUint32 i; - - /* - ** walk the tree and free runs held in nodes - */ - freeNodeRuns(&g->mCategoryRoot); - - /* - ** delete nodemap. This is the where nodes get deleted. - */ - freeNodeMap(g); - - /* - ** delete rule stuff - */ - for (i = 0; i < g->mNRules; i++) { - freeRule(g->mCategoryRules[i]); - } - free(g->mCategoryRules); - - return 0; -} - - -/* -** categorizeRun -** -** categorize all the allocations of the run using the rules into -** a tree rooted at globls.mCategoryRoot -*/ -int -categorizeRun(STOptions * inOptions, STContext * inContext, - const STRun * aRun, STGlobals * g) -{ - PRUint32 i; - -#if defined(DEBUG_dp) - PRIntervalTime start = PR_IntervalNow(); - - fprintf(stderr, "DEBUG: categorizing run...\n"); -#endif - - /* - ** First, cleanup our tree - */ - walkTree(&g->mCategoryRoot, freeNodeRunProcessor, NULL, inOptions, - inContext, NULL, 0); - - if (g->mNCategoryMap > 0) { - for (i = 0; i < aRun->mAllocationCount; i++) { - categorizeAllocation(inOptions, inContext, aRun->mAllocations[i], - g); - } - } - - /* - ** the run is always going to be the one corresponding to the root node - */ - g->mCategoryRoot.runs[inContext->mIndex] = (STRun *) aRun; - g->mCategoryRoot.categoryName = ST_ROOT_CATEGORY_NAME; - -#if defined(DEBUG_dp) - fprintf(stderr, - "DEBUG: categorizing ends: %dms [%d rules, %d allocations]\n", - PR_IntervalToMilliseconds(PR_IntervalNow() - start), g->mNRules, - aRun->mAllocationCount); - fprintf(stderr, "DEBUG: match : %dms [%d calls, %d rule-compares]\n", - PR_IntervalToMilliseconds(_gMatchTime), _gMatchCount, - _gMatchRules); -#endif - - /* - ** sort the tree based on our sort criterion - */ - walkTree(&g->mCategoryRoot, sortNodeProcessor, NULL, inOptions, inContext, - NULL, 0); - -#if defined(DEBUG_dp) - walkTree(&g->mCategoryRoot, printNodeProcessor, NULL, inOptions, - inContext, &g->mCategoryRoot, 0); -#endif - - return 0; -} - - -/* -** displayCategoryReport -** -** Generate the category report - a list of all categories and details about each -** depth parameter controls how deep we traverse the category tree. -*/ -PRBool -displayCategoryNodeProcessor(STRequest * inRequest, STOptions * inOptions, - STContext * inContext, void *clientData, - STCategoryNode * node) -{ - STCategoryNode *root = (STCategoryNode *) clientData; - PRUint32 byteSize = 0, heapCost = 0, count = 0; - double percent = 0; - STOptions customOps; - - if (node->runs[inContext->mIndex]) { - /* - ** Byte size - */ - byteSize = - node->runs[inContext->mIndex]->mStats[inContext->mIndex].mSize; - - /* - ** Composite count - */ - count = - node->runs[inContext->mIndex]->mStats[inContext->mIndex]. - mCompositeCount; - - /* - ** Heap operation cost - **/ - heapCost = - node->runs[inContext->mIndex]->mStats[inContext->mIndex]. - mHeapRuntimeCost; - - /* - ** % of total size - */ - if (root->runs[inContext->mIndex]) { - percent = - ((double) byteSize) / - root->runs[inContext->mIndex]->mStats[inContext->mIndex]. - mSize * 100; - } - } - - PR_fprintf(inRequest->mFD, " \n" " "); - - /* a link to topcallsites report with focus on category */ - memcpy(&customOps, inOptions, sizeof(customOps)); - PR_snprintf(customOps.mCategoryName, sizeof(customOps.mCategoryName), - "%s", node->categoryName); - - htmlAnchor(inRequest, "top_callsites.html", node->categoryName, NULL, - "category-callsites", &customOps); - PR_fprintf(inRequest->mFD, - "\n" " %u\n" - " %4.1f%%\n" - " %u\n" " " - ST_MICROVAL_FORMAT "\n" " \n", byteSize, percent, - count, ST_MICROVAL_PRINTABLE(heapCost)); - - return PR_TRUE; -} - - -int -displayCategoryReport(STRequest * inRequest, STCategoryNode * root, int depth) -{ - PR_fprintf(inRequest->mFD, - "\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" " \n"); - - walkTree(root, displayCategoryNodeProcessor, inRequest, - &inRequest->mOptions, inRequest->mContext, root, depth); - - PR_fprintf(inRequest->mFD, "
CategoryComposite Byte Size%% of Total SizeHeap Object CountComposite Heap Operations Seconds
\n"); - - return 0; -} diff --git a/mozilla/tools/trace-malloc/spacetrace.c b/mozilla/tools/trace-malloc/spacetrace.c deleted file mode 100644 index 534910bd035..00000000000 --- a/mozilla/tools/trace-malloc/spacetrace.c +++ /dev/null @@ -1,6430 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is spacetrace.h/spacetrace.c code, released - * Nov 6, 2001. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Garrett Arch Blythe, 31-October-2001 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* -** spacetrace.c -** -** SpaceTrace is meant to take the output of trace-malloc and present -** a picture of allocations over the run of the application. -*/ - -/* -** Required include files. -*/ -#include "spacetrace.h" - -#include -#include -#include -#include -#if defined(XP_WIN32) -#include /* _heapMin */ -#endif - -#if defined(HAVE_BOUTELL_GD) -/* -** See http://www.boutell.com/gd for the GD graphics library. -** Ports for many platorms exist. -** Your box may already have the lib (mine did, redhat 7.1 workstation). -*/ -#include -#include -#include -#include -#endif /* HAVE_BOUTELL_GD */ - -/* -** Ugh, MSVC6's qsort is too slow... -*/ -#include "nsQuickSort.h" -#include "prlong.h" -/* -** strcasecmp API please. -*/ -#if defined(_MSC_VER) -#define strcasecmp _stricmp -#define strncasecmp _strnicmp -#endif - -/* -** the globals variables. happy joy. -*/ -STGlobals globals; - -/* -** have the heap cleanup at opportune times, if possible. -*/ -void -heapCompact(void) -{ -#if defined(XP_WIN32) - _heapmin(); -#endif -} - -#define ST_CMD_OPTION_BOOL(option_name, option_genre, option_help) \ - PR_fprintf(PR_STDOUT, "--%s\nDisabled by default.\n%s\n", #option_name, option_help); -#define ST_CMD_OPTION_STRING(option_name, option_genre, default_value, option_help) \ - PR_fprintf(PR_STDOUT, "--%s=\nDefault value is \"%s\".\n%s\n", #option_name, default_value, option_help); -#define ST_CMD_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) \ - PR_fprintf(PR_STDOUT, "--%s=\nUp to %u occurrences allowed.\n%s\n", #option_name, array_size, option_help); -#define ST_CMD_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) \ - PR_fprintf(PR_STDOUT, "--%s=\nUnlimited occurrences allowed.\n%s\n", #option_name, option_help); -#define ST_CMD_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) \ - PR_fprintf(PR_STDOUT, "--%s=\nDefault value is %u.\n%s\n", #option_name, default_value, option_help); -#define ST_CMD_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) \ - PR_fprintf(PR_STDOUT, "--%s=\nDefault value is %llu.\n%s\n", #option_name, default_value, option_help); - -/* -** showHelp -** -** Give simple command line help. -** Returns !0 if the help was showed. -*/ -int -showHelp(void) -{ - int retval = 0; - - if (PR_FALSE != globals.mCommandLineOptions.mHelp) { - PR_fprintf(PR_STDOUT, "Usage:\t%s [OPTION]... [-|filename]\n\n", - globals.mProgramName); - - -#include "stoptions.h" - - /* - ** Showed something. - */ - retval = __LINE__; - } - - return retval; -} - -/* -** ticks2xsec -** -** Convert platform specific ticks to second units -** Returns 0 on success. -*/ -PRUint32 -ticks2xsec(tmreader * aReader, PRUint32 aTicks, PRUint32 aResolution) -{ - PRUint32 retval = 0; - PRUint64 bigone; - PRUint64 tmp64; - - LL_UI2L(bigone, aResolution); - LL_UI2L(tmp64, aTicks); - LL_MUL(bigone, bigone, tmp64); - LL_UI2L(tmp64, aReader->ticksPerSec); - LL_DIV(bigone, bigone, tmp64); - LL_L2UI(retval, bigone); - return retval; -} - -#define ticks2msec(reader, ticks) ticks2xsec((reader), (ticks), 1000) -#define ticks2usec(reader, ticks) ticks2xsec((reader), (ticks), 1000000) - -/* -** initOptions -** -** Determine global settings for the application. -** Returns 0 on success. -*/ -int -initOptions(int aArgCount, char **aArgArray) -{ - int retval = 0; - int traverse = 0; - - /* - ** Set the initial global default options. - */ -#define ST_CMD_OPTION_BOOL(option_name, option_genre, option_help) globals.mCommandLineOptions.m##option_name = PR_FALSE; -#define ST_CMD_OPTION_STRING(option_name, option_genre, default_value, option_help) PR_snprintf(globals.mCommandLineOptions.m##option_name, sizeof(globals.mCommandLineOptions.m##option_name), "%s", default_value); -#define ST_CMD_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) { int loop; for(loop = 0; loop < array_size; loop++) { globals.mCommandLineOptions.m##option_name[loop][0] = '\0'; } } -#define ST_CMD_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) globals.mCommandLineOptions.m##option_name = NULL; globals.mCommandLineOptions.m##option_name##Count = 0; -#define ST_CMD_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) globals.mCommandLineOptions.m##option_name = default_value * multiplier; -#define ST_CMD_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) { PRUint64 def64 = default_value; PRUint64 mul64 = multiplier; LL_MUL(globals.mCommandLineOptions.m##option_name##64, def64, mul64); } - -#include "stoptions.h" - - /* - ** Go through all arguments. - ** Two dashes lead off an option. - ** Any single dash leads off help, unless it is a lone dash (stdin). - ** Anything else will be attempted as a file to be processed. - */ - for (traverse = 1; traverse < aArgCount; traverse++) { - if ('-' == aArgArray[traverse][0] && '-' == aArgArray[traverse][1]) { - const char *option = &aArgArray[traverse][2]; - - /* - ** Initial if(0) needed to make "else if"s valid. - */ - if (0) { - } - -#define ST_CMD_OPTION_BOOL(option_name, option_genre, option_help) \ - else if(0 == strcasecmp(option, #option_name)) \ - { \ - globals.mCommandLineOptions.m##option_name = PR_TRUE; \ - } -#define ST_CMD_OPTION_STRING(option_name, option_genre, default_value, option_help) \ - else if(0 == strncasecmp(option, #option_name "=", strlen(#option_name "="))) \ - { \ - PR_snprintf(globals.mCommandLineOptions.m##option_name, sizeof(globals.mCommandLineOptions.m##option_name), "%s", option + strlen(#option_name "=")); \ - } -#define ST_CMD_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) \ - else if(0 == strncasecmp(option, #option_name "=", strlen(#option_name "="))) \ - { \ - int arrLoop = 0; \ - \ - for(arrLoop = 0; arrLoop < array_size; arrLoop++) \ - { \ - if('\0' == globals.mCommandLineOptions.m##option_name[arrLoop][0]) \ - { \ - break; \ - } \ - }\ - \ - if(arrLoop != array_size) \ - { \ - PR_snprintf(globals.mCommandLineOptions.m##option_name[arrLoop], sizeof(globals.mCommandLineOptions.m##option_name[arrLoop]), "%s", option + strlen(#option_name "=")); \ - } \ - else \ - { \ - REPORT_ERROR_MSG(__LINE__, option); \ - retval = __LINE__; \ - globals.mCommandLineOptions.mHelp = PR_TRUE; \ - } \ - } -#define ST_CMD_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) \ - else if(0 == strncasecmp(option, #option_name "=", strlen(#option_name "="))) \ - { \ - const char** expand = NULL; \ - \ - expand = (const char**)realloc((void*)globals.mCommandLineOptions.m##option_name, sizeof(const char*) * (globals.mCommandLineOptions.m##option_name##Count + 1)); \ - if(NULL != expand) \ - { \ - globals.mCommandLineOptions.m##option_name = expand; \ - globals.mCommandLineOptions.m##option_name[globals.mCommandLineOptions.m##option_name##Count] = option + strlen(#option_name "="); \ - globals.mCommandLineOptions.m##option_name##Count++; \ - } \ - else \ - { \ - retval = __LINE__; \ - globals.mCommandLineOptions.mHelp = PR_TRUE; \ - } \ - } -#define ST_CMD_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) \ - else if(0 == strncasecmp(option, #option_name "=", strlen(#option_name "="))) \ - { \ - PRInt32 scanRes = 0; \ - \ - scanRes = PR_sscanf(option + strlen(#option_name "="), "%u", &globals.mCommandLineOptions.m##option_name); \ - if(1 != scanRes) \ - { \ - REPORT_ERROR_MSG(__LINE__, option); \ - retval = __LINE__; \ - globals.mCommandLineOptions.mHelp = PR_TRUE; \ - } \ - } -#define ST_CMD_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) \ - else if(0 == strncasecmp(option, #option_name "=", strlen(#option_name "="))) \ - { \ - PRInt32 scanRes = 0; \ - \ - scanRes = PR_sscanf(option + strlen(#option_name "="), "%llu", &globals.mCommandLineOptions.m##option_name##64); \ - if(1 != scanRes) \ - { \ - REPORT_ERROR_MSG(__LINE__, option); \ - retval = __LINE__; \ - globals.mCommandLineOptions.mHelp = PR_TRUE; \ - } \ - } - -#include "stoptions.h" - - /* - ** If no match on options, this else will get hit. - */ - else { - REPORT_ERROR_MSG(__LINE__, option); - retval = __LINE__; - globals.mCommandLineOptions.mHelp = PR_TRUE; - } - } - else if ('-' == aArgArray[traverse][0] - && '\0' != aArgArray[traverse][1]) { - /* - ** Show help, bad/legacy option. - */ - REPORT_ERROR_MSG(__LINE__, aArgArray[traverse]); - retval = __LINE__; - globals.mCommandLineOptions.mHelp = PR_TRUE; - } - else { - /* - ** Default is same as FileName option, the file to process. - */ - PR_snprintf(globals.mCommandLineOptions.mFileName, - sizeof(globals.mCommandLineOptions.mFileName), "%s", - aArgArray[traverse]); - } - } - - /* - ** initalize the categories - */ - initCategories(&globals); - - return retval; -} - -#if ST_WANT_GRAPHS -/* -** createGraph -** -** Create a GD image with the common properties of a graph. -** Upon return, you normally allocate legend colors, -** draw your graph inside the region -** STGD_MARGIN,STGD_MARGIN,STGD_WIDTH-STGD_MARGIN,STGD_HEIGH-STGD_MARGIN, -** and then call drawGraph to format the surrounding information. -** -** You should use the normal GD image release function, gdImageDestroy -** when done with it. -** -** Image attributes: -** STGD_WIDTHxSTGD_HEIGHT -** trasparent (white) background -** incremental display -*/ -gdImagePtr -createGraph(int *aTransparencyColor) -{ - gdImagePtr retval = NULL; - - if (NULL != aTransparencyColor) { - *aTransparencyColor = -1; - - retval = gdImageCreate(STGD_WIDTH, STGD_HEIGHT); - if (NULL != retval) { - /* - ** Background color (first one). - */ - *aTransparencyColor = gdImageColorAllocate(retval, 255, 255, 255); - if (-1 != *aTransparencyColor) { - /* - ** As transparency. - */ - gdImageColorTransparent(retval, *aTransparencyColor); - } - - /* - ** And to set interlacing. - */ - gdImageInterlace(retval, 1); - } - else { - REPORT_ERROR(__LINE__, gdImageCreate); - } - } - else { - REPORT_ERROR(__LINE__, createGraph); - } - - return retval; -} -#endif /* ST_WANT_GRAPHS */ - -#if ST_WANT_GRAPHS -/* -** drawGraph -** -** This function mainly exists to simplify putitng all the pretty lace -** around a home made graph. -*/ -void -drawGraph(gdImagePtr aImage, int aColor, - const char *aGraphTitle, - const char *aXAxisTitle, - const char *aYAxisTitle, - PRUint32 aXMarkCount, - PRUint32 * aXMarkPercents, - const char **aXMarkTexts, - PRUint32 aYMarkCount, - PRUint32 * aYMarkPercents, - const char **aYMarkTexts, - PRUint32 aLegendCount, - int *aLegendColors, const char **aLegendTexts) -{ - if (NULL != aImage && NULL != aGraphTitle && - NULL != aXAxisTitle && NULL != aYAxisTitle && - (0 == aXMarkCount || (NULL != aXMarkPercents && NULL != aXMarkTexts)) - && (0 == aYMarkCount - || (NULL != aYMarkPercents && NULL != aYMarkTexts)) - && (0 == aLegendCount - || (NULL != aLegendColors && NULL != aLegendTexts))) { - int margin = 1; - PRUint32 traverse = 0; - PRUint32 target = 0; - const int markSize = 2; - int x1 = 0; - int y1 = 0; - int x2 = 0; - int y2 = 0; - time_t theTimeT = time(NULL); - char *theTime = ctime(&theTimeT); - const char *logo = "SpaceTrace"; - gdFontPtr titleFont = gdFontMediumBold; - gdFontPtr markFont = gdFontTiny; - gdFontPtr dateFont = gdFontTiny; - gdFontPtr axisFont = gdFontSmall; - gdFontPtr legendFont = gdFontTiny; - gdFontPtr logoFont = gdFontTiny; - - /* - ** Fixup the color. - ** Black by default. - */ - if (-1 == aColor) { - aColor = gdImageColorAllocate(aImage, 0, 0, 0); - } - if (-1 == aColor) { - aColor = gdImageColorClosest(aImage, 0, 0, 0); - } - - /* - ** Output the box. - */ - x1 = STGD_MARGIN - margin; - y1 = STGD_MARGIN - margin; - x2 = STGD_WIDTH - x1; - y2 = STGD_HEIGHT - y1; - gdImageRectangle(aImage, x1, y1, x2, y2, aColor); - margin++; - - /* - ** Need to make small markings on the graph to indicate where the - ** labels line up exactly. - ** While we're at it, draw the label text. - */ - for (traverse = 0; traverse < aXMarkCount; traverse++) { - target = - ((STGD_WIDTH - - (STGD_MARGIN * 2)) * aXMarkPercents[traverse]) / 100; - - x1 = STGD_MARGIN + target; - y1 = STGD_MARGIN - margin; - x2 = x1; - y2 = y1 - markSize; - gdImageLine(aImage, x1, y1, x2, y2, aColor); - - y1 = STGD_HEIGHT - y1; - y2 = STGD_HEIGHT - y2; - gdImageLine(aImage, x1, y1, x2, y2, aColor); - - if (NULL != aXMarkTexts[traverse]) { - x1 = STGD_MARGIN + target - (markFont->h / 2); - y1 = STGD_HEIGHT - STGD_MARGIN + margin + markSize + - (strlen(aXMarkTexts[traverse]) * markFont->w); - gdImageStringUp(aImage, markFont, x1, y1, - (unsigned char *) aXMarkTexts[traverse], - aColor); - } - } - for (traverse = 0; traverse < aYMarkCount; traverse++) { - target = - ((STGD_HEIGHT - (STGD_MARGIN * 2)) * (100 - - aYMarkPercents - [traverse])) / 100; - - x1 = STGD_MARGIN - margin; - y1 = STGD_MARGIN + target; - x2 = x1 - markSize; - y2 = y1; - gdImageLine(aImage, x1, y1, x2, y2, aColor); - - x1 = STGD_WIDTH - x1; - x2 = STGD_WIDTH - x2; - gdImageLine(aImage, x1, y1, x2, y2, aColor); - - if (NULL != aYMarkTexts[traverse]) { - x1 = STGD_MARGIN - margin - markSize - - (strlen(aYMarkTexts[traverse]) * markFont->w); - y1 = STGD_MARGIN + target - (markFont->h / 2); - gdImageString(aImage, markFont, x1, y1, - (unsigned char *) aYMarkTexts[traverse], - aColor); - } - } - margin += markSize; - - /* - ** Title will be centered above the image. - */ - x1 = (STGD_WIDTH / 2) - ((strlen(aGraphTitle) * titleFont->w) / 2); - y1 = ((STGD_MARGIN - margin) / 2) - (titleFont->h / 2); - gdImageString(aImage, titleFont, x1, y1, - (unsigned char *) aGraphTitle, aColor); - - /* - ** Upper left will be the date. - */ - x1 = 0; - y1 = 0; - traverse = strlen(theTime) - 1; - if (isspace(theTime[traverse])) { - theTime[traverse] = '\0'; - } - gdImageString(aImage, dateFont, x1, y1, (unsigned char *) theTime, - aColor); - - /* - ** Lower right will be the logo. - */ - x1 = STGD_WIDTH - (strlen(logo) * logoFont->w); - y1 = STGD_HEIGHT - logoFont->h; - gdImageString(aImage, logoFont, x1, y1, (unsigned char *) logo, - aColor); - - /* - ** X and Y axis titles - */ - x1 = (STGD_WIDTH / 2) - ((strlen(aXAxisTitle) * axisFont->w) / 2); - y1 = STGD_HEIGHT - axisFont->h; - gdImageString(aImage, axisFont, x1, y1, (unsigned char *) aXAxisTitle, - aColor); - x1 = 0; - y1 = (STGD_HEIGHT / 2) + ((strlen(aYAxisTitle) * axisFont->w) / 2); - gdImageStringUp(aImage, axisFont, x1, y1, - (unsigned char *) aYAxisTitle, aColor); - - /* - ** The legend. - ** Centered on the right hand side, going up. - */ - x1 = STGD_WIDTH - STGD_MARGIN + margin + - (aLegendCount * legendFont->h) / 2; - x2 = STGD_WIDTH - (aLegendCount * legendFont->h); - if (x1 > x2) { - x1 = x2; - } - - y1 = 0; - for (traverse = 0; traverse < aLegendCount; traverse++) { - y2 = (STGD_HEIGHT / 2) + - ((strlen(aLegendTexts[traverse]) * legendFont->w) / 2); - if (y2 > y1) { - y1 = y2; - } - } - for (traverse = 0; traverse < aLegendCount; traverse++) { - gdImageStringUp(aImage, legendFont, x1, y1, - (unsigned char *) aLegendTexts[traverse], - aLegendColors[traverse]); - x1 += legendFont->h; - } - } -} - -#endif /* ST_WANT_GRAPHS */ - -#if defined(HAVE_BOUTELL_GD) -/* -** pngSink -** -** GD callback, used to write out the png. -*/ -int -pngSink(void *aContext, const char *aBuffer, int aLen) -{ - return PR_Write((PRFileDesc *) aContext, aBuffer, aLen); -} -#endif /* HAVE_BOUTELL_GD */ - -/* -** FormatNumber -** -** Formats a number with thousands separator. Dont free the result. Returns -** static data. -*/ -char * -FormatNumber(PRInt32 num) -{ - static char buf[64]; - char tmpbuf[64]; - int len = 0; - int bufindex = sizeof(buf) - 1; - int mod3; - - PR_snprintf(tmpbuf, sizeof(tmpbuf), "%d", num); - - /* now insert the thousands separator */ - mod3 = 0; - len = strlen(tmpbuf); - while (len >= 0) { - if (tmpbuf[len] >= '0' && tmpbuf[len] <= '9') { - if (mod3 == 3) { - buf[bufindex--] = ','; - mod3 = 0; - } - mod3++; - } - buf[bufindex--] = tmpbuf[len--]; - } - return buf + bufindex + 1; -} - -/* -** actualByteSize -** -** Apply alignment and overhead to size to figure out actual byte size -*/ -PRUint32 -actualByteSize(STOptions * inOptions, PRUint32 retval) -{ - /* - ** Need to bump the result by our alignment and overhead. - ** The idea here is that an allocation actually costs you more than you - ** thought. - ** - ** The msvcrt malloc has an alignment of 16 with an overhead of 8. - ** The win32 HeapAlloc has an alignment of 8 with an overhead of 8. - */ - if (0 != retval) { - PRUint32 eval = 0; - PRUint32 over = 0; - - eval = retval - 1; - if (0 != inOptions->mAlignBy) { - over = eval % inOptions->mAlignBy; - } - retval = eval + inOptions->mOverhead + inOptions->mAlignBy - over; - } - - return retval; -} - -/* -** byteSize -** -** Figuring the byte size of an allocation. -** Might expand in the future to report size at a given time. -** For now, just use last relevant event. -*/ -PRUint32 -byteSize(STOptions * inOptions, STAllocation * aAlloc) -{ - PRUint32 retval = 0; - - if (NULL != aAlloc && 0 != aAlloc->mEventCount) { - PRUint32 index = aAlloc->mEventCount; - - /* - ** Generally, the size is the last event's size. - */ - do { - index--; - retval = aAlloc->mEvents[index].mHeapSize; - } - while (0 == retval && 0 != index); - } - return actualByteSize(inOptions, retval); -} - - -/* -** recalculateAllocationCost -** -** Given an allocation, does a recalculation of Cost - weight, heapcount etc. -** and does the right thing to propogate the cost upwards. -*/ -int -recalculateAllocationCost(STOptions * inOptions, STContext * inContext, - STRun * aRun, STAllocation * aAllocation, - PRBool updateParent) -{ - /* - ** Now, see if they desire a callsite update. - ** As mentioned previously, we decide if the run desires us to - ** manipulate the callsite data only if it's stamp is set. - ** We change all callsites and parent callsites to have that - ** stamp as well, so as to mark them as being relevant to - ** the current run in question. - */ - if (NULL != inContext && 0 != aRun->mStats[inContext->mIndex].mStamp) { - PRUint32 timeval = - aAllocation->mMaxTimeval - aAllocation->mMinTimeval; - PRUint32 size = byteSize(inOptions, aAllocation); - PRUint64 weight64 = LL_INIT(0, 0); - PRUint32 heapCost = aAllocation->mHeapRuntimeCost; - PRUint64 timeval64 = LL_INIT(0, 0); - PRUint64 size64 = LL_INIT(0, 0); - - LL_UI2L(timeval64, timeval); - LL_UI2L(size64, size); - LL_MUL(weight64, timeval64, size64); - - /* - ** First, update this run. - */ - aRun->mStats[inContext->mIndex].mCompositeCount++; - aRun->mStats[inContext->mIndex].mHeapRuntimeCost += heapCost; - aRun->mStats[inContext->mIndex].mSize += size; - LL_ADD(aRun->mStats[inContext->mIndex].mTimeval64, - aRun->mStats[inContext->mIndex].mTimeval64, timeval64); - LL_ADD(aRun->mStats[inContext->mIndex].mWeight64, - aRun->mStats[inContext->mIndex].mWeight64, weight64); - - /* - ** Use the first event of the allocation to update the parent - ** callsites. - ** This has positive effect of not updating realloc callsites - ** with the same data over and over again. - */ - if (updateParent && 0 < aAllocation->mEventCount) { - tmcallsite *callsite = aAllocation->mEvents[0].mCallsite; - STRun *callsiteRun = NULL; - - /* - ** Go up parents till we drop. - */ - while (NULL != callsite && NULL != callsite->method) { - callsiteRun = CALLSITE_RUN(callsite); - if (NULL != callsiteRun) { - /* - ** Do we init it? - */ - if (callsiteRun->mStats[inContext->mIndex].mStamp != - aRun->mStats[inContext->mIndex].mStamp) { - memset(&callsiteRun->mStats[inContext->mIndex], 0, - sizeof(STCallsiteStats)); - callsiteRun->mStats[inContext->mIndex].mStamp = - aRun->mStats[inContext->mIndex].mStamp; - } - - /* - ** Add the values. - ** Note that if the allocation was ever realloced, - ** we are actually recording the final size. - ** Also, the composite count does not include - ** calls to realloc (or free for that matter), - ** but rather is simply a count of actual heap - ** allocation objects, from which someone will - ** draw conclusions regarding number of malloc - ** and free calls. - ** It is possible to generate the exact number - ** of calls to free/malloc/realloc should the - ** absolute need arise to count them individually, - ** but I fear it will take mucho memory and this - ** is perhaps good enough for now. - */ - callsiteRun->mStats[inContext->mIndex].mCompositeCount++; - callsiteRun->mStats[inContext->mIndex].mHeapRuntimeCost += - heapCost; - callsiteRun->mStats[inContext->mIndex].mSize += size; - LL_ADD(callsiteRun->mStats[inContext->mIndex].mTimeval64, - callsiteRun->mStats[inContext->mIndex].mTimeval64, - timeval64); - LL_ADD(callsiteRun->mStats[inContext->mIndex].mWeight64, - callsiteRun->mStats[inContext->mIndex].mWeight64, - weight64); - } - - callsite = callsite->parent; - } - } - } - - return 0; -} - - -/* -** appendAllocation -** -** Given a run, append the allocation to it. -** No DUP checks are done. -** Also, we might want to update the parent callsites with stats. -** We decide to do this heavy duty work only if the run we are appending -** to has a non ZERO mStats[].mStamp, meaning that it is asking to track -** such information when it was created. -** Returns !0 on success. -*/ -int -appendAllocation(STOptions * inOptions, STContext * inContext, - STRun * aRun, STAllocation * aAllocation) -{ - int retval = 0; - - if (NULL != aRun && NULL != aAllocation && NULL != inOptions) { - STAllocation **expand = NULL; - - /* - ** Expand the size of the array if needed. - */ - expand = (STAllocation **) realloc(aRun->mAllocations, - sizeof(STAllocation *) * - (aRun->mAllocationCount + 1)); - if (NULL != expand) { - /* - ** Reassign in case of pointer move. - */ - aRun->mAllocations = expand; - - /* - ** Stick the allocation in. - */ - aRun->mAllocations[aRun->mAllocationCount] = aAllocation; - - /* - ** If this is the global run, we need to let the allocation - ** track the index back to us. - */ - if (&globals.mRun == aRun) { - aAllocation->mRunIndex = aRun->mAllocationCount; - } - - /* - ** Increase the count. - */ - aRun->mAllocationCount++; - - /* - ** We're good. - */ - retval = __LINE__; - - /* - ** update allocation cost - */ - recalculateAllocationCost(inOptions, inContext, aRun, aAllocation, - PR_TRUE); - } - else { - REPORT_ERROR(__LINE__, appendAllocation); - } - } - else { - REPORT_ERROR(__LINE__, appendAllocation); - } - - return retval; -} - -/* -** hasCallsiteMatch -** -** Determine if the callsite or the other callsites has the matching text. -** -** Returns 0 if there is no match. -*/ -int -hasCallsiteMatch(tmcallsite * aCallsite, const char *aMatch, int aDirection) -{ - int retval = 0; - - if (NULL != aCallsite && NULL != aCallsite->method && - NULL != aMatch && '\0' != *aMatch) { - const char *methodName = NULL; - - do { - methodName = tmmethodnode_name(aCallsite->method); - if (NULL != methodName && NULL != strstr(methodName, aMatch)) { - /* - ** Contains the text. - */ - retval = __LINE__; - break; - } - else { - switch (aDirection) { - case ST_FOLLOW_SIBLINGS: - aCallsite = aCallsite->siblings; - break; - case ST_FOLLOW_PARENTS: - aCallsite = aCallsite->parent; - break; - default: - aCallsite = NULL; - REPORT_ERROR(__LINE__, hasCallsiteMatch); - break; - } - } - } - while (NULL != aCallsite && NULL != aCallsite->method); - } - else { - REPORT_ERROR(__LINE__, hasCallsiteMatch); - } - - return retval; -} - -/* -** harvestRun -** -** Provide a simply way to go over a run, and yield the relevant allocations. -** The restrictions are easily set via the options page or the command -** line switches. -** -** On any match, add the allocation to the provided run. -** -** This makes it much easier for all the code to respect the options in -** force. -** -** Returns !0 on error, though aOutRun may contain a partial data set. -*/ -int -harvestRun(const STRun * aInRun, STRun * aOutRun, - STOptions * aOptions, STContext * inContext) -{ - int retval = 0; - -#if defined(DEBUG_dp) - PRIntervalTime start = PR_IntervalNow(); - - fprintf(stderr, "DEBUG: harvesting run...\n"); -#endif - - if (NULL != aInRun && NULL != aOutRun && aInRun != aOutRun - && NULL != aOptions && NULL != inContext) { - PRUint32 traverse = 0; - STAllocation *current = NULL; - - for (traverse = 0; - 0 == retval && traverse < aInRun->mAllocationCount; traverse++) { - current = aInRun->mAllocations[traverse]; - if (NULL != current) { - PRUint32 lifetime = 0; - PRUint32 bytesize = 0; - PRUint64 weight64 = LL_INIT(0, 0); - PRUint64 bytesize64 = LL_INIT(0, 0); - PRUint64 lifetime64 = LL_INIT(0, 0); - int appendRes = 0; - int looper = 0; - PRBool matched = PR_FALSE; - - /* - ** Use this as an opportune time to fixup a memory - ** leaked timeval, so as to not completely skew - ** the weights. - */ - if (ST_TIMEVAL_MAX == current->mMaxTimeval) { - current->mMaxTimeval = globals.mMaxTimeval; - } - - /* - ** Check allocation timeval restrictions. - ** We have to slide the recorded timevals to be zero - ** based, so that the comparisons make sense. - */ - if ((aOptions->mAllocationTimevalMin > - (current->mMinTimeval - globals.mMinTimeval)) || - (aOptions->mAllocationTimevalMax < - (current->mMinTimeval - globals.mMinTimeval))) { - continue; - } - - /* - ** Check timeval restrictions. - ** We have to slide the recorded timevals to be zero - ** based, so that the comparisons make sense. - */ - if ((aOptions->mTimevalMin > - (current->mMinTimeval - globals.mMinTimeval)) || - (aOptions->mTimevalMax < - (current->mMinTimeval - globals.mMinTimeval))) { - continue; - } - - /* - ** Check lifetime restrictions. - */ - lifetime = current->mMaxTimeval - current->mMinTimeval; - if ((lifetime < aOptions->mLifetimeMin) || - (lifetime > aOptions->mLifetimeMax)) { - continue; - } - - /* - ** Check byte size restrictions. - */ - bytesize = byteSize(aOptions, current); - if ((bytesize < aOptions->mSizeMin) || - (bytesize > aOptions->mSizeMax)) { - continue; - } - - /* - ** Check weight restrictions. - */ - LL_UI2L(bytesize64, bytesize); - LL_UI2L(lifetime64, lifetime); - LL_MUL(weight64, bytesize64, lifetime64); - if (LL_UCMP(weight64, <, aOptions->mWeightMin64) || - LL_UCMP(weight64, >, aOptions->mWeightMax64)) { - continue; - } - - /* - ** Possibly restrict the callsite by text. - ** Do this last, as it is a heavier check. - ** - ** One day, we may need to expand the logic to check for - ** events beyond the initial allocation event. - */ - for (looper = 0; ST_SUBSTRING_MATCH_MAX > looper; looper++) { - if ('\0' != aOptions->mRestrictText[looper][0]) { - if (0 == - hasCallsiteMatch(current->mEvents[0].mCallsite, - aOptions->mRestrictText[looper], - ST_FOLLOW_PARENTS)) { - break; - } - } - else { - matched = PR_TRUE; - break; - } - } - if (ST_SUBSTRING_MATCH_MAX == looper) { - matched = PR_TRUE; - } - if (PR_FALSE == matched) { - continue; - } - - /* - ** You get here, we add to the run. - */ - appendRes = - appendAllocation(aOptions, inContext, aOutRun, current); - if (0 == appendRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, appendAllocation); - } - } - } - } - -#if defined(DEBUG_dp) - fprintf(stderr, "DEBUG: harvesting ends: %dms [%d allocations]\n", - PR_IntervalToMilliseconds(PR_IntervalNow() - start), - aInRun->mAllocationCount); -#endif - return retval; -} - -/* -** recalculateRunCost -** -** Goes over all allocations of a run and recalculates and propogates -** the allocation costs - weight, heapcount, size -*/ -int -recalculateRunCost(STOptions * inOptions, STContext * inContext, STRun * aRun) -{ - PRUint32 traverse = 0; - STAllocation *current = NULL; - -#if defined(DEBUG_dp) - PRIntervalTime start = PR_IntervalNow(); - - fprintf(stderr, "DEBUG: recalculateRunCost...\n"); -#endif - - if (NULL == aRun) - return -1; - - /* reset stats of this run to 0 to begin recalculation */ - memset(&aRun->mStats[inContext->mIndex], 0, sizeof(STCallsiteStats)); - - /* reset timestamp to force propogation of cost */ - aRun->mStats[inContext->mIndex].mStamp = PR_IntervalNow(); - - for (traverse = 0; traverse < aRun->mAllocationCount; traverse++) { - current = aRun->mAllocations[traverse]; - if (NULL != current) { - recalculateAllocationCost(inOptions, inContext, aRun, current, - PR_TRUE); - } - } - -#if defined(DEBUG_dp) - fprintf(stderr, "DEBUG: recalculateRunCost ends: %dms [%d allocations]\n", - PR_IntervalToMilliseconds(PR_IntervalNow() - start), - aRun->mAllocationCount); -#endif - - return 0; -} - - -/* -** compareAllocations -** -** qsort callback. -** Compare the allocations as specified by the options. -*/ -int -compareAllocations(const void *aAlloc1, const void *aAlloc2, void *aContext) -{ - int retval = 0; - STOptions *inOptions = (STOptions *) aContext; - - if (NULL != aAlloc1 && NULL != aAlloc2 && NULL != inOptions) { - STAllocation *alloc1 = *((STAllocation **) aAlloc1); - STAllocation *alloc2 = *((STAllocation **) aAlloc2); - - if (NULL != alloc1 && NULL != alloc2) { - /* - ** Logic determined by pref/option. - */ - switch (inOptions->mOrderBy) { - case ST_COUNT: - /* - ** "By count" on a single allocation means nothing, - ** fall through to weight. - */ - case ST_WEIGHT: - { - PRUint64 weight164 = LL_INIT(0, 0); - PRUint64 weight264 = LL_INIT(0, 0); - PRUint64 bytesize164 = LL_INIT(0, 0); - PRUint64 bytesize264 = LL_INIT(0, 0); - PRUint64 timeval164 = LL_INIT(0, 0); - PRUint64 timeval264 = LL_INIT(0, 0); - - LL_UI2L(bytesize164, byteSize(inOptions, alloc1)); - LL_UI2L(timeval164, - (alloc1->mMaxTimeval - alloc1->mMinTimeval)); - LL_MUL(weight164, bytesize164, timeval164); - LL_UI2L(bytesize264, byteSize(inOptions, alloc2)); - LL_UI2L(timeval264, - (alloc2->mMaxTimeval - alloc2->mMinTimeval)); - LL_MUL(weight264, bytesize264, timeval264); - - if (LL_UCMP(weight164, <, weight264)) { - retval = __LINE__; - } - else if (LL_UCMP(weight164, >, weight264)) { - retval = -__LINE__; - } - } - break; - - case ST_SIZE: - { - PRUint32 size1 = byteSize(inOptions, alloc1); - PRUint32 size2 = byteSize(inOptions, alloc2); - - if (size1 < size2) { - retval = __LINE__; - } - else if (size1 > size2) { - retval = -__LINE__; - } - } - break; - - case ST_TIMEVAL: - { - PRUint32 timeval1 = - (alloc1->mMaxTimeval - alloc1->mMinTimeval); - PRUint32 timeval2 = - (alloc2->mMaxTimeval - alloc2->mMinTimeval); - - if (timeval1 < timeval2) { - retval = __LINE__; - } - else if (timeval1 > timeval2) { - retval = -__LINE__; - } - } - break; - - case ST_HEAPCOST: - { - PRUint32 cost1 = alloc1->mHeapRuntimeCost; - PRUint32 cost2 = alloc2->mHeapRuntimeCost; - - if (cost1 < cost2) { - retval = __LINE__; - } - else if (cost1 > cost2) { - retval = -__LINE__; - } - } - break; - - default: - { - REPORT_ERROR(__LINE__, compareAllocations); - } - break; - } - } - } - - return retval; -} - -/* -** sortRun -** -** Given a run, sort it in the manner specified by the options. -** Returns !0 on failure. -*/ -int -sortRun(STOptions * inOptions, STRun * aRun) -{ - int retval = 0; - - if (NULL != aRun && NULL != inOptions) { - if (NULL != aRun->mAllocations && 0 < aRun->mAllocationCount) { - NS_QuickSort(aRun->mAllocations, aRun->mAllocationCount, - sizeof(STAllocation *), compareAllocations, - inOptions); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, sortRun); - } - - return retval; -} - -/* -** createRun -** -** Returns a newly allocated run, properly initialized. -** Must call freeRun() with the new STRun. -** -** ONLY PASS IN A NON_ZERO STAMP IF YOU KNOW WHAT YOU ARE DOING!!! -** A non zero stamp in a run has side effects all over the -** callsites of the allocations added to the run and their -** parents. -** -** Returns NULL on failure. -*/ -STRun * -createRun(STContext * inContext, PRUint32 aStamp) -{ - STRun *retval = NULL; - - retval = (STRun *) calloc(1, sizeof(STRun)); - if (NULL != retval) { - retval->mStats = - (STCallsiteStats *) calloc(globals.mCommandLineOptions.mContexts, - sizeof(STCallsiteStats)); - if (NULL != retval->mStats) { - if (NULL != inContext) { - retval->mStats[inContext->mIndex].mStamp = aStamp; - } - } - else { - free(retval); - retval = NULL; - } - } - - return retval; -} - -/* -** freeRun -** -** Free off the run and the associated data. -*/ -void -freeRun(STRun * aRun) -{ - if (NULL != aRun) { - if (NULL != aRun->mAllocations) { - /* - ** We do not free the allocations themselves. - ** They are likely pointed to by at least 2 other existing - ** runs. - */ - free(aRun->mAllocations); - aRun->mAllocations = NULL; - } - - if (NULL != aRun->mStats) { - free(aRun->mStats); - aRun->mStats = NULL; - } - - free(aRun); - aRun = NULL; - } -} - -/* -** createRunFromGlobal -** -** Harvest the global run, then sort it. -** Returns NULL on failure. -** Must call freeRun() with the new STRun. -*/ -STRun * -createRunFromGlobal(STOptions * inOptions, STContext * inContext) -{ - STRun *retval = NULL; - - if (NULL != inOptions && NULL != inContext) { - /* - ** We stamp the run. - ** As things are appended to it, it realizes that it should stamp the - ** callsite backtrace with the information as well. - ** In this manner, we can provide meaningful callsite data. - */ - retval = createRun(inContext, PR_IntervalNow()); - - if (NULL != retval) { - STCategoryNode *node = NULL; - int failure = 0; - int harvestRes = - harvestRun(&globals.mRun, retval, inOptions, inContext); - if (0 == harvestRes) { - int sortRes = sortRun(inOptions, retval); - - if (0 != sortRes) { - failure = __LINE__; - } - } - else { - failure = __LINE__; - } - - - if (0 != failure) { - freeRun(retval); - retval = NULL; - - REPORT_ERROR(failure, createRunFromGlobal); - } - - /* - ** Categorize the run. - */ - failure = categorizeRun(inOptions, inContext, retval, &globals); - if (0 != failure) { - REPORT_ERROR(__LINE__, categorizeRun); - } - - /* - ** if we are focussing on a category, return that run instead of - ** the harvested run. Make sure to recalculate cost. - */ - node = findCategoryNode(inOptions->mCategoryName, &globals); - if (node) { - /* Recalculate cost of run */ - recalculateRunCost(inOptions, inContext, - node->runs[inContext->mIndex]); - - retval = node->runs[inContext->mIndex]; - } - } - } - else { - REPORT_ERROR(__LINE__, createRunFromGlobal); - } - - return retval; -} - -/* -** getLiveAllocationByHeapID -** -** Go through a run and find the right heap ID. -** At the time of the call to this function, the allocation must be LIVE, -** meaning that it can not be freed. -** Go through the run backwards, in hopes of finding it near the end. -** -** Returns the allocation on success, otherwise NULL. -*/ -STAllocation * -getLiveAllocationByHeapID(STRun * aRun, PRUint32 aHeapID) -{ - STAllocation *retval = NULL; - - if (NULL != aRun && 0 != aHeapID) { - PRUint32 traverse = aRun->mAllocationCount; - STAllocation *eval = NULL; - - /* - ** Go through in reverse order. - ** Stop when we have a return value. - */ - while (0 < traverse && NULL == retval) { - /* - ** Back up one to align with zero based index. - */ - traverse--; - - /* - ** Take the pointer math out of further operations. - */ - eval = aRun->mAllocations[traverse]; - - /* - ** Take a look at the events in reverse order. - ** Basically the last event must NOT be a free. - ** The last event must NOT be a realloc of size zero (free). - ** Otherwise, try to match up the heapID of the event. - */ - if (0 != eval->mEventCount) { - STAllocEvent *event = eval->mEvents + (eval->mEventCount - 1); - - switch (event->mEventType) { - case TM_EVENT_FREE: - { - /* - ** No freed allocation can match. - */ - } - break; - - case TM_EVENT_REALLOC: - case TM_EVENT_CALLOC: - case TM_EVENT_MALLOC: - { - /* - ** Heap IDs must match. - */ - if (aHeapID == event->mHeapID) { - retval = eval; - } - } - break; - - default: - { - REPORT_ERROR(__LINE__, getAllocationByHeapID); - } - break; - } - } - } - } - else { - REPORT_ERROR(__LINE__, getAllocationByHeapID); - } - - return retval; -} - -/* -** appendEvent -** -** Given an allocation, append a new event to it's lifetime. -** Returns the new event on success, otherwise NULL. -*/ -STAllocEvent * -appendEvent(STAllocation * aAllocation, PRUint32 aTimeval, char aEventType, - PRUint32 aHeapID, PRUint32 aHeapSize, tmcallsite * aCallsite) -{ - STAllocEvent *retval = NULL; - - if (NULL != aAllocation && NULL != aCallsite) { - STAllocEvent *expand = NULL; - - /* - ** Expand the allocation's event array. - */ - expand = - (STAllocEvent *) realloc(aAllocation->mEvents, - sizeof(STAllocEvent) * - (aAllocation->mEventCount + 1)); - if (NULL != expand) { - /* - ** Reassign in case of pointer move. - */ - aAllocation->mEvents = expand; - - /* - ** Remove the pointer math from rest of code. - */ - retval = aAllocation->mEvents + aAllocation->mEventCount; - - /* - ** Increase event array count. - */ - aAllocation->mEventCount++; - - /* - ** Fill in the event. - */ - retval->mTimeval = aTimeval; - retval->mEventType = aEventType; - retval->mHeapID = aHeapID; - retval->mHeapSize = aHeapSize; - retval->mCallsite = aCallsite; - - /* - ** Allocation may need to update idea of lifetime. - ** See allocationTracker to see mMinTimeval inited to ST_TIMEVAL_MAX. - */ - if (aAllocation->mMinTimeval > aTimeval) { - aAllocation->mMinTimeval = aTimeval; - } - - /* - ** This a free event? - ** Can only set max timeval on a free. - ** Otherwise, mMaxTimeval remains ST_TIMEVAL_MAX. - ** Set in allocationTracker. - */ - if (TM_EVENT_FREE == aEventType) { - aAllocation->mMaxTimeval = aTimeval; - } - } - else { - REPORT_ERROR(__LINE__, appendEvent); - } - } - else { - REPORT_ERROR(__LINE__, appendEvent); - } - - return retval; -} - -/* -** hasAllocation -** -** Determine if a given run has an allocation. -** This is really nothing more than a pointer comparison loop. -** Returns !0 if the run has the allocation. -*/ -int -hasAllocation(STRun * aRun, STAllocation * aTestFor) -{ - int retval = 0; - - if (NULL != aRun && NULL != aTestFor) { - PRUint32 traverse = aRun->mAllocationCount; - - /* - ** Go through reverse, in the hopes it exists nearer the end. - */ - while (0 < traverse) { - /* - ** Back up. - */ - traverse--; - - if (aTestFor == aRun->mAllocations[traverse]) { - retval = __LINE__; - break; - } - } - } - else { - REPORT_ERROR(__LINE__, hasAllocation); - } - - return retval; -} - -/* -** allocationTracker -** -** Important to keep track of all allocations unique so as to determine -** their lifetimes. -** -** Returns a pointer to the allocation on success. -** Return NULL on failure. -*/ -STAllocation * -allocationTracker(PRUint32 aTimeval, char aType, PRUint32 aHeapRuntimeCost, - tmcallsite * aCallsite, PRUint32 aHeapID, PRUint32 aSize, - tmcallsite * aOldCallsite, PRUint32 aOldHeapID, - PRUint32 aOldSize) -{ - STAllocation *retval = NULL; - static int compactor = 1; - const int frequency = 10000; - PRUint32 actualSize, actualOldSize = 0; - - actualSize = actualByteSize(&globals.mCommandLineOptions, aSize); - if (aOldSize) - actualOldSize = - actualByteSize(&globals.mCommandLineOptions, aOldSize); - - if (NULL != aCallsite) { - int newAllocation = 0; - tmcallsite *searchCallsite = NULL; - PRUint32 searchHeapID = 0; - STAllocation *allocation = NULL; - - /* - ** Global operation ID increases. - */ - globals.mOperationCount++; - - /* - ** Fix up the timevals if needed. - */ - if (aTimeval < globals.mMinTimeval) { - globals.mMinTimeval = aTimeval; - } - if (aTimeval > globals.mMaxTimeval) { - globals.mMaxTimeval = aTimeval; - } - - switch (aType) { - case TM_EVENT_FREE: - { - /* - ** Update the global counter. - */ - globals.mFreeCount++; - - /* - ** Update our peak memory used counter - */ - globals.mMemoryUsed -= actualSize; - - /* - ** Not a new allocation, will need to search passed in site - ** for the original allocation. - */ - searchCallsite = aCallsite; - searchHeapID = aHeapID; - } - break; - - case TM_EVENT_MALLOC: - { - /* - ** Update the global counter. - */ - globals.mMallocCount++; - - /* - ** Update our peak memory used counter - */ - globals.mMemoryUsed += actualSize; - if (globals.mMemoryUsed > globals.mPeakMemoryUsed) { - globals.mPeakMemoryUsed = globals.mMemoryUsed; - } - - /* - ** This will be a new allocation. - */ - newAllocation = __LINE__; - } - break; - - case TM_EVENT_CALLOC: - { - /* - ** Update the global counter. - */ - globals.mCallocCount++; - - /* - ** Update our peak memory used counter - */ - globals.mMemoryUsed += actualSize; - if (globals.mMemoryUsed > globals.mPeakMemoryUsed) { - globals.mPeakMemoryUsed = globals.mMemoryUsed; - } - - /* - ** This will be a new allocation. - */ - newAllocation = __LINE__; - } - break; - - case TM_EVENT_REALLOC: - { - /* - ** Update the global counter. - */ - globals.mReallocCount++; - - /* - ** Update our peak memory used counter - */ - globals.mMemoryUsed += actualSize - actualOldSize; - if (globals.mMemoryUsed > globals.mPeakMemoryUsed) { - globals.mPeakMemoryUsed = globals.mMemoryUsed; - } - - /* - ** This might be a new allocation. - */ - if (NULL == aOldCallsite) { - newAllocation = __LINE__; - } - else { - /* - ** Need to search for the original callsite for the - ** index to the allocation. - */ - searchCallsite = aOldCallsite; - searchHeapID = aOldHeapID; - } - } - break; - - default: - { - REPORT_ERROR(__LINE__, allocationTracker); - } - break; - } - - /* - ** We are either modifying an existing allocation or we are creating - ** a new one. - */ - if (0 != newAllocation) { - allocation = (STAllocation *) calloc(1, sizeof(STAllocation)); - if (NULL != allocation) { - /* - ** Fixup the min timeval so if logic later will just work. - */ - allocation->mMinTimeval = ST_TIMEVAL_MAX; - allocation->mMaxTimeval = ST_TIMEVAL_MAX; - } - } - else if (NULL != searchCallsite - && NULL != CALLSITE_RUN(searchCallsite) - && 0 != searchHeapID) { - /* - ** We know what to search for, and we reduce what we search - ** by only looking for those allocations at a known callsite. - */ - allocation = - getLiveAllocationByHeapID(CALLSITE_RUN(searchCallsite), - searchHeapID); - } - else { - REPORT_ERROR(__LINE__, allocationTracker); - } - - if (NULL != allocation) { - STAllocEvent *appendResult = NULL; - - /* - ** Record the amount of time this allocation event took. - */ - allocation->mHeapRuntimeCost += aHeapRuntimeCost; - - /* - ** Now that we have an allocation, we need to make sure it has - ** the proper event. - */ - appendResult = - appendEvent(allocation, aTimeval, aType, aHeapID, aSize, - aCallsite); - if (NULL != appendResult) { - if (0 != newAllocation) { - int runAppendResult = 0; - int callsiteAppendResult = 0; - - /* - ** A new allocation needs to be added to the global run. - ** A new allocation needs to be added to the callsite. - */ - runAppendResult = - appendAllocation(&globals.mCommandLineOptions, NULL, - &globals.mRun, allocation); - callsiteAppendResult = - appendAllocation(&globals.mCommandLineOptions, NULL, - CALLSITE_RUN(aCallsite), allocation); - if (0 != runAppendResult && 0 != callsiteAppendResult) { - /* - ** Success. - */ - retval = allocation; - } - else { - REPORT_ERROR(__LINE__, appendAllocation); - } - } - else { - /* - ** An existing allocation, if a realloc situation, - ** may need to be added to the new callsite. - ** This can only occur if the new and old callsites - ** differ. - ** Even then, a brute force check will need to be made - ** to ensure the allocation was not added twice; - ** consider a realloc scenario where two different - ** call stacks bump the allocation back and forth. - */ - if (aCallsite != searchCallsite) { - int found = 0; - - found = - hasAllocation(CALLSITE_RUN(aCallsite), - allocation); - if (0 == found) { - int appendResult = 0; - - appendResult = - appendAllocation(&globals.mCommandLineOptions, - NULL, - CALLSITE_RUN(aCallsite), - allocation); - if (0 != appendResult) { - /* - ** Success. - */ - retval = allocation; - } - else { - REPORT_ERROR(__LINE__, appendAllocation); - } - } - else { - /* - ** Already there. - */ - retval = allocation; - } - } - else { - /* - ** Success. - */ - retval = allocation; - } - } - } - else { - REPORT_ERROR(__LINE__, appendEvent); - } - } - else { - REPORT_ERROR(__LINE__, allocationTracker); - } - } - else { - REPORT_ERROR(__LINE__, allocationTracker); - } - - /* - ** Compact the heap a bit if you can. - */ - compactor++; - if (0 == (compactor % frequency)) { - heapCompact(); - } - - return retval; -} - -/* -** trackEvent -** -** An allocation event has dropped in on us. -** We need to do the right thing and track it. -*/ -void -trackEvent(PRUint32 aTimeval, char aType, PRUint32 aHeapRuntimeCost, - tmcallsite * aCallsite, PRUint32 aHeapID, PRUint32 aSize, - tmcallsite * aOldCallsite, PRUint32 aOldHeapID, PRUint32 aOldSize) -{ - if (NULL != aCallsite) { - /* - ** Verify the old callsite just in case. - */ - if (NULL != CALLSITE_RUN(aCallsite) - && (NULL == aOldCallsite || NULL != CALLSITE_RUN(aOldCallsite))) { - STAllocation *allocation = NULL; - - /* - ** Add to the allocation tracking code. - */ - allocation = - allocationTracker(aTimeval, aType, aHeapRuntimeCost, - aCallsite, aHeapID, aSize, aOldCallsite, - aOldHeapID, aOldSize); - - if (NULL == allocation) { - REPORT_ERROR(__LINE__, allocationTracker); - } - } - else { - REPORT_ERROR(__LINE__, trackEvent); - } - } - else { - REPORT_ERROR(__LINE__, trackEvent); - } -} - -/* -** tmEventHandler -** -** Callback from the tmreader_eventloop function. -** Simply tries to sort out what we desire to know. -*/ - -static const char spinner_chars[] = { '/', '-', '\\', '|' }; - -#define SPINNER_UPDATE_FREQUENCY 4096 -#define SPINNER_CHAR_COUNT (sizeof(spinner_chars) / sizeof(spinner_chars[0])) -#define SPINNER_CHAR(_x) spinner_chars[(_x / SPINNER_UPDATE_FREQUENCY) % SPINNER_CHAR_COUNT] - -void -tmEventHandler(tmreader * aReader, tmevent * aEvent) -{ - static event_count = 0; /* for spinner */ - if ((event_count++ % SPINNER_UPDATE_FREQUENCY) == 0) - printf("\rReading... %c", SPINNER_CHAR(event_count)); - - if (NULL != aReader && NULL != aEvent) { - switch (aEvent->type) { - /* - ** Events we ignore. - */ - case TM_EVENT_LIBRARY: - case TM_EVENT_METHOD: - case TM_EVENT_STATS: - case TM_EVENT_TIMESTAMP: - case TM_EVENT_FILENAME: - break; - - /* - ** Allocation events need to be tracked. - */ - case TM_EVENT_MALLOC: - case TM_EVENT_CALLOC: - case TM_EVENT_REALLOC: - case TM_EVENT_FREE: - { - PRUint32 oldptr = 0; - PRUint32 oldsize = 0; - tmcallsite *callsite = NULL; - tmcallsite *oldcallsite = NULL; - - if (TM_EVENT_REALLOC == aEvent->type) { - /* - ** Only care about old arguments if there were any. - */ - if (0 != aEvent->u.alloc.oldserial) { - oldptr = aEvent->u.alloc.oldptr; - oldsize = aEvent->u.alloc.oldsize; - oldcallsite = - tmreader_callsite(aReader, - aEvent->u.alloc.oldserial); - if (NULL == oldcallsite) { - REPORT_ERROR(__LINE__, tmreader_callsite); - } - } - } - - callsite = tmreader_callsite(aReader, aEvent->serial); - if (NULL != callsite) { - /* - ** Verify a callsite run is there. - ** If not, we are ignoring this callsite. - */ - if (NULL != CALLSITE_RUN(callsite)) { - char eventType = aEvent->type; - PRUint32 eventSize = aEvent->u.alloc.size; - - /* - ** Play a nasty trick on reallocs of size zero. - ** They are to become free events, adjust the size accordingly. - ** This allows me to avoid all types of special case code. - */ - if (0 == aEvent->u.alloc.size - && TM_EVENT_REALLOC == aEvent->type) { - eventType = TM_EVENT_FREE; - if (0 != aEvent->u.alloc.oldserial) { - eventSize = aEvent->u.alloc.oldsize; - } - } - trackEvent(ticks2msec - (aReader, aEvent->u.alloc.interval), - eventType, ticks2usec(aReader, - aEvent->u.alloc. - cost), callsite, - aEvent->u.alloc.ptr, eventSize, - oldcallsite, oldptr, oldsize); - } - } - else { - REPORT_ERROR(__LINE__, tmreader_callsite); - } - } - break; - - /* - ** Callsite, set up the callsite run if it does not exist. - */ - case TM_EVENT_CALLSITE: - { - tmcallsite *callsite = - tmreader_callsite(aReader, aEvent->serial); - - if (NULL != callsite) { - if (NULL == CALLSITE_RUN(callsite)) { - int createrun = __LINE__; - -#if defined(MOZILLA_CLIENT) - /* - ** For a mozilla spacetrace, ignore this particular - ** callsite as it is just noise, and causes us to - ** use a lot of memory. - ** - ** This callsite is present on the linux build, - ** not sure if the other platforms have it. - */ - if (0 != - hasCallsiteMatch(callsite, "g_main_is_running", - ST_FOLLOW_PARENTS)) { - createrun = 0; - } -#endif /* MOZILLA_CLIENT */ - - if (0 != createrun) { - callsite->data = createRun(NULL, 0); - } - } - } - else { - REPORT_ERROR(__LINE__, tmreader_callsite); - } - } - break; - - /* - ** Unhandled events should not be allowed. - */ - default: - { - REPORT_ERROR(__LINE__, tmEventHandler); - } - break; - } - } -} - -/* -** optionGetDataOut -** -** Output option get data. -*/ -void -optionGetDataOut(PRFileDesc * inFD, STOptions * inOptions) -{ - if (NULL != inFD && NULL != inOptions) { - int mark = 0; - -#define ST_WEB_OPTION_BOOL(option_name, option_genre, option_help) \ - PR_fprintf(inFD, "%s%s=%d", (0 == mark++) ? "?" : "&", #option_name, inOptions->m##option_name); -#define ST_WEB_OPTION_STRING(option_name, option_genre, default_value, option_help) \ - PR_fprintf(inFD, "%s%s=%s", (0 == mark++) ? "?" : "&", #option_name, inOptions->m##option_name); -#define ST_WEB_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) \ - { \ - PRUint32 loop = 0; \ - \ - for(loop = 0; loop < array_size; loop++) \ - { \ - PR_fprintf(inFD, "%s%s=%s", (0 == mark++) ? "?" : "&", #option_name, inOptions->m##option_name[loop]); \ - } \ - } -#define ST_WEB_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) /* no implementation */ -#define ST_WEB_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) \ - PR_fprintf(inFD, "%s%s=%u", (0 == mark++) ? "?" : "&", #option_name, inOptions->m##option_name / multiplier); -#define ST_WEB_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) \ - { \ - PRUint64 def64 = default_value; \ - PRUint64 mul64 = multiplier; \ - PRUint64 div64; \ - \ - LL_DIV(div64, inOptions->m##option_name##64, mul64); \ - PR_fprintf(inFD, "%s%s=%llu", (0 == mark++) ? "?" : "&", #option_name, div64); \ - } - -#include "stoptions.h" - } -} - -/* -** htmlAnchor -** -** Output an HTML anchor, or just the text depending on the mode. -*/ -void -htmlAnchor(STRequest * inRequest, - const char *aHref, - const char *aText, - const char *aTarget, const char *aClass, STOptions * inOptions) -{ - if (NULL != aHref && '\0' != *aHref && NULL != aText && '\0' != *aText) { - int anchorLive = 1; - - /* - ** In batch mode, we need to verify the anchor is live. - */ - if (0 != inRequest->mOptions.mBatchRequestCount) { - PRUint32 loop = 0; - int comparison = 1; - - for (loop = 0; loop < inRequest->mOptions.mBatchRequestCount; - loop++) { - comparison = - strcmp(aHref, inRequest->mOptions.mBatchRequest[loop]); - if (0 == comparison) { - break; - } - } - - /* - ** Did we find it? - */ - if (0 == comparison) { - anchorLive = 0; - } - } - - /* - ** In any mode, don't make an href to the current page. - */ - if (0 != anchorLive && NULL != inRequest->mGetFileName) { - if (0 == strcmp(aHref, inRequest->mGetFileName)) { - anchorLive = 0; - } - } - - /* - ** Do the right thing. - */ - if (0 != anchorLive) { - PR_fprintf(inRequest->mFD, "mFD, "target=\"%s\" ", aTarget); - } - PR_fprintf(inRequest->mFD, "href=\"./%s", aHref); - - /* - ** The options, if desired, get appended as form data. - */ - optionGetDataOut(inRequest->mFD, inOptions); - - PR_fprintf(inRequest->mFD, "\">%s\n", aText); - } - else { - PR_fprintf(inRequest->mFD, "%s\n", - aClass, aText); - } - } - else { - REPORT_ERROR(__LINE__, htmlAnchor); - } -} - -/* -** htmlAllocationAnchor -** -** Output an html achor that will resolve to the allocation in question. -*/ -void -htmlAllocationAnchor(STRequest * inRequest, STAllocation * aAllocation, - const char *aText) -{ - if (NULL != aAllocation && NULL != aText && '\0' != *aText) { - char buffer[128]; - - /* - ** This is a total hack. - ** The filename contains the index of the allocation in globals.mRun. - ** Safer than using the raw pointer value.... - */ - PR_snprintf(buffer, sizeof(buffer), "allocation_%u.html", - aAllocation->mRunIndex); - - htmlAnchor(inRequest, buffer, aText, NULL, "allocation", - &inRequest->mOptions); - } - else { - REPORT_ERROR(__LINE__, htmlAllocationAnchor); - } -} - -/* -** resolveSourceFile -** -** Easy way to get a readable/short name. -** NULL if not present, not resolvable. -*/ -const char * -resolveSourceFile(tmmethodnode * aMethod) -{ - const char *retval = NULL; - - if (NULL != aMethod) { - const char *methodSays = NULL; - - methodSays = aMethod->sourcefile; - - if (NULL != methodSays && '\0' != methodSays[0] - && 0 != strcmp("noname", methodSays)) { - retval = strrchr(methodSays, '/'); - if (NULL != retval) { - retval++; - } - else { - retval = methodSays; - } - } - } - - return retval; -} - -/* -** htmlCallsiteAnchor -** -** Output an html anchor that will resolve to the callsite in question. -** If no text is provided, we provide our own. -** -** RealName determines wether or not we crawl our parents until the point -** we no longer match stats. -*/ -void -htmlCallsiteAnchor(STRequest * inRequest, tmcallsite * aCallsite, - const char *aText, int aRealName) -{ - if (NULL != aCallsite) { - char textBuf[512]; - char hrefBuf[128]; - tmcallsite *namesite = aCallsite; - - /* - ** Should we use a different name? - */ - if (0 == aRealName && NULL != namesite->parent - && NULL != namesite->parent->method) { - STRun *myRun = NULL; - STRun *upRun = NULL; - - do { - myRun = CALLSITE_RUN(namesite); - upRun = CALLSITE_RUN(namesite->parent); - - if (0 != - memcmp(&myRun->mStats[inRequest->mContext->mIndex], - &upRun->mStats[inRequest->mContext->mIndex], - sizeof(STCallsiteStats))) { - /* - ** Doesn't match, stop. - */ - break; - } - else { - /* - ** Matches, keep going up. - */ - namesite = namesite->parent; - } - } - while (NULL != namesite->parent - && NULL != namesite->parent->method); - } - - /* - ** If no text, provide our own. - */ - if (NULL == aText || '\0' == *aText) { - const char *methodName = NULL; - const char *sourceFile = NULL; - - if (NULL != namesite->method) { - methodName = tmmethodnode_name(namesite->method); - } - else { - methodName = "==NONAME=="; - } - - /* - ** Decide which format to use to identify the callsite. - ** If we can detect availability, hook up the filename with lxr information. - */ - sourceFile = resolveSourceFile(namesite->method); - if (NULL != sourceFile - && 0 == strncmp("mozilla/", namesite->method->sourcefile, - 8)) { - char lxrHREFBuf[512]; - - PR_snprintf(lxrHREFBuf, sizeof(lxrHREFBuf), - " [%s:%u]", - namesite->method->sourcefile + 8, - namesite->method->linenumber, sourceFile, - namesite->method->linenumber); - PR_snprintf(textBuf, sizeof(textBuf), - "%s%s", - methodName, lxrHREFBuf); - } - else if (NULL != sourceFile) { - PR_snprintf(textBuf, sizeof(textBuf), - "%s [%s:%u]", - methodName, sourceFile, - namesite->method->linenumber); - } - else { - PR_snprintf(textBuf, sizeof(textBuf), - "%s [+%u(%u)]", - methodName, namesite->offset, - (PRUint32) namesite->entry.key); - } - - aText = textBuf; - } - - PR_snprintf(hrefBuf, sizeof(hrefBuf), "callsite_%u.html", - (PRUint32) aCallsite->entry.key); - - htmlAnchor(inRequest, hrefBuf, aText, NULL, "callsite", - &inRequest->mOptions); - } - else { - REPORT_ERROR(__LINE__, htmlCallsiteAnchor); - } -} - -/* -** htmlHeader -** -** Output a standard header in the report files. -*/ -void -htmlHeader(STRequest * inRequest, const char *aTitle) -{ - PR_fprintf(inRequest->mFD, - "\n" - "\n" - "%s\n" - "\n" - "\n" - "
\n" - "Spacetrace" - "\n" - "Category:\n" - "%s\n", - aTitle, inRequest->mOptions.mCategoryName); - - PR_fprintf(inRequest->mFD, ""); - htmlAnchor(inRequest, "index.html", "Index", NULL, "header-menuitem", - &inRequest->mOptions); - PR_fprintf(inRequest->mFD, "\n"); - - PR_fprintf(inRequest->mFD, ""); - htmlAnchor(inRequest, "options.html", "Options", NULL, "header-menuitem", - &inRequest->mOptions); - PR_fprintf(inRequest->mFD, "\n"); - - PR_fprintf(inRequest->mFD, "\n"); /* class=navigate */ - - PR_fprintf(inRequest->mFD, - "
\n\n
\n\n"); -} - -/* -** htmlFooter -** -** Output a standard footer in the report file. -*/ -void -htmlFooter(STRequest * inRequest) -{ - PR_fprintf(inRequest->mFD, - "
\n\n" - "
\n" - "SpaceTrace\n" - "
\n\n" "\n" "\n"); -} - -/* -** htmlNotFound -** -** Not found message. -*/ -void -htmlNotFound(STRequest * inRequest) -{ - htmlHeader(inRequest, "File Not Found"); - PR_fprintf(inRequest->mFD, "File Not Found\n"); - htmlFooter(inRequest); -} - -void -htmlStartTable(STRequest* inRequest, - const char* table_class, - const char* id, - const char* caption, - const char * const headers[], PRUint32 header_length) -{ - PRUint32 i; - - PR_fprintf(inRequest->mFD, - "
\n" - " " - " \n" - " \n", id, - table_class ? table_class : "", - caption); - - for (i=0; i< header_length; i++) - PR_fprintf(inRequest->mFD, - " \n", headers[i]); - - PR_fprintf(inRequest->mFD, " \n"); -} - -/* -** callsiteArrayFromCallsite -** -** Simply return an array of the callsites divulged from the site passed in, -** including the site passed in. -** Do not worry about dups, or the order of the items. -** -** Returns the number of items in the array. -** If the same as aExistingCount, then nothing happened. -*/ -PRUint32 -callsiteArrayFromCallsite(tmcallsite *** aArray, PRUint32 aExistingCount, - tmcallsite * aSite, int aFollow) -{ - PRUint32 retval = 0; - - if (NULL != aArray && NULL != aSite) { - tmcallsite **expand = NULL; - - /* - ** If we have an existing count, we just keep expanding this. - */ - retval = aExistingCount; - - /* - ** Go through every allocation. - */ - do { - /* - ** expand the array. - */ - expand = - (tmcallsite **) realloc(*aArray, - sizeof(tmcallsite *) * (retval + 1)); - if (NULL != expand) { - /* - ** Set the callsite in case of pointer move. - */ - *aArray = expand; - - /* - ** Assign the value. - */ - (*aArray)[retval] = aSite; - retval++; - } - else { - REPORT_ERROR(__LINE__, realloc); - break; - } - - - /* - ** What do we follow? - */ - switch (aFollow) { - case ST_FOLLOW_SIBLINGS: - aSite = aSite->siblings; - break; - case ST_FOLLOW_PARENTS: - aSite = aSite->parent; - break; - default: - aSite = NULL; - REPORT_ERROR(__LINE__, callsiteArrayFromCallsite); - break; - } - } - while (NULL != aSite && NULL != aSite->method); - } - - return retval; -} - -/* -** callsiteArrayFromRun -** -** Simply return an array of the callsites from the run allocations. -** We only pay attention to callsites that were not free callsites. -** Do not worry about dups, or the order of the items. -** -** Returns the number of items in the array. -** If the same as aExistingCount, then nothing happened. -*/ -PRUint32 -callsiteArrayFromRun(tmcallsite *** aArray, PRUint32 aExistingCount, - STRun * aRun) -{ - PRUint32 retval = 0; - - if (NULL != aArray && NULL != aRun && 0 < aRun->mAllocationCount) { - PRUint32 allocLoop = 0; - PRUint32 eventLoop = 0; - int stopLoops = 0; - - /* - ** If we have an existing count, we just keep expanding this. - */ - retval = aExistingCount; - - /* - ** Go through every allocation. - */ - for (allocLoop = 0; - 0 == stopLoops && allocLoop < aRun->mAllocationCount; - allocLoop++) { - /* - ** Go through every event. - */ - for (eventLoop = 0; - 0 == stopLoops - && eventLoop < aRun->mAllocations[allocLoop]->mEventCount; - eventLoop++) { - /* - ** Skip the free events. - */ - if (TM_EVENT_FREE != - aRun->mAllocations[allocLoop]->mEvents[eventLoop]. - mEventType) { - tmcallsite **expand = NULL; - - /* - ** expand the array. - */ - expand = - (tmcallsite **) realloc(*aArray, - sizeof(tmcallsite *) * - (retval + 1)); - if (NULL != expand) { - /* - ** Set the callsite in case of pointer move. - */ - *aArray = expand; - - /* - ** Assign the value. - */ - (*aArray)[retval] = - aRun->mAllocations[allocLoop]->mEvents[eventLoop]. - mCallsite; - retval++; - } - else { - REPORT_ERROR(__LINE__, realloc); - stopLoops = __LINE__; - } - } - } - } - } - - return retval; -} - -/* -** getDataPRUint* -** -** Helper to avoid cut and paste code. -** Failure to find aCheckFor does not mean failure. -** In case of dups, specify an index on non "1" to get others. -** Do not touch storage space unless a find is made. -** Returns !0 on failure. -*/ -int -getDataPRUint32Base(const FormData * aGetData, const char *aCheckFor, - int inIndex, void *aStoreResult, PRUint32 aBits) -{ - int retval = 0; - - if (NULL != aGetData && NULL != aCheckFor && 0 != inIndex - && NULL != aStoreResult) { - unsigned finder = 0; - - /* - ** Loop over the names, looking for an exact string match. - ** Skip over initial finds, decrementing inIndex, until "1". - */ - for (finder = 0; finder < aGetData->mNVCount; finder++) { - if (0 == strcmp(aCheckFor, aGetData->mNArray[finder])) { - inIndex--; - - if (0 == inIndex) { - PRInt32 scanRes = 0; - - if (64 == aBits) { - scanRes = - PR_sscanf(aGetData->mVArray[finder], "%llu", - aStoreResult); - } - else { - scanRes = - PR_sscanf(aGetData->mVArray[finder], "%u", - aStoreResult); - } - if (1 != scanRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, PR_sscanf); - } - break; - } - } - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, getDataPRUint32Base); - } - - return retval; -} - -int -getDataPRUint32(const FormData * aGetData, const char *aCheckFor, int inIndex, - PRUint32 * aStoreResult, PRUint32 aConversion) -{ - int retval = 0; - - retval = - getDataPRUint32Base(aGetData, aCheckFor, inIndex, aStoreResult, 32); - *aStoreResult *= aConversion; - - return retval; -} - -int -getDataPRUint64(const FormData * aGetData, const char *aCheckFor, int inIndex, - PRUint64 * aStoreResult64, PRUint64 aConversion64) -{ - int retval = 0; - PRUint64 value64 = LL_INIT(0, 0); - - retval = getDataPRUint32Base(aGetData, aCheckFor, inIndex, &value64, 64); - LL_MUL(*aStoreResult64, value64, aConversion64); - - return retval; -} - -/* -** getDataString -** -** Pull out the string data, if specified. -** In case of dups, specify an index on non "1" to get others. -** Do not touch storage space unless a find is made. -** Return !0 on failure. -*/ -int -getDataString(const FormData * aGetData, const char *aCheckFor, int inIndex, - char *aStoreResult, int inStoreResultLength) -{ - int retval = 0; - - if (NULL != aGetData && NULL != aCheckFor && 0 != inIndex - && NULL != aStoreResult && 0 != inStoreResultLength) { - unsigned finder = 0; - - /* - ** Loop over the names, looking for an exact string match. - ** Skip over initial finds, decrementing inIndex, until "1". - */ - for (finder = 0; finder < aGetData->mNVCount; finder++) { - if (0 == strcmp(aCheckFor, aGetData->mNArray[finder])) { - inIndex--; - - if (0 == inIndex) { - PR_snprintf(aStoreResult, inStoreResultLength, "%s", - aGetData->mVArray[finder]); - break; - } - } - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, getDataPRUint32); - } - - return retval; -} - -/* -** displayTopAllocations -** -** Present the top allocations. -** The run must be passed in, and it must be pre-sorted. -** -** Returns !0 on failure. -*/ -int -displayTopAllocations(STRequest * inRequest, STRun * aRun, - const char* id, - const char* caption, - int aWantCallsite) -{ - int retval = 0; - - if (NULL != aRun) { - if (0 < aRun->mAllocationCount) { - PRUint32 loop = 0; - STAllocation *current = NULL; - - static const char* const headers[] = { - "Rank", "Index", "Byte Size", "Lifespan (sec)", - "Weight", "Heap Op (sec)" - }; - - static const char* const headers_callsite[] = { - "Rank", "Index", "Byte Size", "Lifespan (sec)", - "Weight", "Heap Op (sec)", "Origin Callsite" - }; - - if (aWantCallsite) - htmlStartTable(inRequest, NULL, id, - caption, - headers_callsite, - sizeof(headers_callsite) / sizeof(headers_callsite[0])); - else - htmlStartTable(inRequest, NULL, id, caption, - headers, - sizeof(headers) / sizeof(headers[0])); - /* - ** Loop over the items, up to some limit or until the end. - */ - for (loop = 0; - loop < inRequest->mOptions.mListItemMax - && loop < aRun->mAllocationCount; loop++) { - current = aRun->mAllocations[loop]; - if (NULL != current) { - PRUint32 lifespan = - current->mMaxTimeval - current->mMinTimeval; - PRUint32 size = byteSize(&inRequest->mOptions, current); - PRUint32 heapCost = current->mHeapRuntimeCost; - PRUint64 weight64 = LL_INIT(0, 0); - PRUint64 size64 = LL_INIT(0, 0); - PRUint64 lifespan64 = LL_INIT(0, 0); - char buffer[32]; - - LL_UI2L(size64, size); - LL_UI2L(lifespan64, lifespan); - LL_MUL(weight64, size64, lifespan64); - - PR_fprintf(inRequest->mFD, "\n"); - - /* - ** Rank. - */ - PR_fprintf(inRequest->mFD, "\n", - loop + 1); - - /* - ** Index. - */ - PR_snprintf(buffer, sizeof(buffer), "%u", - current->mRunIndex); - PR_fprintf(inRequest->mFD, "\n"); - - /* - ** Byte Size. - */ - PR_fprintf(inRequest->mFD, "\n", - size); - - /* - ** Lifespan. - */ - PR_fprintf(inRequest->mFD, - "\n", - ST_TIMEVAL_PRINTABLE(lifespan)); - - /* - ** Weight. - */ - PR_fprintf(inRequest->mFD, "\n", - weight64); - - /* - ** Heap operation cost. - */ - PR_fprintf(inRequest->mFD, - "\n", ST_MICROVAL_PRINTABLE(heapCost)); - - if (0 != aWantCallsite) { - /* - ** Callsite. - */ - PR_fprintf(inRequest->mFD, "\n"); - } - - PR_fprintf(inRequest->mFD, "\n"); - } - } - - PR_fprintf(inRequest->mFD, "\n
%s
%s
%u\n"); - htmlAllocationAnchor(inRequest, current, buffer); - PR_fprintf(inRequest->mFD, "%u" ST_TIMEVAL_FORMAT "%llu" ST_MICROVAL_FORMAT - ""); - htmlCallsiteAnchor(inRequest, - current->mEvents[0].mCallsite, - NULL, 0); - PR_fprintf(inRequest->mFD, "
\n\n"); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayTopAllocations); - } - - return retval; -} - -/* -** displayMemoryLeaks -** -** Present the top memory leaks. -** The run must be passed in, and it must be pre-sorted. -** -** Returns !0 on failure. -*/ -int -displayMemoryLeaks(STRequest * inRequest, STRun * aRun) -{ - int retval = 0; - - if (NULL != aRun) { - PRUint32 loop = 0; - PRUint32 displayed = 0; - STAllocation *current = NULL; - - static const char * headers[] = { - "Rank", "Index", "Byte Size", "Lifespan (sec)", - "Weight", "Heap Op (sec)", "Origin Callsite" - }; - - htmlStartTable(inRequest, NULL, "memory-leaks", "Memory Leaks", headers, - sizeof(headers) / sizeof(headers[0])); - - /* - ** Loop over all of the items, or until we've displayed enough. - */ - for (loop = 0; - displayed < inRequest->mOptions.mListItemMax - && loop < aRun->mAllocationCount; loop++) { - current = aRun->mAllocations[loop]; - if (NULL != current && 0 != current->mEventCount) { - /* - ** In order to be a leak, the last event of it's life must - ** NOT be a free operation. - ** - ** A free operation is just that, a free. - */ - if (TM_EVENT_FREE != - current->mEvents[current->mEventCount - 1].mEventType) { - PRUint32 lifespan = - current->mMaxTimeval - current->mMinTimeval; - PRUint32 size = byteSize(&inRequest->mOptions, current); - PRUint32 heapCost = current->mHeapRuntimeCost; - PRUint64 weight64 = LL_INIT(0, 0); - PRUint64 size64 = LL_INIT(0, 0); - PRUint64 lifespan64 = LL_INIT(0, 0); - char buffer[32]; - - LL_UI2L(size64, size); - LL_UI2L(lifespan64, lifespan); - LL_MUL(weight64, size64, lifespan64); - - /* - ** One more shown. - */ - displayed++; - - PR_fprintf(inRequest->mFD, "\n"); - - /* - ** Rank. - */ - PR_fprintf(inRequest->mFD, "%u\n", - displayed); - - /* - ** Index. - */ - PR_snprintf(buffer, sizeof(buffer), "%u", - current->mRunIndex); - PR_fprintf(inRequest->mFD, "\n"); - htmlAllocationAnchor(inRequest, current, buffer); - PR_fprintf(inRequest->mFD, "\n"); - - /* - ** Byte Size. - */ - PR_fprintf(inRequest->mFD, "%u\n", - size); - - /* - ** Lifespan. - */ - PR_fprintf(inRequest->mFD, - "" ST_TIMEVAL_FORMAT "\n", - ST_TIMEVAL_PRINTABLE(lifespan)); - - /* - ** Weight. - */ - PR_fprintf(inRequest->mFD, "%llu\n", - weight64); - - /* - ** Heap Operation Seconds. - */ - PR_fprintf(inRequest->mFD, - "" ST_MICROVAL_FORMAT - "\n", ST_MICROVAL_PRINTABLE(heapCost)); - - /* - ** Callsite. - */ - PR_fprintf(inRequest->mFD, ""); - htmlCallsiteAnchor(inRequest, - current->mEvents[0].mCallsite, NULL, - 0); - PR_fprintf(inRequest->mFD, "\n"); - - PR_fprintf(inRequest->mFD, "\n"); - } - } - } - - PR_fprintf(inRequest->mFD, "
\n\n"); - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayMemoryLeaks); - } - - return retval; -} - -/* -** displayCallsites -** -** Display a table of callsites. -** If the stamp is non zero, then must match that stamp. -** If the stamp is zero, then must match the global sorted run stamp. -** Return !0 on error. -*/ -int -displayCallsites(STRequest * inRequest, tmcallsite * aCallsite, int aFollow, - PRUint32 aStamp, - const char* id, - const char* caption, - int aRealNames) -{ - int retval = 0; - - if (NULL != aCallsite && NULL != aCallsite->method) { - int headerDisplayed = 0; - STRun *run = NULL; - - /* - ** Correct the stamp if need be. - */ - if (0 == aStamp && NULL != inRequest->mContext->mSortedRun) { - aStamp = - inRequest->mContext->mSortedRun->mStats[inRequest->mContext-> - mIndex].mStamp; - } - - /* - ** Loop over the callsites looking for a stamp match. - ** A stamp guarantees there is something interesting to look at too. - ** If found, output it. - */ - while (NULL != aCallsite && NULL != aCallsite->method) { - run = CALLSITE_RUN(aCallsite); - if (NULL != run) { - if (aStamp == run->mStats[inRequest->mContext->mIndex].mStamp) { - /* - ** We got a header? - */ - if (0 == headerDisplayed) { - - static const char* const headers[] = { - "Callsite", - "C. Size", - "C. Seconds", - "C. Weight", - "H.O. Count", - "C.H. Operation (sec)" - }; - headerDisplayed = __LINE__; - htmlStartTable(inRequest, NULL, id, caption, headers, - sizeof(headers)/sizeof(headers[0])); - } - - /* - ** Output the information. - */ - PR_fprintf(inRequest->mFD, "\n"); - - /* - ** Method name. - */ - PR_fprintf(inRequest->mFD, ""); - htmlCallsiteAnchor(inRequest, aCallsite, NULL, - aRealNames); - PR_fprintf(inRequest->mFD, ""); - - /* - ** Byte Size. - */ - PR_fprintf(inRequest->mFD, - "%u\n", - run->mStats[inRequest->mContext->mIndex]. - mSize); - - /* - ** Seconds. - */ - PR_fprintf(inRequest->mFD, - "" ST_TIMEVAL_FORMAT - "\n", - ST_TIMEVAL_PRINTABLE64(run-> - mStats[inRequest-> - mContext-> - mIndex]. - mTimeval64)); - - /* - ** Weight. - */ - PR_fprintf(inRequest->mFD, - "%llu\n", - run->mStats[inRequest->mContext->mIndex]. - mWeight64); - - /* - ** Allocation object count. - */ - PR_fprintf(inRequest->mFD, - "%u\n", - run->mStats[inRequest->mContext->mIndex]. - mCompositeCount); - - /* - ** Heap Operation Seconds. - */ - PR_fprintf(inRequest->mFD, - "" - ST_MICROVAL_FORMAT "\n", - ST_MICROVAL_PRINTABLE(run-> - mStats[inRequest-> - mContext->mIndex]. - mHeapRuntimeCost)); - - PR_fprintf(inRequest->mFD, "\n"); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayCallsites); - break; - } - - /* - ** What do we follow? - */ - switch (aFollow) { - case ST_FOLLOW_SIBLINGS: - aCallsite = aCallsite->siblings; - break; - case ST_FOLLOW_PARENTS: - aCallsite = aCallsite->parent; - break; - default: - aCallsite = NULL; - retval = __LINE__; - REPORT_ERROR(__LINE__, displayCallsites); - break; - } - } - - /* - ** Terminate the table if we should. - */ - if (0 != headerDisplayed) { - PR_fprintf(inRequest->mFD, "\n\n"); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayCallsites); - } - - return retval; -} - -/* -** displayAllocationDetails -** -** Report what we know about the allocation. -** -** Returns !0 on error. -*/ -int -displayAllocationDetails(STRequest * inRequest, STAllocation * aAllocation) -{ - int retval = 0; - - if (NULL != aAllocation) { - PRUint32 traverse = 0; - PRUint32 bytesize = byteSize(&inRequest->mOptions, aAllocation); - PRUint32 timeval = - aAllocation->mMaxTimeval - aAllocation->mMinTimeval; - PRUint32 heapCost = aAllocation->mHeapRuntimeCost; - PRUint64 weight64 = LL_INIT(0, 0); - PRUint64 bytesize64 = LL_INIT(0, 0); - PRUint64 timeval64 = LL_INIT(0, 0); - PRUint32 cacheval = 0; - int displayRes = 0; - - LL_UI2L(bytesize64, bytesize); - LL_UI2L(timeval64, timeval); - LL_MUL(weight64, bytesize64, timeval64); - - PR_fprintf(inRequest->mFD, "

Allocation %u Details:

\n", - aAllocation->mRunIndex); - - PR_fprintf(inRequest->mFD, "
\n"); - PR_fprintf(inRequest->mFD, - "\n", - bytesize); - PR_fprintf(inRequest->mFD, - "\n", - ST_TIMEVAL_PRINTABLE(timeval)); - PR_fprintf(inRequest->mFD, - "\n", - weight64); - PR_fprintf(inRequest->mFD, - "\n", - ST_MICROVAL_PRINTABLE(heapCost)); - PR_fprintf(inRequest->mFD, "
Final Size:%u
Lifespan Seconds:" - ST_TIMEVAL_FORMAT "
Weight:%llu
Heap Operation Seconds:" - ST_MICROVAL_FORMAT "
\n"); - - /* - ** The events. - */ - - { - static const char* const headers[] = { - "Operation", "Size", "Seconds", "" - }; - - char caption[100]; - PR_snprintf(caption, sizeof(caption), "%u Life Event(s)", - aAllocation->mEventCount); - htmlStartTable(inRequest, NULL, "allocation-details", caption, headers, - sizeof(headers) / sizeof(headers[0])); - } - - for (traverse = 0; - traverse < aAllocation->mEventCount - && traverse < inRequest->mOptions.mListItemMax; traverse++) { - PR_fprintf(inRequest->mFD, "\n"); - - /* - ** count. - */ - PR_fprintf(inRequest->mFD, - "%u.\n", traverse + 1); - - /* - ** Operation. - */ - PR_fprintf(inRequest->mFD, ""); - switch (aAllocation->mEvents[traverse].mEventType) { - case TM_EVENT_CALLOC: - PR_fprintf(inRequest->mFD, "calloc"); - break; - case TM_EVENT_FREE: - PR_fprintf(inRequest->mFD, "free"); - break; - case TM_EVENT_MALLOC: - PR_fprintf(inRequest->mFD, "malloc"); - break; - case TM_EVENT_REALLOC: - PR_fprintf(inRequest->mFD, "realloc"); - break; - default: - retval = __LINE__; - REPORT_ERROR(__LINE__, displayAllocationDetails); - break; - } - PR_fprintf(inRequest->mFD, ""); - - /* - ** Size. - */ - PR_fprintf(inRequest->mFD, "%u\n", - aAllocation->mEvents[traverse].mHeapSize); - - /* - ** Timeval. - */ - cacheval = - aAllocation->mEvents[traverse].mTimeval - globals.mMinTimeval; - PR_fprintf(inRequest->mFD, - "" ST_TIMEVAL_FORMAT - "\n", ST_TIMEVAL_PRINTABLE(cacheval)); - - /* - ** Callsite backtrace. - ** Only relevant backtrace is for event 0 for now until - ** trace-malloc outputs proper callsites for all others. - */ - PR_fprintf(inRequest->mFD, "\n"); - if (0 == traverse) { - displayRes = - displayCallsites(inRequest, - aAllocation->mEvents[traverse].mCallsite, - ST_FOLLOW_PARENTS, 0, "event-stack", "", __LINE__); - if (0 != displayRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayCallsite); - } - } - PR_fprintf(inRequest->mFD, "\n"); - - PR_fprintf(inRequest->mFD, "\n"); - } - PR_fprintf(inRequest->mFD, "\n"); - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayAllocationDetails); - } - - return retval; -} - -/* -** compareCallsites -** -** qsort callback. -** Compare the callsites as specified by the options. -** There must be NO equal callsites, unless they really are duplicates, -** this is so that a duplicate detector loop can -** simply skip sorted items until the callsite is different. -*/ -int -compareCallsites(const void *aSite1, const void *aSite2, void *aContext) -{ - int retval = 0; - STRequest *inRequest = (STRequest *) aContext; - - if (NULL != aSite1 && NULL != aSite2) { - tmcallsite *site1 = *((tmcallsite **) aSite1); - tmcallsite *site2 = *((tmcallsite **) aSite2); - - if (NULL != site1 && NULL != site2) { - STRun *run1 = CALLSITE_RUN(site1); - STRun *run2 = CALLSITE_RUN(site2); - - if (NULL != run1 && NULL != run2) { - STCallsiteStats *stats1 = - &(run1->mStats[inRequest->mContext->mIndex]); - STCallsiteStats *stats2 = - &(run2->mStats[inRequest->mContext->mIndex]); - - /* - ** Logic determined by pref/option. - */ - switch (inRequest->mOptions.mOrderBy) { - case ST_WEIGHT: - { - PRUint64 weight164 = stats1->mWeight64; - PRUint64 weight264 = stats2->mWeight64; - - if (LL_UCMP(weight164, <, weight264)) { - retval = __LINE__; - } - else if (LL_UCMP(weight164, >, weight264)) { - retval = -__LINE__; - } - } - break; - - case ST_SIZE: - { - PRUint32 size1 = stats1->mSize; - PRUint32 size2 = stats2->mSize; - - if (size1 < size2) { - retval = __LINE__; - } - else if (size1 > size2) { - retval = -__LINE__; - } - } - break; - - case ST_TIMEVAL: - { - PRUint64 timeval164 = stats1->mTimeval64; - PRUint64 timeval264 = stats2->mTimeval64; - - if (LL_UCMP(timeval164, <, timeval264)) { - retval = __LINE__; - } - else if (LL_UCMP(timeval164, >, timeval264)) { - retval = -__LINE__; - } - } - break; - - case ST_COUNT: - { - PRUint32 count1 = stats1->mCompositeCount; - PRUint32 count2 = stats2->mCompositeCount; - - if (count1 < count2) { - retval = __LINE__; - } - else if (count1 > count2) { - retval = -__LINE__; - } - } - break; - - case ST_HEAPCOST: - { - PRUint32 cost1 = stats1->mHeapRuntimeCost; - PRUint32 cost2 = stats2->mHeapRuntimeCost; - - if (cost1 < cost2) { - retval = __LINE__; - } - else if (cost1 > cost2) { - retval = -__LINE__; - } - } - break; - - default: - { - REPORT_ERROR(__LINE__, compareAllocations); - } - break; - } - - /* - ** If the return value is still zero, do a pointer compare. - ** This makes sure we return zero, only iff the same object. - */ - if (0 == retval) { - if (stats1 < stats2) { - retval = __LINE__; - } - else if (stats1 > stats2) { - retval = -__LINE__; - } - } - } - } - } - - return retval; -} - -/* -** displayTopCallsites -** -** Given a list of callsites, sort it, and output skipping dups. -** The passed in callsite array is side effected, as in that it will come -** back sorted. This function will not release the array. -** -** Note: If the stamp passed in is non zero, then all callsites must match. -** If the stamp is zero, all callsites must match global sorted run stamp. -** -** Returns !0 on error. -*/ -int -displayTopCallsites(STRequest * inRequest, tmcallsite ** aCallsites, - PRUint32 aCallsiteCount, PRUint32 aStamp, - const char* id, - const char* caption, - int aRealName) -{ - int retval = 0; - - if (NULL != aCallsites && 0 < aCallsiteCount) { - PRUint32 traverse = 0; - STRun *run = NULL; - tmcallsite *site = NULL; - int headerDisplayed = 0; - PRUint32 displayed = 0; - - /* - ** Fixup the stamp. - */ - if (0 == aStamp && NULL != inRequest->mContext->mSortedRun) { - aStamp = - inRequest->mContext->mSortedRun->mStats[inRequest->mContext-> - mIndex].mStamp; - } - - /* - ** Sort the things. - */ - NS_QuickSort(aCallsites, aCallsiteCount, sizeof(tmcallsite *), - compareCallsites, inRequest); - - /* - ** Time for output. - */ - for (traverse = 0; - traverse < aCallsiteCount - && inRequest->mOptions.mListItemMax > displayed; traverse++) { - site = aCallsites[traverse]; - run = CALLSITE_RUN(site); - - /* - ** Only if the same stamp.... - */ - if (aStamp == run->mStats[inRequest->mContext->mIndex].mStamp) { - /* - ** We got a header yet? - */ - if (0 == headerDisplayed) { - static const char* const headers[] = { - "Rank", - "Callsite", - "Size", - "Seconds", - "Weight", - "Object Count", - "C.H. Operation (sec)" - }; - headerDisplayed = __LINE__; - - htmlStartTable(inRequest, NULL, id, caption, headers, - sizeof(headers) / sizeof(headers[0])); - } - - displayed++; - - PR_fprintf(inRequest->mFD, "\n"); - - /* - ** Rank. - */ - PR_fprintf(inRequest->mFD, - "%u\n", displayed); - - /* - ** Method. - */ - PR_fprintf(inRequest->mFD, ""); - htmlCallsiteAnchor(inRequest, site, NULL, aRealName); - PR_fprintf(inRequest->mFD, "\n"); - - /* - ** Size. - */ - PR_fprintf(inRequest->mFD, - "%u\n", - run->mStats[inRequest->mContext->mIndex].mSize); - - /* - ** Timeval. - */ - PR_fprintf(inRequest->mFD, - "" ST_TIMEVAL_FORMAT - "\n", - ST_TIMEVAL_PRINTABLE64(run-> - mStats[inRequest->mContext-> - mIndex].mTimeval64)); - - /* - ** Weight. - */ - PR_fprintf(inRequest->mFD, - "%llu\n", - run->mStats[inRequest->mContext->mIndex]. - mWeight64); - - /* - ** Allocation object count. - */ - PR_fprintf(inRequest->mFD, - "%u\n", - run->mStats[inRequest->mContext->mIndex]. - mCompositeCount); - - /* - ** Heap operation seconds. - */ - PR_fprintf(inRequest->mFD, - "" ST_MICROVAL_FORMAT - "\n", - ST_MICROVAL_PRINTABLE(run-> - mStats[inRequest->mContext-> - mIndex]. - mHeapRuntimeCost)); - - PR_fprintf(inRequest->mFD, "\n"); - - - if (inRequest->mOptions.mListItemMax > displayed) { - /* - ** Skip any dups. - */ - while (((traverse + 1) < aCallsiteCount) - && (site == aCallsites[traverse + 1])) { - traverse++; - } - } - } - } - - /* - ** We need to terminate anything? - */ - if (0 != headerDisplayed) { - PR_fprintf(inRequest->mFD, "\n"); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayTopCallsites); - } - - return retval; -} - -/* -** displayCallsiteDetails -** -** The callsite specific report. -** Try to report what we know. -** This one hits a little harder than the rest. -** -** Returns !0 on error. -*/ -int -displayCallsiteDetails(STRequest * inRequest, tmcallsite * aCallsite) -{ - int retval = 0; - - if (NULL != aCallsite && NULL != aCallsite->method) { - STRun *sortedRun = NULL; - STRun *thisRun = CALLSITE_RUN(aCallsite); - const char *sourceFile = NULL; - - sourceFile = resolveSourceFile(aCallsite->method); - - PR_fprintf(inRequest->mFD, "
\n"); - if (sourceFile) { - PR_fprintf(inRequest->mFD, "%s", - tmmethodnode_name(aCallsite->method)); - PR_fprintf(inRequest->mFD, - " [%s:%u]", - aCallsite->method->sourcefile, - aCallsite->method->linenumber, sourceFile, - aCallsite->method->linenumber); - } - else { - PR_fprintf(inRequest->mFD, - "

%s+%u(%u) Callsite Details:

\n", - tmmethodnode_name(aCallsite->method), - aCallsite->offset, (PRUint32) aCallsite->entry.key); - } - - PR_fprintf(inRequest->mFD, "
\n\n"); - PR_fprintf(inRequest->mFD, "
\n"); - PR_fprintf(inRequest->mFD, - "\n", - thisRun->mStats[inRequest->mContext->mIndex].mSize); - PR_fprintf(inRequest->mFD, - "\n", - ST_TIMEVAL_PRINTABLE64(thisRun-> - mStats[inRequest->mContext->mIndex]. - mTimeval64)); - PR_fprintf(inRequest->mFD, - "\n", - thisRun->mStats[inRequest->mContext->mIndex].mWeight64); - PR_fprintf(inRequest->mFD, - "\n", - thisRun->mStats[inRequest->mContext->mIndex]. - mCompositeCount); - PR_fprintf(inRequest->mFD, - "\n", - ST_MICROVAL_PRINTABLE(thisRun-> - mStats[inRequest->mContext->mIndex]. - mHeapRuntimeCost)); - PR_fprintf(inRequest->mFD, "
Composite Byte Size:%u
Composite Seconds:" - ST_TIMEVAL_FORMAT "
Composite Weight:%llu
Heap Object Count:%u
Heap Operation Seconds:" - ST_MICROVAL_FORMAT "
\n\n"); - - /* - ** Kids (callsites we call): - */ - if (NULL != aCallsite->kids && NULL != aCallsite->kids->method) { - int displayRes = 0; - PRUint32 siteCount = 0; - tmcallsite **sites = NULL; - - /* - ** Collect the kid sibling callsites. - ** Doing it this way sorts them for relevance. - */ - siteCount = - callsiteArrayFromCallsite(&sites, 0, aCallsite->kids, - ST_FOLLOW_SIBLINGS); - if (0 != siteCount && NULL != sites) { - /* - ** Got something to show. - */ - displayRes = - displayTopCallsites(inRequest, sites, siteCount, 0, - "callsites", - "Children Callsites", - __LINE__); - if (0 != displayRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayTopCallsites); - } - - /* - ** Done with array. - */ - free(sites); - sites = NULL; - } - } - - /* - ** Parents (those who call us): - */ - if (NULL != aCallsite->parent && NULL != aCallsite->parent->method) { - int displayRes = 0; - - displayRes = - displayCallsites(inRequest, aCallsite->parent, - ST_FOLLOW_PARENTS, 0, "caller-stack", "Caller stack", - __LINE__); - if (0 != displayRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayCallsites); - } - } - - /* - ** Allocations we did. - ** Simply harvest our own run. - */ - sortedRun = createRun(inRequest->mContext, 0); - if (NULL != sortedRun) { - int harvestRes = 0; - - harvestRes = - harvestRun(CALLSITE_RUN(aCallsite), sortedRun, - &inRequest->mOptions, inRequest->mContext); - if (0 == harvestRes) { - if (0 != sortedRun->mAllocationCount) { - int sortRes = 0; - - sortRes = sortRun(&inRequest->mOptions, sortedRun); - if (0 == sortRes) { - int displayRes = 0; - - displayRes = - displayTopAllocations(inRequest, sortedRun, - "allocations", - "Allocations", - 0); - if (0 != displayRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayTopAllocations); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, sortRun); - } - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, harvestRun); - } - - /* - ** Done with the run. - */ - freeRun(sortedRun); - sortedRun = NULL; - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, createRun); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayCallsiteDetails); - } - - return retval; -} - -#if ST_WANT_GRAPHS -/* -** graphFootprint -** -** Output a PNG graph of the memory usage of the run. -** -** Draw the graph within these boundaries. -** STGD_MARGIN,STGD_MARGIN,STGD_WIDTH-STGD_MARGIN,STGD_HEIGHT-STGD_MARGIN -** -** Returns !0 on failure. -*/ -int -graphFootprint(STRequest * inRequest, STRun * aRun) -{ - int retval = 0; - - if (NULL != aRun) { - PRUint32 *YData = NULL; - PRUint32 YDataArray[STGD_SPACE_X]; - PRUint32 traverse = 0; - PRUint32 timeval = 0; - PRUint32 loop = 0; - PRBool underLock = PR_FALSE; - - /* - ** Decide if this is custom or we should use the cache. - */ - if (aRun == inRequest->mContext->mSortedRun) { - YData = inRequest->mContext->mFootprintYData; - underLock = PR_TRUE; - } - else { - YData = YDataArray; - } - - /* - ** Protect the shared data so that only one client has access to it - ** at any given time. - */ - if (PR_FALSE != underLock) { - PR_Lock(inRequest->mContext->mImageLock); - } - - /* - ** Only do the computations if we aren't cached already. - */ - if (YData != inRequest->mContext->mFootprintYData - || PR_FALSE == inRequest->mContext->mFootprintCached) { - memset(YData, 0, sizeof(PRUint32) * STGD_SPACE_X); - - /* - ** Initialize our Y data. - ** Pretty brutal loop here.... - */ - for (traverse = 0; 0 == retval && traverse < STGD_SPACE_X; - traverse++) { - /* - ** Compute what timeval this Y data lands in. - */ - timeval = - ((traverse * - (globals.mMaxTimeval - - globals.mMinTimeval)) / STGD_SPACE_X) + - globals.mMinTimeval; - - /* - ** Loop over the run. - ** Should an allocation contain said Timeval, we're good. - */ - for (loop = 0; loop < aRun->mAllocationCount; loop++) { - if (timeval >= aRun->mAllocations[loop]->mMinTimeval - && timeval <= aRun->mAllocations[loop]->mMaxTimeval) { - YData[traverse] += - byteSize(&inRequest->mOptions, - aRun->mAllocations[loop]); - } - } - } - - /* - ** Did we cache this? - */ - if (YData == inRequest->mContext->mFootprintYData) { - inRequest->mContext->mFootprintCached = PR_TRUE; - } - } - - /* - ** Done with the lock. - */ - if (PR_FALSE != underLock) { - PR_Unlock(inRequest->mContext->mImageLock); - } - - if (0 == retval) { - PRUint32 minMemory = (PRUint32) - 1; - PRUint32 maxMemory = 0; - int transparent = 0; - gdImagePtr graph = NULL; - - /* - ** Go through and find the minimum and maximum sizes. - */ - for (traverse = 0; traverse < STGD_SPACE_X; traverse++) { - if (YData[traverse] < minMemory) { - minMemory = YData[traverse]; - } - if (YData[traverse] > maxMemory) { - maxMemory = YData[traverse]; - } - } - - /* - ** We can now draw the graph. - */ - graph = createGraph(&transparent); - if (NULL != graph) { - gdSink theSink; - int red = 0; - int x1 = 0; - int y1 = 0; - int x2 = 0; - int y2 = 0; - PRUint32 percents[11] = - { 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; - char *timevals[11]; - char *bytes[11]; - char timevalSpace[11][32]; - char byteSpace[11][32]; - int legendColors[1]; - const char *legends[1] = { "Memory in Use" }; - PRUint32 cached = 0; - - /* - ** Figure out what the labels will say. - */ - for (traverse = 0; traverse < 11; traverse++) { - timevals[traverse] = timevalSpace[traverse]; - bytes[traverse] = byteSpace[traverse]; - - cached = - ((globals.mMaxTimeval - - globals.mMinTimeval) * percents[traverse]) / 100; - PR_snprintf(timevals[traverse], 32, ST_TIMEVAL_FORMAT, - ST_TIMEVAL_PRINTABLE(cached)); - PR_snprintf(bytes[traverse], 32, "%u", - ((maxMemory - - minMemory) * percents[traverse]) / 100); - } - - red = gdImageColorAllocate(graph, 255, 0, 0); - legendColors[0] = red; - - drawGraph(graph, -1, "Memory Footprint Over Time", "Seconds", - "Bytes", 11, percents, (const char **) timevals, 11, - percents, (const char **) bytes, 1, legendColors, - legends); - - if (maxMemory != minMemory) { - PRInt64 in64 = LL_INIT(0, 0); - PRInt64 ydata64 = LL_INIT(0, 0); - PRInt64 spacey64 = LL_INIT(0, 0); - PRInt64 mem64 = LL_INIT(0, 0); - PRInt32 in32 = 0; - - /* - ** Go through our Y data and mark it up. - */ - for (traverse = 0; traverse < STGD_SPACE_X; traverse++) { - x1 = traverse + STGD_MARGIN; - y1 = STGD_HEIGHT - STGD_MARGIN; - - /* - ** Need to do this math in 64 bits. - */ - LL_I2L(ydata64, YData[traverse]); - LL_I2L(spacey64, STGD_SPACE_Y); - LL_I2L(mem64, (maxMemory - minMemory)); - - LL_MUL(in64, ydata64, spacey64); - LL_DIV(in64, in64, mem64); - LL_L2I(in32, in64); - - x2 = x1; - y2 = y1 - in32; - - gdImageLine(graph, x1, y1, x2, y2, red); - } - } - - - theSink.context = inRequest->mFD; - theSink.sink = pngSink; - gdImagePngToSink(graph, &theSink); - - gdImageDestroy(graph); - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, createGraph); - } - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, graphFootprint); - } - - return retval; -} -#endif /* ST_WANT_GRAPHS */ - -#if ST_WANT_GRAPHS -/* -** graphTimeval -** -** Output a PNG graph of when the memory is allocated. -** -** Draw the graph within these boundaries. -** STGD_MARGIN,STGD_MARGIN,STGD_WIDTH-STGD_MARGIN,STGD_HEIGHT-STGD_MARGIN -** -** Returns !0 on failure. -*/ -int -graphTimeval(STRequest * inRequest, STRun * aRun) -{ - int retval = 0; - - if (NULL != aRun) { - PRUint32 *YData = NULL; - PRUint32 YDataArray[STGD_SPACE_X]; - PRUint32 traverse = 0; - PRUint32 timeval = globals.mMinTimeval; - PRUint32 loop = 0; - PRBool underLock = PR_FALSE; - - /* - ** Decide if this is custom or we should use the global cache. - */ - if (aRun == inRequest->mContext->mSortedRun) { - YData = inRequest->mContext->mTimevalYData; - underLock = PR_TRUE; - } - else { - YData = YDataArray; - } - - /* - ** Protect the shared data so that only one client has access to it - ** at any given time. - */ - if (PR_FALSE != underLock) { - PR_Lock(inRequest->mContext->mImageLock); - } - - /* - ** Only do the computations if we aren't cached already. - */ - if (YData != inRequest->mContext->mTimevalYData - || PR_FALSE == inRequest->mContext->mTimevalCached) { - PRUint32 prevTimeval = 0; - - memset(YData, 0, sizeof(PRUint32) * STGD_SPACE_X); - - /* - ** Initialize our Y data. - ** Pretty brutal loop here.... - */ - for (traverse = 0; 0 == retval && traverse < STGD_SPACE_X; - traverse++) { - /* - ** Compute what timeval this Y data lands in. - */ - prevTimeval = timeval; - timeval = - ((traverse * - (globals.mMaxTimeval - - globals.mMinTimeval)) / STGD_SPACE_X) + - globals.mMinTimeval; - - /* - ** Loop over the run. - ** Should an allocation have been allocated between - ** prevTimeval and timeval.... - */ - for (loop = 0; loop < aRun->mAllocationCount; loop++) { - if (prevTimeval < aRun->mAllocations[loop]->mMinTimeval - && timeval >= aRun->mAllocations[loop]->mMinTimeval) { - YData[traverse] += - byteSize(&inRequest->mOptions, - aRun->mAllocations[loop]); - } - } - } - - /* - ** Did we cache this? - */ - if (YData == inRequest->mContext->mTimevalYData) { - inRequest->mContext->mTimevalCached = PR_TRUE; - } - } - - /* - ** Done with the lock. - */ - if (PR_FALSE != underLock) { - PR_Unlock(inRequest->mContext->mImageLock); - } - - if (0 == retval) { - PRUint32 minMemory = (PRUint32) - 1; - PRUint32 maxMemory = 0; - int transparent = 0; - gdImagePtr graph = NULL; - - /* - ** Go through and find the minimum and maximum sizes. - */ - for (traverse = 0; traverse < STGD_SPACE_X; traverse++) { - if (YData[traverse] < minMemory) { - minMemory = YData[traverse]; - } - if (YData[traverse] > maxMemory) { - maxMemory = YData[traverse]; - } - } - - /* - ** We can now draw the graph. - */ - graph = createGraph(&transparent); - if (NULL != graph) { - gdSink theSink; - int red = 0; - int x1 = 0; - int y1 = 0; - int x2 = 0; - int y2 = 0; - PRUint32 percents[11] = - { 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; - char *timevals[11]; - char *bytes[11]; - char timevalSpace[11][32]; - char byteSpace[11][32]; - int legendColors[1]; - const char *legends[1] = { "Memory Allocated" }; - PRUint32 cached = 0; - - /* - ** Figure out what the labels will say. - */ - for (traverse = 0; traverse < 11; traverse++) { - timevals[traverse] = timevalSpace[traverse]; - bytes[traverse] = byteSpace[traverse]; - - cached = - ((globals.mMaxTimeval - - globals.mMinTimeval) * percents[traverse]) / 100; - PR_snprintf(timevals[traverse], 32, ST_TIMEVAL_FORMAT, - ST_TIMEVAL_PRINTABLE(cached)); - PR_snprintf(bytes[traverse], 32, "%u", - ((maxMemory - - minMemory) * percents[traverse]) / 100); - } - - red = gdImageColorAllocate(graph, 255, 0, 0); - legendColors[0] = red; - - drawGraph(graph, -1, "Allocation Times", "Seconds", "Bytes", - 11, percents, (const char **) timevals, 11, - percents, (const char **) bytes, 1, legendColors, - legends); - - if (maxMemory != minMemory) { - PRInt64 in64 = LL_INIT(0, 0); - PRInt64 ydata64 = LL_INIT(0, 0); - PRInt64 spacey64 = LL_INIT(0, 0); - PRInt64 mem64 = LL_INIT(0, 0); - PRInt32 in32 = 0; - - /* - ** Go through our Y data and mark it up. - */ - for (traverse = 0; traverse < STGD_SPACE_X; traverse++) { - x1 = traverse + STGD_MARGIN; - y1 = STGD_HEIGHT - STGD_MARGIN; - - /* - ** Need to do this math in 64 bits. - */ - LL_I2L(ydata64, YData[traverse]); - LL_I2L(spacey64, STGD_SPACE_Y); - LL_I2L(mem64, (maxMemory - minMemory)); - - LL_MUL(in64, ydata64, spacey64); - LL_DIV(in64, in64, mem64); - LL_L2I(in32, in64); - - x2 = x1; - y2 = y1 - in32; - - gdImageLine(graph, x1, y1, x2, y2, red); - } - } - - - theSink.context = inRequest->mFD; - theSink.sink = pngSink; - gdImagePngToSink(graph, &theSink); - - gdImageDestroy(graph); - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, createGraph); - } - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, graphTimeval); - } - - return retval; -} -#endif /* ST_WANT_GRAPHS */ - -#if ST_WANT_GRAPHS -/* -** graphLifespan -** -** Output a PNG graph of how long memory lived. -** -** Draw the graph within these boundaries. -** STGD_MARGIN,STGD_MARGIN,STGD_WIDTH-STGD_MARGIN,STGD_HEIGHT-STGD_MARGIN -** -** Returns !0 on failure. -*/ -int -graphLifespan(STRequest * inRequest, STRun * aRun) -{ - int retval = 0; - - if (NULL != aRun) { - PRUint32 *YData = NULL; - PRUint32 YDataArray[STGD_SPACE_X]; - PRUint32 traverse = 0; - PRUint32 timeval = 0; - PRUint32 loop = 0; - PRBool underLock = PR_FALSE; - - /* - ** Decide if this is custom or we should use the global cache. - */ - if (aRun == inRequest->mContext->mSortedRun) { - YData = inRequest->mContext->mLifespanYData; - underLock = PR_TRUE; - } - else { - YData = YDataArray; - } - - /* - ** Protect the shared data so that only one client has access to it - ** at any given time. - */ - if (PR_FALSE != underLock) { - PR_Lock(inRequest->mContext->mImageLock); - } - - /* - ** Only do the computations if we aren't cached already. - */ - if (YData != inRequest->mContext->mLifespanYData - || PR_FALSE == inRequest->mContext->mLifespanCached) { - PRUint32 prevTimeval = 0; - PRUint32 lifespan = 0; - - memset(YData, 0, sizeof(PRUint32) * STGD_SPACE_X); - - /* - ** Initialize our Y data. - ** Pretty brutal loop here.... - */ - for (traverse = 0; 0 == retval && traverse < STGD_SPACE_X; - traverse++) { - /* - ** Compute what timeval this Y data lands in. - */ - prevTimeval = timeval; - timeval = - (traverse * (globals.mMaxTimeval - globals.mMinTimeval)) / - STGD_SPACE_X; - - /* - ** Loop over the run. - ** Should an allocation have lived between - ** prevTimeval and timeval.... - */ - for (loop = 0; loop < aRun->mAllocationCount; loop++) { - lifespan = - aRun->mAllocations[loop]->mMaxTimeval - - aRun->mAllocations[loop]->mMinTimeval; - - if (prevTimeval < lifespan && timeval >= lifespan) { - YData[traverse] += - byteSize(&inRequest->mOptions, - aRun->mAllocations[loop]); - } - } - } - - /* - ** Did we cache this? - */ - if (YData == inRequest->mContext->mLifespanYData) { - inRequest->mContext->mLifespanCached = PR_TRUE; - } - } - - /* - ** Done with the lock. - */ - if (PR_FALSE != underLock) { - PR_Unlock(inRequest->mContext->mImageLock); - } - - if (0 == retval) { - PRUint32 minMemory = (PRUint32) - 1; - PRUint32 maxMemory = 0; - int transparent = 0; - gdImagePtr graph = NULL; - - /* - ** Go through and find the minimum and maximum sizes. - */ - for (traverse = 0; traverse < STGD_SPACE_X; traverse++) { - if (YData[traverse] < minMemory) { - minMemory = YData[traverse]; - } - if (YData[traverse] > maxMemory) { - maxMemory = YData[traverse]; - } - } - - /* - ** We can now draw the graph. - */ - graph = createGraph(&transparent); - if (NULL != graph) { - gdSink theSink; - int red = 0; - int x1 = 0; - int y1 = 0; - int x2 = 0; - int y2 = 0; - PRUint32 percents[11] = - { 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; - char *timevals[11]; - char *bytes[11]; - char timevalSpace[11][32]; - char byteSpace[11][32]; - int legendColors[1]; - const char *legends[1] = { "Live Memory" }; - PRUint32 cached = 0; - - /* - ** Figure out what the labels will say. - */ - for (traverse = 0; traverse < 11; traverse++) { - timevals[traverse] = timevalSpace[traverse]; - bytes[traverse] = byteSpace[traverse]; - - cached = - ((globals.mMaxTimeval - - globals.mMinTimeval) * percents[traverse]) / 100; - PR_snprintf(timevals[traverse], 32, ST_TIMEVAL_FORMAT, - ST_TIMEVAL_PRINTABLE(cached)); - PR_snprintf(bytes[traverse], 32, "%u", - ((maxMemory - - minMemory) * percents[traverse]) / 100); - } - - red = gdImageColorAllocate(graph, 255, 0, 0); - legendColors[0] = red; - - drawGraph(graph, -1, "Allocation Lifespans", "Lifespan", - "Bytes", 11, percents, (const char **) timevals, 11, - percents, (const char **) bytes, 1, legendColors, - legends); - - if (maxMemory != minMemory) { - PRInt64 in64 = LL_INIT(0, 0); - PRInt64 ydata64 = LL_INIT(0, 0); - PRInt64 spacey64 = LL_INIT(0, 0); - PRInt64 mem64 = LL_INIT(0, 0); - PRInt32 in32 = 0; - - /* - ** Go through our Y data and mark it up. - */ - for (traverse = 0; traverse < STGD_SPACE_X; traverse++) { - x1 = traverse + STGD_MARGIN; - y1 = STGD_HEIGHT - STGD_MARGIN; - - /* - ** Need to do this math in 64 bits. - */ - LL_I2L(ydata64, YData[traverse]); - LL_I2L(spacey64, STGD_SPACE_Y); - LL_I2L(mem64, (maxMemory - minMemory)); - - LL_MUL(in64, ydata64, spacey64); - LL_DIV(in64, in64, mem64); - LL_L2I(in32, in64); - - x2 = x1; - y2 = y1 - in32; - - gdImageLine(graph, x1, y1, x2, y2, red); - } - } - - - theSink.context = inRequest->mFD; - theSink.sink = pngSink; - gdImagePngToSink(graph, &theSink); - - gdImageDestroy(graph); - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, createGraph); - } - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, graphLifespan); - } - - return retval; -} -#endif /* ST_WANT_GRAPHS */ - -#if ST_WANT_GRAPHS -/* -** graphWeight -** -** Output a PNG graph of Allocations by Weight -** -** Draw the graph within these boundaries. -** STGD_MARGIN,STGD_MARGIN,STGD_WIDTH-STGD_MARGIN,STGD_HEIGHT-STGD_MARGIN -** -** Returns !0 on failure. -*/ -int -graphWeight(STRequest * inRequest, STRun * aRun) -{ - int retval = 0; - - if (NULL != aRun) { - PRUint64 *YData64 = NULL; - PRUint64 YDataArray64[STGD_SPACE_X]; - PRUint32 traverse = 0; - PRUint32 timeval = globals.mMinTimeval; - PRUint32 loop = 0; - PRBool underLock = PR_FALSE; - - /* - ** Decide if this is custom or we should use the global cache. - */ - if (aRun == inRequest->mContext->mSortedRun) { - YData64 = inRequest->mContext->mWeightYData64; - underLock = PR_TRUE; - } - else { - YData64 = YDataArray64; - } - - /* - ** Protect the shared data so that only one client has access to it - ** at any given time. - */ - if (PR_FALSE != underLock) { - PR_Lock(inRequest->mContext->mImageLock); - } - - /* - ** Only do the computations if we aren't cached already. - */ - if (YData64 != inRequest->mContext->mWeightYData64 - || PR_FALSE == inRequest->mContext->mWeightCached) { - PRUint32 prevTimeval = 0; - - memset(YData64, 0, sizeof(PRUint64) * STGD_SPACE_X); - - /* - ** Initialize our Y data. - ** Pretty brutal loop here.... - */ - for (traverse = 0; 0 == retval && traverse < STGD_SPACE_X; - traverse++) { - /* - ** Compute what timeval this Y data lands in. - */ - prevTimeval = timeval; - timeval = - ((traverse * - (globals.mMaxTimeval - - globals.mMinTimeval)) / STGD_SPACE_X) + - globals.mMinTimeval; - - /* - ** Loop over the run. - ** Should an allocation have been allocated between - ** prevTimeval and timeval.... - */ - for (loop = 0; loop < aRun->mAllocationCount; loop++) { - if (prevTimeval < aRun->mAllocations[loop]->mMinTimeval - && timeval >= aRun->mAllocations[loop]->mMinTimeval) { - PRUint64 size64 = LL_INIT(0, 0); - PRUint64 lifespan64 = LL_INIT(0, 0); - PRUint64 weight64 = LL_INIT(0, 0); - - LL_UI2L(size64, - byteSize(&inRequest->mOptions, - aRun->mAllocations[loop])); - LL_UI2L(lifespan64, - (aRun->mAllocations[loop]->mMaxTimeval - - aRun->mAllocations[loop]->mMinTimeval)); - LL_MUL(weight64, size64, lifespan64); - - LL_ADD(YData64[traverse], YData64[traverse], - weight64); - } - } - } - - /* - ** Did we cache this? - */ - if (YData64 == inRequest->mContext->mWeightYData64) { - inRequest->mContext->mWeightCached = PR_TRUE; - } - } - - /* - ** Done with the lock. - */ - if (PR_FALSE != underLock) { - PR_Unlock(inRequest->mContext->mImageLock); - } - - if (0 == retval) { - PRUint64 minWeight64 = LL_INIT(0xFFFFFFFF, 0xFFFFFFFF); - PRUint64 maxWeight64 = LL_INIT(0, 0); - int transparent = 0; - gdImagePtr graph = NULL; - - /* - ** Go through and find the minimum and maximum weights. - */ - for (traverse = 0; traverse < STGD_SPACE_X; traverse++) { - if (LL_UCMP(YData64[traverse], <, minWeight64)) { - minWeight64 = YData64[traverse]; - } - if (LL_UCMP(YData64[traverse], >, maxWeight64)) { - maxWeight64 = YData64[traverse]; - } - } - - /* - ** We can now draw the graph. - */ - graph = createGraph(&transparent); - if (NULL != graph) { - gdSink theSink; - int red = 0; - int x1 = 0; - int y1 = 0; - int x2 = 0; - int y2 = 0; - PRUint32 percents[11] = - { 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; - char *timevals[11]; - char *bytes[11]; - char timevalSpace[11][32]; - char byteSpace[11][32]; - int legendColors[1]; - const char *legends[1] = { "Memory Weight" }; - PRUint64 percent64 = LL_INIT(0, 0); - PRUint64 result64 = LL_INIT(0, 0); - PRUint64 hundred64 = LL_INIT(0, 0); - PRUint32 cached = 0; - - LL_UI2L(hundred64, 100); - - /* - ** Figure out what the labels will say. - */ - for (traverse = 0; traverse < 11; traverse++) { - timevals[traverse] = timevalSpace[traverse]; - bytes[traverse] = byteSpace[traverse]; - - cached = - ((globals.mMaxTimeval - - globals.mMinTimeval) * percents[traverse]) / 100; - PR_snprintf(timevals[traverse], 32, ST_TIMEVAL_FORMAT, - ST_TIMEVAL_PRINTABLE(cached)); - - LL_UI2L(percent64, percents[traverse]); - LL_SUB(result64, maxWeight64, minWeight64); - LL_MUL(result64, result64, percent64); - LL_DIV(result64, result64, hundred64); - PR_snprintf(bytes[traverse], 32, "%llu", result64); - } - - red = gdImageColorAllocate(graph, 255, 0, 0); - legendColors[0] = red; - - drawGraph(graph, -1, "Allocation Weights", "Seconds", - "Weight", 11, percents, (const char **) timevals, - 11, percents, (const char **) bytes, 1, - legendColors, legends); - - if (LL_NE(maxWeight64, minWeight64)) { - PRInt64 in64 = LL_INIT(0, 0); - PRInt64 spacey64 = LL_INIT(0, 0); - PRInt64 weight64 = LL_INIT(0, 0); - PRInt32 in32 = 0; - - /* - ** Go through our Y data and mark it up. - */ - for (traverse = 0; traverse < STGD_SPACE_X; traverse++) { - x1 = traverse + STGD_MARGIN; - y1 = STGD_HEIGHT - STGD_MARGIN; - - /* - ** Need to do this math in 64 bits. - */ - LL_I2L(spacey64, STGD_SPACE_Y); - LL_SUB(weight64, maxWeight64, minWeight64); - - LL_MUL(in64, YData64[traverse], spacey64); - LL_DIV(in64, in64, weight64); - LL_L2I(in32, in64); - - x2 = x1; - y2 = y1 - in32; - - gdImageLine(graph, x1, y1, x2, y2, red); - } - } - - - theSink.context = inRequest->mFD; - theSink.sink = pngSink; - gdImagePngToSink(graph, &theSink); - - gdImageDestroy(graph); - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, createGraph); - } - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, graphWeight); - } - - return retval; -} -#endif /* ST_WANT_GRAPHS */ - -#define ST_WEB_OPTION_BOOL(option_name, option_genre, option_help) \ - { \ - PRUint32 convert = (PRUint32)outOptions->m##option_name; \ - \ - getDataPRUint32(inFormData, #option_name, 1, &convert, 1); \ - outOptions->m##option_name = (PRBool)convert; \ - } -#define ST_WEB_OPTION_STRING(option_name, option_genre, default_value, option_help) \ - getDataString(inFormData, #option_name, 1, outOptions->m##option_name, sizeof(outOptions->m##option_name)); -#define ST_WEB_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) \ - { \ - PRUint32 loop = 0; \ - PRUint32 found = 0; \ - char buffer[ST_OPTION_STRING_MAX]; \ - \ - for(loop = 0; loop < array_size; loop++) \ - { \ - buffer[0] = '\0'; \ - getDataString(inFormData, #option_name, (loop + 1), buffer, sizeof(buffer)); \ - \ - if('\0' != buffer[0]) \ - { \ - PR_snprintf(outOptions->m##option_name[found], sizeof(outOptions->m##option_name[found]), "%s", buffer); \ - found++; \ - } \ - } \ - \ - for(; found < array_size; found++) \ - { \ - outOptions->m##option_name[found][0] = '\0'; \ - } \ - } -#define ST_WEB_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) /* no implementation */ -#define ST_WEB_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) \ - getDataPRUint32(inFormData, #option_name, 1, &outOptions->m##option_name, multiplier); -#define ST_WEB_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) \ - { \ - PRUint64 mul64 = multiplier; \ - \ - getDataPRUint64(inFormData, #option_name, 1, &outOptions->m##option_name##64, mul64); \ - } -/* -** fillOptions -** -** Given an appropriate hexcaped string, distill the option values -** and fill the given STOption struct. -** -** Note that the options passed in are not touched UNLESS there is -** a replacement found in the form data. -*/ -void -fillOptions(STOptions * outOptions, const FormData * inFormData) -{ - if (NULL != outOptions && NULL != inFormData) { - -#include "stoptions.h" - - /* - ** Special sanity check here for some options that need data validation. - */ - if (!outOptions->mCategoryName[0] - || !findCategoryNode(outOptions->mCategoryName, &globals)) { - PR_snprintf(outOptions->mCategoryName, - sizeof(outOptions->mCategoryName), "%s", - ST_ROOT_CATEGORY_NAME); - } - } -} - - -void -displayOptionString(STRequest * inRequest, - const char *option_name, - const char *option_genre, - const char *default_value, - const char *option_help, const char *value) -{ -#if 0 - PR_fprintf(inRequest->mFD, "\n", option_name); -#endif - PR_fprintf(inRequest->mFD, "
\n"); - PR_fprintf(inRequest->mFD, "

%s

\n", option_name); - PR_fprintf(inRequest->mFD, - "\n", - option_name, value); - PR_fprintf(inRequest->mFD, - "

Default value is \"%s\".

\n

%s

\n", - default_value, option_help); - PR_fprintf(inRequest->mFD, "
\n"); -} - -static void -displayOptionStringArray(STRequest * inRequest, - const char *option_name, - const char *option_genre, - PRUint32 array_size, - const char *option_help, const char values[5] - [ST_OPTION_STRING_MAX]) -{ - /* values should not be a fixed length! */ - PR_ASSERT(array_size == 5); -#if 0 - PR_fprintf(inRequest->mFD, "\n", option_name); -#endif - PR_fprintf(inRequest->mFD, "
\n"); - PR_fprintf(inRequest->mFD, "

%s

\n", option_name); { - PRUint32 loop = 0; - - for (loop = 0; loop < array_size; loop++) { - PR_fprintf(inRequest->mFD, - "
\n", - option_name, values[loop]); - } - } - PR_fprintf(inRequest->mFD, - "

Up to %u occurrences allowed.

\n

%s

\n", - array_size, option_help); - PR_fprintf(inRequest->mFD, "
\n"); -} - -static void -displayOptionInt(STRequest * inRequest, - const char *option_name, - const char *option_genre, - PRUint32 default_value, - PRUint32 multiplier, const char *option_help, PRUint32 value) -{ -#if 0 - PR_fprintf(inRequest->mFD, "\n", option_name); -#endif - PR_fprintf(inRequest->mFD, "
\n"); - PR_fprintf(inRequest->mFD, "

%s

\n", option_name); - PR_fprintf(inRequest->mFD, - "\n", option_name, - value / multiplier); - PR_fprintf(inRequest->mFD, - "

Default value is %u.

\n

%s

\n", - default_value, option_help); - PR_fprintf(inRequest->mFD, "
\n"); -} - -static void -displayOptionInt64(STRequest * inRequest, - const char *option_name, - const char *option_genre, - PRUint64 default_value, - PRUint64 multiplier, - const char *option_help, PRUint64 value) -{ -#if 0 - PR_fprintf(inRequest->mFD, "\n", option_name); -#endif - PR_fprintf(inRequest->mFD, "
\n"); - PR_fprintf(inRequest->mFD, "

%s

\n", option_name); { - PRUint64 def64 = default_value; - PRUint64 mul64 = multiplier; - PRUint64 div64; - - LL_DIV(div64, value, mul64); - PR_fprintf(inRequest->mFD, - "\n", - option_name, div64); - PR_fprintf(inRequest->mFD, - "

Default value is %llu.

\n

%s

\n", - def64, option_help); - } - PR_fprintf(inRequest->mFD, "
\n"); -} - -/* -** displaySettings -** -** Present the settings for change during execution. -*/ -void -displaySettings(STRequest * inRequest) -{ - int applyRes = 0; - - /* - ** We've got a form to create. - */ - PR_fprintf(inRequest->mFD, "
\n"); - /* - ** Respect newlines in help text. - */ -#if 0 - PR_fprintf(inRequest->mFD, "
\n");
-#endif
-#define ST_WEB_OPTION_BOOL(option_name, option_genre, option_help) \
-    displayOptionBool(option_name, option_genre, option_help)
-#define ST_WEB_OPTION_STRING(option_name, option_genre, default_value, option_help) \
-    displayOptionString(inRequest, #option_name, #option_genre, default_value, option_help, inRequest->mOptions.m##option_name);
-#define ST_WEB_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) \
-    displayOptionStringArray(inRequest, #option_name, #option_genre, array_size, option_help, inRequest->mOptions.m##option_name);
-#define ST_WEB_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help)  /* no implementation */
-#define ST_WEB_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) \
-    displayOptionInt(inRequest, #option_name, #option_genre, default_value, multiplier, option_help, inRequest->mOptions.m##option_name);
-#define ST_WEB_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) \
-    displayOptionInt64(inRequest, #option_name, #option_genre, default_value, multiplier, option_help, inRequest->mOptions.m##option_name##64);
-#include "stoptions.h"
-    /*
-     **  Give a submit/reset button, obligatory.
-     **  Done respecting newlines in help text.
-     */
-    PR_fprintf(inRequest->mFD,
-               " \n");
-#if 0
-    PR_fprintf(inRequest->mFD, "
\n"); -#endif - /* - ** Done with form. - */ - PR_fprintf(inRequest->mFD, "
\n"); -} - -int -handleLocalFile(STRequest * inRequest, const char *aFilename) -{ - static const char *const local_files[] = { - "spacetrace.css", - }; - static const size_t local_file_count = - sizeof(local_files) / sizeof(local_files[0]); - size_t i; - - for (i = 0; i < local_file_count; i++) { - if (0 == strcmp(local_files[i], aFilename)) - return 1; - } - return 0; -} - -/* -** displayFile -** -** reads a file from disk, and streams it to the request -*/ -int -displayFile(STRequest * inRequest, const char *aFilename) -{ - PRFileDesc *inFd; - const char *filepath = - PR_smprintf("res%c%s", PR_GetDirectorySeparator(), aFilename); - char buffer[2048]; - PRInt32 readRes; - - inFd = PR_Open(filepath, PR_RDONLY, PR_IRUSR); - if (!inFd) - return -1; - while ((readRes = PR_Read(inFd, buffer, sizeof(buffer))) > 0) { - PR_Write(inRequest->mFD, buffer, readRes); - } - if (readRes != 0) - return -1; - PR_Close(inFd); - return 0; -} - -/* -** displayIndex -** -** Present a list of the reports you can drill down into. -** Returns !0 on failure. -*/ -int -displayIndex(STRequest * inRequest) -{ - int retval = 0; - STOptions *options = &inRequest->mOptions; - - /* - ** Present reports in a list format. - */ - PR_fprintf(inRequest->mFD, "
    "); - PR_fprintf(inRequest->mFD, "\n
  • "); - htmlAnchor(inRequest, "root_callsites.html", "Root Callsites", - NULL, "mainmenu", options); - PR_fprintf(inRequest->mFD, "\n
  • "); - htmlAnchor(inRequest, "categories_summary.html", - "Categories Report", NULL, "mainmenu", options); - PR_fprintf(inRequest->mFD, "\n
  • "); - htmlAnchor(inRequest, "top_callsites.html", - "Top Callsites Report", NULL, "mainmenu", options); - PR_fprintf(inRequest->mFD, "\n
  • "); - htmlAnchor(inRequest, "top_allocations.html", - "Top Allocations Report", NULL, "mainmenu", options); - PR_fprintf(inRequest->mFD, "\n
  • "); - htmlAnchor(inRequest, "memory_leaks.html", - "Memory Leak Report", NULL, "mainmenu", options); -#if ST_WANT_GRAPHS - PR_fprintf(inRequest->mFD, "\n
  • Graphs"); - PR_fprintf(inRequest->mFD, "
      "); - PR_fprintf(inRequest->mFD, "\n
    • "); - htmlAnchor(inRequest, "footprint_graph.html", "Footprint", - NULL, "mainmenu graph", options); - PR_fprintf(inRequest->mFD, "\n
    • "); - htmlAnchor(inRequest, "lifespan_graph.html", - "Allocation Lifespans", NULL, "mainmenu graph", options); - PR_fprintf(inRequest->mFD, "\n
    • "); - htmlAnchor(inRequest, "times_graph.html", "Allocation Times", - NULL, "mainmenu graph", options); - PR_fprintf(inRequest->mFD, "\n
    • "); - htmlAnchor(inRequest, "weight_graph.html", - "Allocation Weights", NULL, "mainmenu graph", options); - PR_fprintf(inRequest->mFD, "\n
    \n"); -#endif /* ST_WANT_GRAPHS */ - PR_fprintf(inRequest->mFD, "\n
\n"); - return retval; -} - -/* -** initRequestOptions -** -** Given the request, set the options that are specific to the request. -** These can generally be determined in the following manner: -** Copy over global options. -** If getData present, attempt to use options therein. -*/ -void -initRequestOptions(STRequest * inRequest) -{ - if (NULL != inRequest) { - /* - ** Copy of global options. - */ - memcpy(&inRequest->mOptions, &globals.mCommandLineOptions, - sizeof(globals.mCommandLineOptions)); - /* - ** Decide what will override global options if anything. - */ - if (NULL != inRequest->mGetData) { - fillOptions(&inRequest->mOptions, inRequest->mGetData); - } - } -} - -STContext * -contextLookup(STOptions * inOptions) -/* -** Lookup a context that matches the options. -** The lookup may block, especially if the context needs to be created. -** Callers of this API must eventually call contextRelease with the -** return value; failure to do so will cause this applications -** to eventually not work as advertised. -** -** inOptions The options determine which context is relevant. -** returns The fully completed context on success. -** The context is read only in practice, so please do not -** write to it or anything it points to. -** NULL on failure. -*/ -{ - STContext *retval = NULL; - STContextCache *inCache = &globals.mContextCache; - - if (NULL != inOptions && NULL != inCache) { - PRUint32 loop = 0; - STContext *categoryException = NULL; - PRBool newContext = PR_FALSE; - PRBool evictContext = PR_FALSE; - PRBool changeCategoryContext = PR_FALSE; - - /* - ** Own the context cache while we are in here. - */ - PR_Lock(inCache->mLock); - /* - ** Loop until successful. - ** Waiting on the condition variable makes sure we don't hog the - ** lock below. - */ - while (1) { - /* - ** Go over the cache items. - ** At this point we are looking for a cache hit, with multiple - ** readers. - */ - for (loop = 0; loop < inCache->mItemCount; loop++) { - /* - ** Must be in use. - */ - if (PR_FALSE != inCache->mItems[loop].mInUse) { - int delta[(STOptionGenre) MaxGenres]; - - /* - ** Compare the relevant options, figure out if different - ** in any genre that we care about. - */ - memset(&delta, 0, sizeof(delta)); -#define ST_WEB_OPTION_BOOL(option_name, option_genre, option_help) \ - if(inOptions->m##option_name != inCache->mItems[loop].mOptions.m##option_name) \ - { \ - delta[(STOptionGenre)option_genre]++; \ - } -#define ST_WEB_OPTION_STRING(option_name, option_genre, default_value, option_help) \ - if(0 != strcmp(inOptions->m##option_name, inCache->mItems[loop].mOptions.m##option_name)) \ - { \ - delta[(STOptionGenre)option_genre]++; \ - } -#define ST_WEB_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) \ - { \ - PRUint32 macro_loop = 0; \ - \ - for(macro_loop = 0; macro_loop < array_size; macro_loop++) \ - { \ - if(0 != strcmp(inOptions->m##option_name[macro_loop], inCache->mItems[loop].mOptions.m##option_name[macro_loop])) \ - { \ - break; \ - } \ - } \ - \ - if(macro_loop != array_size) \ - { \ - delta[(STOptionGenre)option_genre]++; \ - } \ - } -#define ST_WEB_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) /* no implementation */ -#define ST_WEB_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) \ - if(inOptions->m##option_name != inCache->mItems[loop].mOptions.m##option_name) \ - { \ - delta[(STOptionGenre)option_genre]++; \ - } -#define ST_WEB_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) \ - if(LL_NE(inOptions->m##option_name##64, inCache->mItems[loop].mOptions.m##option_name##64)) \ - { \ - delta[(STOptionGenre)option_genre]++; \ - } -#include "stoptions.h" - /* - ** If there is no genre out of alignment, we accept this as the context. - */ - if (0 == delta[CategoryGenre] && - 0 == delta[DataSortGenre] && - 0 == delta[DataSetGenre] && 0 == delta[DataSizeGenre] - ) { - retval = &inCache->mItems[loop].mContext; - break; - } - - /* - ** A special exception to the rule here. - ** If all that is different is the category genre, and there - ** is no one looking at the context (zero ref count), - ** then there is some magic we can perform. - */ - if (NULL == retval && - 0 == inCache->mItems[loop].mReferenceCount && - 0 != delta[CategoryGenre] && - 0 == delta[DataSortGenre] && - 0 == delta[DataSetGenre] && 0 == delta[DataSizeGenre] - ) { - categoryException = &inCache->mItems[loop].mContext; - } - } - } - - /* - ** Pick up our category exception if relevant. - */ - if (NULL == retval && NULL != categoryException) { - retval = categoryException; - categoryException = NULL; - changeCategoryContext = PR_TRUE; - } - - /* - ** If we don't have a cache hit, then we need to check for an empty - ** spot to take over. - */ - if (NULL == retval) { - for (loop = 0; loop < inCache->mItemCount; loop++) { - /* - ** Must NOT be in use, then it will be the context. - */ - if (PR_FALSE == inCache->mItems[loop].mInUse) { - retval = &inCache->mItems[loop].mContext; - newContext = PR_TRUE; - break; - } - } - } - - /* - ** If we still don't have a return value, then we need to see if - ** there are any old items with zero ref counts that we - ** can take over. - */ - if (NULL == retval) { - for (loop = 0; loop < inCache->mItemCount; loop++) { - /* - ** Must be in use. - */ - if (PR_FALSE != inCache->mItems[loop].mInUse) { - /* - ** Must have a ref count of zero. - */ - if (0 == inCache->mItems[loop].mReferenceCount) { - /* - ** Must be older than any other we know of. - */ - if (NULL != retval) { - if (inCache->mItems[loop].mLastAccessed < - inCache->mItems[retval->mIndex]. - mLastAccessed) { - retval = &inCache->mItems[loop].mContext; - } - } - else { - retval = &inCache->mItems[loop].mContext; - } - } - } - } - - if (NULL != retval) { - evictContext = PR_TRUE; - } - } - - /* - ** If we still don't have a return value, then we can not avoid - ** waiting around until someone gives us the chance. - ** The chance, in specific, comes when a cache item reference - ** count returns to zero, upon which we can try to take - ** it over again. - */ - if (NULL == retval) { - /* - ** This has the side effect of release the context lock. - ** This is a good thing so that other clients can continue - ** to connect and hopefully have cache hits. - ** If they do not have cache hits, then we will end up - ** with a bunch of waiters here.... - */ - PR_WaitCondVar(inCache->mCacheMiss, PR_INTERVAL_NO_TIMEOUT); - } - - /* - ** If we have a return value, improve the reference count here. - */ - if (NULL != retval) { - /* - ** Decide if there are any changes to be made. - ** Do as little as possible, then fall through the context - ** cache lock to finish up. - ** This way, lengthy init operations will not block - ** other clients, only matches to this context. - */ - if (PR_FALSE != newContext || - PR_FALSE != evictContext || - PR_FALSE != changeCategoryContext) { - /* - ** Overwrite the prefs for this context. - ** They are changing. - */ - memcpy(&inCache->mItems[retval->mIndex].mOptions, - inOptions, - sizeof(inCache->mItems[retval->mIndex].mOptions)); - /* - ** As we are going to be changing the context, we need to write lock it. - ** This makes sure no readers are allowed while we are making our changes. - */ - PR_RWLock_Wlock(retval->mRWLock); - } - - /* - ** NOTE, ref count gets incremented here, inside content - ** cache lock so it can not be flushed once lock - ** released. - */ - inCache->mItems[retval->mIndex].mInUse = PR_TRUE; - inCache->mItems[retval->mIndex].mReferenceCount++; - /* - ** That's all folks. - */ - break; - } - - } /* while(1), try again */ - - /* - ** Done with context cache. - */ - PR_Unlock(inCache->mLock); - /* - ** Now that the context cached is free to continue accepting other - ** requests, we have a little more work to do. - */ - if (NULL != retval) { - PRBool unlock = PR_FALSE; - - /* - ** If evicting, we need to free off the old stuff. - */ - if (PR_FALSE != evictContext) { - unlock = PR_TRUE; - /* - ** We do not free the sorted run. - ** The category code takes care of this. - */ - retval->mSortedRun = NULL; -#if ST_WANT_GRAPHS - /* - ** There is no need to - ** PR_Lock(retval->mImageLock) - ** We are already under write lock for the entire structure. - */ - retval->mFootprintCached = PR_FALSE; - retval->mTimevalCached = PR_FALSE; - retval->mLifespanCached = PR_FALSE; - retval->mWeightCached = PR_FALSE; -#endif - } - - /* - ** If new or recently evicted, we need to fully init. - */ - if (PR_FALSE != newContext || PR_FALSE != evictContext) { - unlock = PR_TRUE; - retval->mSortedRun = - createRunFromGlobal(&inCache->mItems[retval->mIndex]. - mOptions, - &inCache->mItems[retval->mIndex]. - mContext); - } - - /* - ** If changing category, we need to do some sneaky stuff. - */ - if (PR_FALSE != changeCategoryContext) { - STCategoryNode *node = NULL; - - unlock = PR_TRUE; - /* - ** Just a category change. We dont need to harvest. Just find the - ** right node and set the cache.mSortedRun. We need to recompute - ** cost though. But that is cheap. - */ - node = - findCategoryNode(inCache->mItems[retval->mIndex].mOptions. - mCategoryName, &globals); - if (node) { - /* Recalculate cost of run */ - recalculateRunCost(&inCache->mItems[retval->mIndex]. - mOptions, retval, - node->runs[retval->mIndex]); - retval->mSortedRun = node->runs[retval->mIndex]; - } - -#if ST_WANT_GRAPHS - /* - ** There is no need to - ** PR_Lock(retval->mImageLock) - ** We are already under write lock for the entire structure. - */ - retval->mFootprintCached = PR_FALSE; - retval->mTimevalCached = PR_FALSE; - retval->mLifespanCached = PR_FALSE; - retval->mWeightCached = PR_FALSE; -#endif - } - - /* - ** Release the write lock if we took one to make changes. - */ - if (PR_FALSE != unlock) { - PR_RWLock_Unlock(retval->mRWLock); - } - - /* - ** Last thing possible, take a read lock on our return value. - ** This will cause us to block if the context is not fully - ** initialized in another thread holding the write lock. - */ - PR_RWLock_Rlock(retval->mRWLock); - } - } - - return retval; -} - -void -contextRelease(STContext * inContext) -/* -** After a successful call to contextLookup, one should call this API when -** done with the context. -** This effectively removes the usage of the client on a cached item. -*/ -{ - STContextCache *inCache = &globals.mContextCache; - - if (NULL != inContext && NULL != inCache) { - /* - ** Own the context cache while in here. - */ - PR_Lock(inCache->mLock); - /* - ** Give up the read lock on the context. - */ - PR_RWLock_Unlock(inContext->mRWLock); - /* - ** Decrement the reference count on the context. - ** If it was the last reference, notify that a new item is - ** available for eviction. - ** A waiting thread will wake up and eat it. - ** Also set when it was last accessed so the oldest unused item - ** can be targeted for eviction. - */ - inCache->mItems[inContext->mIndex].mReferenceCount--; - if (0 == inCache->mItems[inContext->mIndex].mReferenceCount) { - PR_NotifyCondVar(inCache->mCacheMiss); - inCache->mItems[inContext->mIndex].mLastAccessed = - PR_IntervalNow(); - } - - /* - ** Done with context cache. - */ - PR_Unlock(inCache->mLock); - } -} - - -/* -** handleRequest -** -** Based on what file they are asking for, perform some processing. -** Output the results to aFD. -** -** Returns !0 on error. -*/ -int -handleRequest(tmreader * aTMR, PRFileDesc * aFD, - const char *aFileName, const FormData * aGetData) -{ - int retval = 0; - - if (NULL != aTMR && NULL != aFD && NULL != aFileName - && '\0' != *aFileName) { - STRequest request; - - /* - ** Init the request. - */ - memset(&request, 0, sizeof(request)); - request.mFD = aFD; - request.mGetFileName = aFileName; - request.mGetData = aGetData; - /* - ** Set local options for this request. - */ - initRequestOptions(&request); - /* - ** Get our cached context for this client. - ** Simply based on the options. - */ - request.mContext = contextLookup(&request.mOptions); - if (NULL != request.mContext) { - /* - ** Attempt to find the file of interest. - */ - if (handleLocalFile(&request, aFileName)) { - displayFile(&request, aFileName); - } - else if (0 == strcmp("index.html", aFileName)) { - int displayRes = 0; - - htmlHeader(&request, "SpaceTrace Index"); - displayRes = displayIndex(&request); - if (0 != displayRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayIndex); - } - - htmlFooter(&request); - } - else if (0 == strcmp("settings.html", aFileName) || - 0 == strcmp("options.html", aFileName)) { - htmlHeader(&request, "SpaceTrace Options"); - displaySettings(&request); - htmlFooter(&request); - } - else if (0 == strcmp("top_allocations.html", aFileName)) { - int displayRes = 0; - - htmlHeader(&request, "SpaceTrace Top Allocations Report"); - displayRes = - displayTopAllocations(&request, - request.mContext->mSortedRun, - "top-allocations", - "SpaceTrace Top Allocations Report", - 1); - if (0 != displayRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayTopAllocations); - } - - htmlFooter(&request); - } - else if (0 == strcmp("top_callsites.html", aFileName)) { - int displayRes = 0; - tmcallsite **array = NULL; - PRUint32 arrayCount = 0; - - /* - ** Display header after we figure out if we are going to focus - ** on a category. - */ - htmlHeader(&request, "SpaceTrace Top Callsites Report"); - if (NULL != request.mContext->mSortedRun - && 0 < request.mContext->mSortedRun->mAllocationCount) { - arrayCount = - callsiteArrayFromRun(&array, 0, - request.mContext->mSortedRun); - if (0 != arrayCount && NULL != array) { - displayRes = - displayTopCallsites(&request, array, arrayCount, - 0, - "top-callsites", - "Top Callsites Report", - 0); - if (0 != displayRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayTopCallsites); - } - - /* - ** Done with the array. - */ - free(array); - array = NULL; - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, handleRequest); - } - - htmlFooter(&request); - } - else if (0 == strcmp("memory_leaks.html", aFileName)) { - int displayRes = 0; - - htmlHeader(&request, "SpaceTrace Memory Leaks Report"); - displayRes = - displayMemoryLeaks(&request, - request.mContext->mSortedRun); - if (0 != displayRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayMemoryLeaks); - } - - htmlFooter(&request); - } - else if (0 == strncmp("allocation_", aFileName, 11)) { - int scanRes = 0; - PRUint32 allocationIndex = 0; - - /* - ** Oh, what a hack.... - ** The index to the allocation structure in the global run - ** is in the filename. Better than the pointer value.... - */ - scanRes = PR_sscanf(aFileName + 11, "%u", &allocationIndex); - if (1 == scanRes - && globals.mRun.mAllocationCount > allocationIndex - && NULL != globals.mRun.mAllocations[allocationIndex]) { - STAllocation *allocation = - globals.mRun.mAllocations[allocationIndex]; - char buffer[128]; - int displayRes = 0; - - PR_snprintf(buffer, sizeof(buffer), - "SpaceTrace Allocation %u Details Report", - allocationIndex); - htmlHeader(&request, buffer); - displayRes = - displayAllocationDetails(&request, allocation); - if (0 != displayRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayAllocationDetails); - } - - htmlFooter(&request); - } - else { - htmlNotFound(&request); - } - } - else if (0 == strncmp("callsite_", aFileName, 9)) { - int scanRes = 0; - PRUint32 callsiteSerial = 0; - tmcallsite *resolved = NULL; - - /* - ** Oh, what a hack.... - ** The serial(key) to the callsite structure in the hash table - ** is in the filename. Better than the pointer value.... - */ - scanRes = PR_sscanf(aFileName + 9, "%u", &callsiteSerial); - if (1 == scanRes && 0 != callsiteSerial - && NULL != (resolved = - tmreader_callsite(aTMR, callsiteSerial))) { - char buffer[128]; - int displayRes = 0; - - PR_snprintf(buffer, sizeof(buffer), - "SpaceTrace Callsite %u Details Report", - callsiteSerial); - htmlHeader(&request, buffer); - displayRes = displayCallsiteDetails(&request, resolved); - if (0 != displayRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayAllocationDetails); - } - - htmlFooter(&request); - } - else { - htmlNotFound(&request); - } - } - else if (0 == strcmp("root_callsites.html", aFileName)) { - int displayRes = 0; - - htmlHeader(&request, "SpaceTrace Root Callsites"); - displayRes = - displayCallsites(&request, aTMR->calltree_root.kids, - ST_FOLLOW_SIBLINGS, 0, - "callsites-root", - "SpaceTrace Root Callsites", - __LINE__); - if (0 != displayRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayCallsites); - } - - htmlFooter(&request); - } -#if ST_WANT_GRAPHS - else if (0 == strcmp("footprint_graph.html", aFileName)) { - int displayRes = 0; - - htmlHeader(&request, "SpaceTrace Memory Footprint Report"); - PR_fprintf(request.mFD, "
\n"); - PR_fprintf(request.mFD, "\n"); - PR_fprintf(request.mFD, "
\n"); - htmlFooter(&request); - } -#endif /* ST_WANT_GRAPHS */ -#if ST_WANT_GRAPHS - else if (0 == strcmp("times_graph.html", aFileName)) { - int displayRes = 0; - - htmlHeader(&request, "SpaceTrace Allocation Times Report"); - PR_fprintf(request.mFD, "
\n"); - PR_fprintf(request.mFD, "\n"); - PR_fprintf(request.mFD, "
\n"); - htmlFooter(&request); - } -#endif /* ST_WANT_GRAPHS */ -#if ST_WANT_GRAPHS - else if (0 == strcmp("lifespan_graph.html", aFileName)) { - int displayRes = 0; - - htmlHeader(&request, - "SpaceTrace Allocation Lifespans Report"); - PR_fprintf(request.mFD, "
\n"); - PR_fprintf(request.mFD, "\n"); - PR_fprintf(request.mFD, "
\n"); - htmlFooter(&request); - } -#endif /* ST_WANT_GRAPHS */ -#if ST_WANT_GRAPHS - else if (0 == strcmp("weight_graph.html", aFileName)) { - int displayRes = 0; - - htmlHeader(&request, "SpaceTrace Allocation Weights Report"); - PR_fprintf(request.mFD, "
\n"); - PR_fprintf(request.mFD, "\n"); - PR_fprintf(request.mFD, "
\n"); - htmlFooter(&request); - } -#endif /* ST_WANT_GRAPHS */ -#if ST_WANT_GRAPHS - else if (0 == strcmp("footprint.png", aFileName)) { - int graphRes = 0; - - graphRes = - graphFootprint(&request, request.mContext->mSortedRun); - if (0 != graphRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, graphFootprint); - } - } -#endif /* ST_WANT_GRAPHS */ -#if ST_WANT_GRAPHS - else if (0 == strcmp("times.png", aFileName)) { - int graphRes = 0; - - graphRes = - graphTimeval(&request, request.mContext->mSortedRun); - if (0 != graphRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, graphTimeval); - } - } -#endif /* ST_WANT_GRAPHS */ -#if ST_WANT_GRAPHS - else if (0 == strcmp("lifespan.png", aFileName)) { - int graphRes = 0; - - graphRes = - graphLifespan(&request, request.mContext->mSortedRun); - if (0 != graphRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, graphLifespan); - } - } -#endif /* ST_WANT_GRAPHS */ -#if ST_WANT_GRAPHS - else if (0 == strcmp("weight.png", aFileName)) { - int graphRes = 0; - - graphRes = - graphWeight(&request, request.mContext->mSortedRun); - if (0 != graphRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, graphWeight); - } - } -#endif /* ST_WANT_GRAPHS */ - else if (0 == strcmp("categories_summary.html", aFileName)) { - int displayRes = 0; - - htmlHeader(&request, "Category Report"); - displayRes = - displayCategoryReport(&request, &globals.mCategoryRoot, - 1); - if (0 != displayRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, displayMemoryLeaks); - } - - htmlFooter(&request); - } - else { - htmlNotFound(&request); - } - - /* - ** Release the context we obtained earlier. - */ - contextRelease(request.mContext); - request.mContext = NULL; - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, contextObtain); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, handleRequest); - } - - /* - ** Compact a little if you can after each request. - */ - heapCompact(); - return retval; -} - -/* -** handleClient -** -** main() of the new client thread. -** Read the fd for the request. -** Output the results. -*/ -void -handleClient(void *inArg) -{ - PRFileDesc *aFD = NULL; - - aFD = (PRFileDesc *) inArg; - if (NULL != aFD) { - PRStatus closeRes = PR_SUCCESS; - char aBuffer[2048]; - PRInt32 readRes = 0; - - readRes = PR_Read(aFD, aBuffer, sizeof(aBuffer)); - if (0 <= readRes) { - const char *sanityCheck = "GET /"; - - if (0 == strncmp(sanityCheck, aBuffer, 5)) { - char *eourl = NULL; - char *start = &aBuffer[5]; - char *getData = NULL; - int realFun = 0; - const char *crlf = "\015\012"; - char *eoline = NULL; - FormData *fdGet = NULL; - - /* - ** Truncate the line if possible. - ** Only want first one. - */ - eoline = strstr(aBuffer, crlf); - if (NULL != eoline) { - *eoline = '\0'; - } - - /* - ** Find the whitespace. - ** That is either end of line or the " HTTP/1.x" suffix. - ** We do not care. - */ - for (eourl = start; 0 == isspace(*eourl) && '\0' != *eourl; - eourl++) { - /* - ** No body. - */ - } - - /* - ** Cap it off. - ** Convert empty '/' to index.html. - */ - *eourl = '\0'; - if ('\0' == *start) { - strcpy(start, "index.html"); - } - - /* - ** Have we got any GET form data? - */ - getData = strchr(start, '?'); - if (NULL != getData) { - /* - ** Whack it off. - */ - *getData = '\0'; - getData++; - } - - /* - ** Convert get data into a more useful format. - */ - fdGet = FormData_Create(getData); - /* - ** This is totally a hack, but oh well.... - ** - ** Send that the request was OK, regardless. - ** - ** If we have any get data, then it is a set of options - ** we attempt to apply. - ** - ** Other code will tell the user they were wrong or if - ** there was an error. - ** If the filename contains a ".png", then send the image - ** mime type, otherwise, say it is text/html. - */ - PR_fprintf(aFD, "HTTP/1.1 200 OK%s", crlf); - PR_fprintf(aFD, "Server: %s%s", - "$Id: spacetrace.c,v 1.50 2004-04-25 21:07:16 gerv%gerv.net Exp $", - crlf); - PR_fprintf(aFD, "Content-type: "); - if (NULL != strstr(start, ".png")) { - PR_fprintf(aFD, "image/png"); - } - else if (NULL != strstr(start, ".jpg")) { - PR_fprintf(aFD, "image/jpeg"); - } - else if (NULL != strstr(start, ".txt")) { - PR_fprintf(aFD, "text/plain"); - } - else if (NULL != strstr(start, ".css")) { - PR_fprintf(aFD, "text/css"); - } - else { - PR_fprintf(aFD, "text/html"); - } - PR_fprintf(aFD, crlf); - /* - ** One more to seperate headers from content. - */ - PR_fprintf(aFD, crlf); - /* - ** Ready for the real fun. - */ - realFun = handleRequest(globals.mTMR, aFD, start, fdGet); - if (0 != realFun) { - REPORT_ERROR(__LINE__, handleRequest); - } - - /* - ** Free off get data if around. - */ - FormData_Destroy(fdGet); - fdGet = NULL; - } - else { - REPORT_ERROR(__LINE__, handleClient); - } - } - else { - REPORT_ERROR(__LINE__, lineReader); - } - - /* - ** Done with the connection. - */ - closeRes = PR_Close(aFD); - if (PR_SUCCESS != closeRes) { - REPORT_ERROR(__LINE__, PR_Close); - } - } - else { - REPORT_ERROR(__LINE__, handleClient); - } -} - -/* -** serverMode -** -** List on a port as a httpd. -** Output results interactively on demand. -** -** Returns !0 on error. -*/ -int -serverMode(void) -{ - int retval = 0; - PRFileDesc *socket = NULL; - - /* - ** Create a socket. - */ - socket = PR_NewTCPSocket(); - if (NULL != socket) { - PRStatus closeRes = PR_SUCCESS; - PRNetAddr bindAddr; - PRStatus bindRes = PR_SUCCESS; - - /* - ** Bind it to an interface/port. - ** Any interface. - */ - bindAddr.inet.family = PR_AF_INET; - bindAddr.inet.port = - PR_htons((PRUint16) globals.mCommandLineOptions.mHttpdPort); - bindAddr.inet.ip = PR_htonl(PR_INADDR_ANY); - bindRes = PR_Bind(socket, &bindAddr); - if (PR_SUCCESS == bindRes) { - PRStatus listenRes = PR_SUCCESS; - const int backlog = 0x20; - - /* - ** Start listening for clients. - ** Give a decent backlog, some of our processing will take - ** a bit. - */ - listenRes = PR_Listen(socket, backlog); - if (PR_SUCCESS == listenRes) { - PRFileDesc *connection = NULL; - int failureSum = 0; - char message[80]; - - /* - ** Output a little message saying we are receiving. - */ - PR_snprintf(message, sizeof(message), - "server accepting connections at http://localhost:%u/", - globals.mCommandLineOptions.mHttpdPort); - REPORT_INFO(message); - PR_fprintf(PR_STDOUT, "Peak memory used: %s bytes\n", - FormatNumber(globals.mPeakMemoryUsed)); - PR_fprintf(PR_STDOUT, "Allocations : %s total\n", - FormatNumber(globals.mMallocCount + - globals.mCallocCount + - globals.mReallocCount), - FormatNumber(globals.mFreeCount)); - PR_fprintf(PR_STDOUT, "Breakdown : %s malloc\n", - FormatNumber(globals.mMallocCount)); - PR_fprintf(PR_STDOUT, " %s calloc\n", - FormatNumber(globals.mCallocCount)); - PR_fprintf(PR_STDOUT, " %s realloc\n", - FormatNumber(globals.mReallocCount)); - PR_fprintf(PR_STDOUT, " %s free\n", - FormatNumber(globals.mFreeCount)); - PR_fprintf(PR_STDOUT, "Leaks : %s\n", - FormatNumber((globals.mMallocCount + - globals.mCallocCount + - globals.mReallocCount) - - globals.mFreeCount)); - /* - ** Keep accepting until we know otherwise. - ** - ** We do a thread per connection. - ** Up to the thread to close the connection when done. - ** - ** This is known by me to be suboptimal, and I would rather - ** do a thread pool if it ever becomes a resource issue. - ** Any issues would simply point to a need to get - ** more machines or a beefier machine to handle the - ** requests, as well as a need to do thread pooling and - ** avoid thread creation overhead. - ** The threads are not tracked, except possibly by NSPR - ** itself and PR_Cleanup will wait on them all to exit as - ** user threads so our shared data is valid. - */ - while (0 == retval) { - connection = - PR_Accept(socket, NULL, PR_INTERVAL_NO_TIMEOUT); - if (NULL != connection) { - PRThread *clientThread = NULL; - - /* - ** Thread per connection. - */ - clientThread = PR_CreateThread(PR_USER_THREAD, /* PR_Cleanup sync */ - handleClient, (void *) connection, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, /* IO enabled */ - PR_UNJOINABLE_THREAD, - 0); - if (NULL == clientThread) { - PRStatus closeRes = PR_SUCCESS; - - failureSum += __LINE__; - REPORT_ERROR(__LINE__, PR_Accept); - /* - ** Close the connection as well, no service - */ - closeRes = PR_Close(connection); - if (PR_FAILURE == closeRes) { - REPORT_ERROR(__LINE__, PR_Close); - } - } - } - else { - failureSum += __LINE__; - REPORT_ERROR(__LINE__, PR_Accept); - } - } - - if (0 != failureSum) { - retval = __LINE__; - } - - /* - ** Output a little message saying it is all over. - */ - REPORT_INFO("server no longer accepting connections...."); - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, PR_Listen); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, PR_Bind); - } - - /* - ** Done with socket. - */ - closeRes = PR_Close(socket); - if (PR_SUCCESS != closeRes) { - retval = __LINE__; - REPORT_ERROR(__LINE__, PR_Close); - } - socket = NULL; - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, PR_NewTCPSocket); - } - - return retval; -} - -/* -** batchMode -** -** Perform whatever batch requests we were asked to do. -*/ -int -batchMode(void) -{ - int retval = 0; - - if (0 != globals.mCommandLineOptions.mBatchRequestCount) { - PRUint32 loop = 0; - int failureSum = 0; - int handleRes = 0; - char aFileName[1024]; - PRUint32 sprintfRes = 0; - - /* - ** Go through and process the various files requested. - ** We do not stop on failure, as it is too costly to rerun the - ** batch job. - */ - for (loop = 0; - loop < globals.mCommandLineOptions.mBatchRequestCount; loop++) { - sprintfRes = - PR_snprintf(aFileName, sizeof(aFileName), "%s%c%s", - globals.mCommandLineOptions.mOutputDir, - PR_GetDirectorySeparator(), - globals.mCommandLineOptions.mBatchRequest[loop]); - if ((PRUint32) - 1 != sprintfRes) { - PRFileDesc *outFile = NULL; - - outFile = PR_Open(aFileName, ST_FLAGS, ST_PERMS); - if (NULL != outFile) { - PRStatus closeRes = PR_SUCCESS; - - handleRes = - handleRequest(globals.mTMR, outFile, - globals.mCommandLineOptions. - mBatchRequest[loop], NULL); - if (0 != handleRes) { - failureSum += __LINE__; - REPORT_ERROR(__LINE__, handleRequest); - } - - closeRes = PR_Close(outFile); - if (PR_SUCCESS != closeRes) { - failureSum += __LINE__; - REPORT_ERROR(__LINE__, PR_Close); - } - } - else { - failureSum += __LINE__; - REPORT_ERROR(__LINE__, PR_Open); - } - } - else { - failureSum += __LINE__; - REPORT_ERROR(__LINE__, PR_snprintf); - } - } - - if (0 != failureSum) { - retval = __LINE__; - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, outputReports); - } - - return retval; -} - -/* -** doRun -** -** Perform the actual processing this program requires. -** Returns !0 on failure. -*/ -int -doRun(void) -{ - int retval = 0; - - /* - ** Create the new trace-malloc reader. - */ - globals.mTMR = tmreader_new(globals.mProgramName, NULL); - if (NULL != globals.mTMR) { - int tmResult = 0; - int outputResult = 0; - -#if defined(DEBUG_dp) - PRIntervalTime start = PR_IntervalNow(); - - fprintf(stderr, "DEBUG: reading tracemalloc data...\n"); -#endif - tmResult = - tmreader_eventloop(globals.mTMR, - globals.mCommandLineOptions.mFileName, - tmEventHandler); - printf("\rReading... Done.\n"); -#if defined(DEBUG_dp) - fprintf(stderr, - "DEBUG: reading tracemalloc data ends: %dms [%d allocations]\n", - PR_IntervalToMilliseconds(PR_IntervalNow() - start), - globals.mRun.mAllocationCount); -#endif - if (0 == tmResult) { - REPORT_ERROR(__LINE__, tmreader_eventloop); - retval = __LINE__; - } - - if (0 == retval) { - /* - ** Decide if we're going into batch mode or server mode. - */ - if (0 != globals.mCommandLineOptions.mBatchRequestCount) { - /* - ** Output in one big step while everything still exists. - */ - outputResult = batchMode(); - if (0 != outputResult) { - REPORT_ERROR(__LINE__, batchMode); - retval = __LINE__; - } - } - else { - int serverRes = 0; - - /* - ** httpd time. - */ - serverRes = serverMode(); - if (0 != serverRes) { - REPORT_ERROR(__LINE__, serverMode); - retval = __LINE__; - } - } - - /* - ** Clear our categorization tree - */ - freeCategories(&globals); - } - } - else { - REPORT_ERROR(__LINE__, tmreader_new); - retval = __LINE__; - } - - return retval; -} - -int -initCaches(void) -/* -** Initialize the global caches. -** More involved since we have to allocated/create some objects. -** -** returns Zero if all is well. -** Non-zero on error. -*/ -{ - int retval = 0; - STContextCache *inCache = &globals.mContextCache; - - if (NULL != inCache && 0 != globals.mCommandLineOptions.mContexts) { - inCache->mLock = PR_NewLock(); - if (NULL != inCache->mLock) { - inCache->mCacheMiss = PR_NewCondVar(inCache->mLock); - if (NULL != inCache->mCacheMiss) { - inCache->mItems = - (STContextCacheItem *) calloc(globals.mCommandLineOptions. - mContexts, - sizeof(STContextCacheItem)); - if (NULL != inCache->mItems) { - PRUint32 loop = 0; - char buffer[64]; - - inCache->mItemCount = - globals.mCommandLineOptions.mContexts; - /* - ** Init each item as needed. - */ - for (loop = 0; loop < inCache->mItemCount; loop++) { - inCache->mItems[loop].mContext.mIndex = loop; - PR_snprintf(buffer, sizeof(buffer), - "Context Item %d RW Lock", loop); - inCache->mItems[loop].mContext.mRWLock = - PR_NewRWLock(PR_RWLOCK_RANK_NONE, buffer); - if (NULL == inCache->mItems[loop].mContext.mRWLock) { - break; - } -#if ST_WANT_GRAPHS - inCache->mItems[loop].mContext.mImageLock = - PR_NewLock(); - if (NULL == inCache->mItems[loop].mContext.mImageLock) { - break; - } -#endif - } - - if (loop != inCache->mItemCount) { - retval = __LINE__; - REPORT_ERROR(__LINE__, initCaches); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, calloc); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, PR_NewCondVar); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, PR_NewLock); - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, initCaches); - } - - return retval; -} - -int -destroyCaches(void) -/* -** Clean up any global caches we have laying around. -** -** returns Zero if all is well. -** Non-zero on error. -*/ -{ - int retval = 0; - STContextCache *inCache = &globals.mContextCache; - - if (NULL != inCache) { - PRUint32 loop = 0; - - /* - ** Uninit item data one by one. - */ - for (loop = 0; loop < inCache->mItemCount; loop++) { - if (NULL != inCache->mItems[loop].mContext.mRWLock) { - PR_DestroyRWLock(inCache->mItems[loop].mContext.mRWLock); - inCache->mItems[loop].mContext.mRWLock = NULL; - } -#if ST_WANT_GRAPHS - if (NULL != inCache->mItems[loop].mContext.mImageLock) { - PR_DestroyLock(inCache->mItems[loop].mContext.mImageLock); - inCache->mItems[loop].mContext.mImageLock = NULL; - } -#endif - } - - inCache->mItemCount = 0; - if (NULL != inCache->mItems) { - free(inCache->mItems); - inCache->mItems = NULL; - } - - if (NULL != inCache->mCacheMiss) { - PR_DestroyCondVar(inCache->mCacheMiss); - inCache->mCacheMiss = NULL; - } - - if (NULL != inCache->mLock) { - PR_DestroyLock(inCache->mLock); - inCache->mLock = NULL; - } - } - else { - retval = __LINE__; - REPORT_ERROR(__LINE__, destroyCaches); - } - - return retval; -} - -/* -** main -** -** Process entry and exit. -*/ -int -main(int aArgCount, char **aArgArray) -{ - int retval = 0; - int optionsResult = 0; - PRStatus prResult = PR_SUCCESS; - int showedHelp = 0; - int looper = 0; - int cacheResult = 0; - - /* - ** NSPR init. - */ - PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0); - /* - ** Initialize globals - */ - memset(&globals, 0, sizeof(globals)); - /* - ** Set the program name. - */ - globals.mProgramName = aArgArray[0]; - /* - ** Set the minimum timeval really high so other code - ** that checks the timeval will get it right. - */ - globals.mMinTimeval = ST_TIMEVAL_MAX; - /* - ** Handle initializing options. - */ - optionsResult = initOptions(aArgCount, aArgArray); - if (0 != optionsResult) { - REPORT_ERROR(optionsResult, initOptions); - retval = __LINE__; - } - - /* - ** Initialize our caches. - */ - cacheResult = initCaches(); - if (0 != cacheResult) { - retval = __LINE__; - REPORT_ERROR(__LINE__, initCaches); - } - - /* - ** Small alloc code init. - */ - globals.mCategoryRoot.runs = - (STRun **) calloc(globals.mCommandLineOptions.mContexts, - sizeof(STRun *)); - if (NULL == globals.mCategoryRoot.runs) { - retval = __LINE__; - REPORT_ERROR(__LINE__, calloc); - } - - /* - ** Show help on usage if need be. - */ - showedHelp = showHelp(); - /* - ** Only perform the run if everything is checking out. - */ - if (0 == showedHelp && 0 == retval) { - int runResult = 0; - - runResult = doRun(); - if (0 != runResult) { - REPORT_ERROR(runResult, doRun); - retval = __LINE__; - } - } - - if (0 != retval) { - REPORT_ERROR(retval, main); - } - - /* - ** Have NSPR join all client threads we started. - */ - prResult = PR_Cleanup(); - if (PR_SUCCESS != prResult) { - REPORT_ERROR(retval, PR_Cleanup); - retval = __LINE__; - } - /* - ** All threads are joined/done by this line. - */ - - /* - ** Options allocated a little. - */ -#define ST_CMD_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) \ - if(NULL != globals.mCommandLineOptions.m##option_name) \ - { \ - free((void*)globals.mCommandLineOptions.m##option_name); \ - globals.mCommandLineOptions.m##option_name = NULL; \ - globals.mCommandLineOptions.m##option_name##Count = 0; \ - } -#include "stoptions.h" - - /* - ** globals has a small modification to clear up. - */ - if (NULL != globals.mCategoryRoot.runs) { - free(globals.mCategoryRoot.runs); - globals.mCategoryRoot.runs = NULL; - } - - /* - ** Blow away our caches. - */ - cacheResult = destroyCaches(); - if (0 != cacheResult) { - retval = __LINE__; - REPORT_ERROR(__LINE__, initCaches); - } - - /* - ** We are safe to kill our tmreader data. - */ - if (NULL != globals.mTMR) { - tmreader_destroy(globals.mTMR); - globals.mTMR = NULL; - } - - return retval; -} diff --git a/mozilla/tools/trace-malloc/spacetrace.css b/mozilla/tools/trace-malloc/spacetrace.css deleted file mode 100644 index a37f92f8888..00000000000 --- a/mozilla/tools/trace-malloc/spacetrace.css +++ /dev/null @@ -1,166 +0,0 @@ -body { - margin: 0px; - padding: 0px; - font: Arial, sans-serif; -} - -/* header stuff */ -.spacetrace-header { - color: white; - background: green; -/* min-height: 2em; */ -} - -.spacetrace-title { - font-size: x-large; - font-weight: bold; - padding: 0.5em; -} - -.navigate { -/* background: lightgrey; */ - color: black; - position: absolute; - right: 0px; - margin: 0px; - padding: 2px; -} - -.header-item { - border: 1px outset; - color: ButtonText; - background: ButtonFace; - margin: 0px; - padding: 2px; -} - -.header-item > a { - font-weight: bold; - text-decoration: none; -} - - -.header-item { - font-weight: bold; -} - -.category-title { - font-weight: bold; -} - -/* footer stuff */ -.footer-separator { - border: 1px inset; - display: none; -} - -.footer { - text-align: right; - display: none; -} - -.footer-text { - font-style: italic; -} - -.option-box { - border: solid black; - background: grey; - padding-left: .5em; - padding-right: .5em; - margin: .5em; -} - -.option-name { - font-weight: bold; - margin: 1em; -} - -.option-box input[type=text] -{ - border: inset thin; - padding: 2px; -} - -.option-help { - white-space: pre; - right: 0px; - background: white; - padding: 0.5em; - border: thin inset; -} - -.callsite-header { - padding: 10px; -} -/* data tables */ -#callsite-details { - position: absolute; - right: 1px; - top: 40px; - width: 20%; -} - -#callsites { - width: 75%; - height: 40%; - overflow: scroll; -} - -#caller-stack { - height: 45%; - width: 75%; - overflow: scroll; - padding-top: 5px; -} - -#allocations { - position: absolute; - right: 1px; - bottom: 1px; - height: 40%; - width: 20%; - overflow: scroll; -} - -/* headers at the top of specific call site pages */ - -table.summary { - border: 1px solid black; -} - -/* lists of callsites/etc */ -table.data td { - border-top: 1px solid; - padding: 5px; -} - -table.data { - clear: right; - border-collapse: collapse; -} - -tr.row-header { - background: #009090; - width: 100%; -} - -table.data th { - padding: 5px; - margin: 0px; - text-align: right; -} - -th.callsite { - text-align: left !important; -} - -/* links to source */ -.source-extra { - display: none; -} - -a.source, a.callsite { - text-decoration: none; -} - diff --git a/mozilla/tools/trace-malloc/spacetrace.h b/mozilla/tools/trace-malloc/spacetrace.h deleted file mode 100644 index ebfd32eae1e..00000000000 --- a/mozilla/tools/trace-malloc/spacetrace.h +++ /dev/null @@ -1,728 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is spacetrace.h/spacetrace.c code, released - * Nov 6, 2001. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Garrett Arch Blythe, 31-October-2001 - * Suresh Duddi - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef spacetrace_h__ -#define spacetrace_h__ - -/* -** spacetrace.h -** -** SpaceTrace is meant to take the output of trace-malloc and present -** a picture of allocations over the run of the application. -*/ - -/* -** Required includes. -*/ -#include "nspr.h" -#include "prlock.h" -#include "prrwlock.h" -#include "nsTraceMalloc.h" -#include "tmreader.h" -#include "formdata.h" - -/* -** Turn on to attempt adding support for graphs on your platform. -*/ -#if defined(HAVE_BOUTELL_GD) -#define ST_WANT_GRAPHS 1 -#endif /* HAVE_BOUTELL_GD */ -#if !defined(ST_WANT_GRAPHS) -#define ST_WANT_GRAPHS 0 -#endif - -/* -** REPORT_ERROR -** REPORT_INFO -** -** Just report errors and stuff in a consistent manner. -*/ -#define REPORT_ERROR(code, function) \ - PR_fprintf(PR_STDERR, "error(%d):\t%s\n", code, #function) -#define REPORT_ERROR_MSG(code, msg) \ - PR_fprintf(PR_STDERR, "error(%d):\t%s\n", code, msg) -#define REPORT_INFO(msg) \ - PR_fprintf(PR_STDOUT, "%s: %s\n", globals.mProgramName, (msg)) - -#if defined(DEBUG_blythe) && 1 -#define REPORT_blythe(code, msg) \ - PR_fprintf(PR_STDOUT, "gab(%d):\t%s\n", code, msg) -#else -#define REPORT_blythe(code, msg) -#endif /* DEBUG_blythe */ - -/* -** CALLSITE_RUN -** -** How to get a callsite run. -** Allows for further indirection if needed later. -*/ -#define CALLSITE_RUN(callsite) \ - ((STRun*)((callsite)->data)) - -/* -** ST_PERMS -** ST_FLAGS -** -** File permissions we desire. -** 0644 -*/ -#define ST_PERMS (PR_IRUSR | PR_IWUSR | PR_IRGRP | PR_IROTH) -#define ST_FLAGS (PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE) - -/* -** Sorting order -*/ -#define ST_WEIGHT 0 /* size * timeval */ -#define ST_SIZE 1 -#define ST_TIMEVAL 2 -#define ST_COUNT 3 -#define ST_HEAPCOST 4 - -/* -** Callsite loop direction flags. -*/ -#define ST_FOLLOW_SIBLINGS 0 -#define ST_FOLLOW_PARENTS 1 - -/* -** Graph data. -*/ -#define STGD_WIDTH 640 -#define STGD_HEIGHT 480 -#define STGD_MARGIN 75 -#define STGD_SPACE_X (STGD_WIDTH - (2 * STGD_MARGIN)) -#define STGD_SPACE_Y (STGD_HEIGHT - (2 * STGD_MARGIN)) - -/* -** Minimum lifetime default, in seconds. -*/ -#define ST_DEFAULT_LIFETIME_MIN 10 - -/* -** Allocations fall to this boundry size by default. -** Overhead is taken after alignment. -** -** The msvcrt malloc has an alignment of 16 with an overhead of 8. -** The win32 HeapAlloc has an alignment of 8 with an overhead of 8. -*/ -#define ST_DEFAULT_ALIGNMENT_SIZE 16 -#define ST_DEFAULT_OVERHEAD_SIZE 8 - -/* -** Numer of substring match specifications to allow. -*/ -#define ST_SUBSTRING_MATCH_MAX 5 - -/* -** Max Number of patterns per rule -*/ -#define ST_MAX_PATTERNS_PER_RULE 16 - -/* -** Rule pointers and child pointers are allocated in steps of ST_ALLOC_STEP -*/ -#define ST_ALLOC_STEP 16 - -/* -** Name of the root category. Appears in UI. -*/ -#define ST_ROOT_CATEGORY_NAME "All" - -/* -** Size of our option string buffers. -*/ -#define ST_OPTION_STRING_MAX 256 - -/* -** Set the desired resolution of the timevals. -** The resolution is just mimicking what is recorded in the trace-malloc -** output, and that is currently milliseconds. -*/ -#define ST_TIMEVAL_RESOLUTION 1000 -#define ST_TIMEVAL_FORMAT "%.3f" -#define ST_TIMEVAL_PRINTABLE(timeval) ((PRFloat64)(timeval) / (PRFloat64)ST_TIMEVAL_RESOLUTION) -#define ST_TIMEVAL_PRINTABLE64(timeval) ((PRFloat64)((PRInt64)(timeval)) / (PRFloat64)ST_TIMEVAL_RESOLUTION) -#define ST_TIMEVAL_MAX ((PRUint32)-1 - ((PRUint32)-1 % ST_TIMEVAL_RESOLUTION)) - -#define ST_MICROVAL_RESOLUTION 1000000 -#define ST_MICROVAL_FORMAT "%.6f" -#define ST_MICROVAL_PRINTABLE(timeval) ((PRFloat64)(timeval) / (PRFloat64)ST_MICROVAL_RESOLUTION) -#define ST_MICROVAL_PRINTABLE64(timeval) ((PRFloat64)((PRInt64)(timeval)) / (PRFloat64)ST_MICROVAL_RESOLUTION) -#define ST_MICROVAL_MAX ((PRUint32)-1 - ((PRUint32)-1 % ST_MICROVAL_RESOLUTION)) - -/* -** Forward Declaration -*/ -typedef struct __struct_STCategoryNode STCategoryNode; -typedef struct __struct_STCategoryRule STCategoryRule; - - -/* -** STAllocEvent -** -** An event that happens to an allocation (malloc, free, et. al.) -*/ -typedef struct __struct_STAllocEvent -{ - /* - ** The type of allocation event. - ** This maps directly to the trace malloc events (i.e. TM_EVENT_MALLOC) - */ - char mEventType; - - /* - ** Each event, foremost, has a chronologically increasing ID in - ** relation to other allocation events. This is a time stamp - ** of sorts. - */ - PRUint32 mTimeval; - - /* - ** Every event has a heap ID (pointer). - ** In the event of a realloc, this is the new heap ID. - ** In the event of a free, this is the previous heap ID value. - */ - PRUint32 mHeapID; - - /* - ** Every event, along with the heap ID, tells of the size. - ** In the event of a realloc, this is the new size. - ** In th event of a free, this is the previous size. - */ - PRUint32 mHeapSize; - - /* - ** Every event has a callsite/stack backtrace. - ** In the event of a realloc, this is the new callsite. - ** In the event of a free, this is the previous call site. - */ - tmcallsite* mCallsite; -} STAllocEvent; - -/* -** STAllocation -** -** An allocation is a temporal entity in the heap. -** It possibly lives under different heap IDs (pointers) and different -** sizes during its given time. -** An allocation is defined by the events during its lifetime. -** An allocation's lifetime is defined by the range of event IDs it holds. -*/ -typedef struct __struct_STAllocation -{ - /* - ** The array of events. - */ - PRUint32 mEventCount; - STAllocEvent* mEvents; - - /* - ** The lifetime/lifespan of the allocation. - */ - PRUint32 mMinTimeval; - PRUint32 mMaxTimeval; - - /* - ** Index of this allocation in the global run. - */ - PRUint32 mRunIndex; - - /* - ** The runtime cost of heap events in this allocation. - ** The cost is defined as the number of time units recorded as being - ** spent in heap code (time of malloc, free, et al.). - ** We do not track individual event cost in order to save space. - */ - PRUint32 mHeapRuntimeCost; -} STAllocation; - -/* -** STCallsiteStats -** -** Stats regarding a run, kept mainly for callsite runs. -*/ -typedef struct __struct_STCallsiteStats -{ - /* - ** Sum timeval of the allocations. - ** Callsite runs total all allocations below the callsite. - */ - PRUint64 mTimeval64; - - /* - ** Sum weight of the allocations. - ** Callsite runs total all allocations below the callsite. - */ - PRUint64 mWeight64; - - /* - ** Sum size of the allocations. - ** Callsite runs total all allocations below the callsite. - */ - PRUint32 mSize; - - /* - ** A stamp, indicated the relevance of the run. - ** If the stamp does not match the origin value, the - ** data contained here-in is considered invalid. - */ - PRUint32 mStamp; - - /* - ** A sum total of allocations (note, not sizes) below the callsite. - ** This is NOT the same as STRun::mAllocationCount which - ** tracks the STRun::mAllocations array size. - */ - PRUint32 mCompositeCount; - - /* - ** A sum total runtime cost of heap operations below the calliste. - ** The cost is defined as the number of time units recorded as being - ** spent in heap code (time of malloc, free, et al.). - */ - PRUint32 mHeapRuntimeCost; -} STCallsiteStats; - -/* -** STRun -** -** A run is a closed set of allocations. -** Given a run, we can deduce information about the contained allocations. -** We can also determine if an allocation lives beyond a run (leak). -** -** A run might be used to represent allocations for an entire application. -** A run might also be used to represent allocations from a single callstack. -*/ -typedef struct __struct_STRun -{ - /* - ** The array of allocations. - */ - PRUint32 mAllocationCount; - STAllocation** mAllocations; - - /* - ** Callsites like to keep some information. - ** As callsites are possibly shared between all contexts, each - ** different context needs to keep different stats. - */ - STCallsiteStats *mStats; - -} STRun; - -/* -** Categorize allocations -** -** The objective is to have a tree of categories with each leaf node of the tree -** matching a set of callsites that belong to the category. Each category can -** signify a functional area like say css and hence the user can browse this -** tree looking for how much of each of these are live at an instant. -*/ - -/* -** STCategoryNode -*/ - -struct __struct_STCategoryNode -{ - /* - ** Category name - */ - const char *categoryName; - - /* - ** Pointer to parent node. NULL for Root. - */ - STCategoryNode *parent; - - /* - ** For non-leaf nodes, an array of children node pointers. - ** NULL if leaf node. - */ - STCategoryNode** children; - PRUint32 nchildren; - - /* - ** The Run(s). Valid for both leaf and parent nodes. - ** One run per --Context to handle multiple data sets. - ** The relevant index for the particular request will be - ** mIndex stored by the mContext of the request. - */ - STRun **runs; -}; - - -struct __struct_STCategoryRule -{ - /* - ** The pattern for the rule. Patterns are an array of strings. - ** A callsite needs to pass substring match for all the strings. - */ - char* pats[ST_MAX_PATTERNS_PER_RULE]; - PRUint32 patlen[ST_MAX_PATTERNS_PER_RULE]; - PRUint32 npats; - - /* - ** Category name that this rule belongs to - */ - const char* categoryName; - - /* - ** The node this should be categorized into - */ - STCategoryNode* node; -}; - - -/* -** CategoryName to Node mapping table -*/ -typedef struct __struct_STCategoryMapEntry { - STCategoryNode* node; - const char * categoryName; -} STCategoryMapEntry; - -/* -** Option genres. -** -** This helps to determine what functionality each option effects. -** In specific, this will help use determine when and when not to -** totally recaclulate the sorted run and categories. -** Be very aware that adding things to a particular genre, or adding a genre, -** may completely screw up the caching algorithms of SpaceTrace. -** See contextLookup() or ask someone that knows if you are in doubt. -*/ -typedef enum __enum_STOptionGenre -{ - CategoryGenre = 0, - DataSortGenre, - DataSetGenre, - DataSizeGenre, - UIGenre, - ServerGenre, - BatchModeGenre, - - /* - ** Last one please. - */ - MaxGenres -} -STOptionGenre; - -/* -** STOptions -** -** Structure containing the varios options for the code. -** The definition of these options exists in a different file. -** We access that definition via macros to inline our structure definition. -*/ -#define ST_CMD_OPTION_BOOL(option_name, option_genre, option_help) PRBool m##option_name; -#define ST_CMD_OPTION_STRING(option_name, option_genre, default_value, option_help) char m##option_name[ST_OPTION_STRING_MAX]; -#define ST_CMD_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) char m##option_name[array_size][ST_OPTION_STRING_MAX]; -#define ST_CMD_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) const char** m##option_name; PRUint32 m##option_name##Count; -#define ST_CMD_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) PRUint32 m##option_name; -#define ST_CMD_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) PRUint64 m##option_name##64; - -typedef struct __struct_STOptions -{ -#include "stoptions.h" -} -STOptions; - -typedef struct __struct_STContext -/* -** A per request, thread safe, manner of accessing the contained members. -** A reader/writer lock ensures that the data is properly initialized before -** readers of the data begin their work. -** -** mRWLock reader/writer lock. -** writer lock is held to ensure initialization, though -** others can be attempting to acquire read locks -** at that time. -** writer lock is also used in destruction to make sure -** there are no more readers of data contained herein. -** reader lock is to allow multiple clients to read the -** data at the same time; implies is they must not -** write anything. -** mIndex Consider this much like thread private data or thread -** local storage in a few places. -** The index is specifically reserved for this context's -** usage in other data structure array's provided -** for the particular thread/client/context. -** This should not be modified after initialization. -** mSortedRun A pre sorted run taken from the global run, with our -** options applied. -** mImageLock An overly simplistic locking mechanism to protect the -** shared image cache. -** The proper implementation would have a reader/writer -** lock per cached image data. -** However, this will prove to be simpler for the time -** being. -** mFootprintCached Wether or not YData contains something useful. -** mTimevalCached Wether or not YData contains something useful. -** mLifespanCached Wether or not YData contains something useful. -** mWeightCached Wether or not YData contains something useful. -** mFootprintYData Precomputed cached graph data. -** mTimevalYData Precomputed cached graph data. -** mLifespanYData Precomputed cached graph data. -** mWeightYData Precomputed cached graph data. -*/ -{ - PRRWLock* mRWLock; - PRUint32 mIndex; - STRun* mSortedRun; -#if ST_WANT_GRAPHS - PRLock* mImageLock; - PRBool mFootprintCached; - PRBool mTimevalCached; - PRBool mLifespanCached; - PRBool mWeightCached; - PRUint32 mFootprintYData[STGD_SPACE_X]; - PRUint32 mTimevalYData[STGD_SPACE_X]; - PRUint32 mLifespanYData[STGD_SPACE_X]; - PRUint64 mWeightYData64[STGD_SPACE_X]; -#endif -} -STContext; - - -typedef struct __struct_STContextCacheItem -/* -** This basically pools the common items that the context cache will -** want to track on a per context basis. -** -** mOptions What options this item represents. -** mContext State/data this cache item is wrapping. -** mReferenceCount A count of clients currently using this item. -** Should this item be 0, then the cache might -** decide to evict this context. -** Should this item not be 0, once it reaches -** zero a condition variable in the context cache -** will be signaled to notify the availability. -** mLastAccessed A timestamp of when this item was last accessed/released. -** Ignore this unless the reference count is 0, -** This is used to evict the oldest unused item from -** the context cache. -** mInUse Mainly PR_FALSE only at the beginning of the process, -** but this indicates that the item has not yet been -** used at all, and thus shouldn't be evaluated for -** a cache hit. -*/ -{ - STOptions mOptions; - STContext mContext; - PRInt32 mReferenceCount; - PRIntervalTime mLastAccessed; - PRBool mInUse; -} -STContextCacheItem; - - -typedef struct __struct_STContextCache -/* -** A thread safe, possibly blocking, cache of context items. -** -** mLock Must hold the lock to read/access/write to this struct, as -** well as any items it holds. -** mCacheMiss All items are busy and there were no cache matches. -** This condition variable is used to wait until an item becomes -** "available" to be evicted from the cache. -** mItems Array of items. -** mItemCount Number of items in array. -** This is generally the same as the global option's command line -** mContexts.... -*/ -{ - PRLock* mLock; - PRCondVar* mCacheMiss; - STContextCacheItem* mItems; - PRUint32 mItemCount; -} -STContextCache; - - -/* -** STRequest -** -** Things specific to a request. -*/ -typedef struct __struct_STRequest -{ - /* - ** Sink/where to output. - */ - PRFileDesc* mFD; - - /* - ** The filename requested. - */ - const char* mGetFileName; - - /* - ** The GET form data, if any. - */ - const FormData* mGetData; - - /* - ** Options specific to this request. - */ - STOptions mOptions; - - /* - ** The context/data/state of the reqeust. - */ - STContext* mContext; -} STRequest; - - -/* -** STGlobals -** -** Various globals we keep around. -*/ -typedef struct __struct_STGlobals -{ - /* - ** The string which identifies this program. - */ - const char* mProgramName; - - /* - ** Options derived from the command line. - ** These are used as defaults, and should remain static during - ** the run of the application. - */ - STOptions mCommandLineOptions; - - /* - ** Context cache. - ** As clients come in, based on their options, a different context - ** will be used to service them. - */ - STContextCache mContextCache; - - /* - ** Various counters for different types of events. - */ - PRUint32 mMallocCount; - PRUint32 mCallocCount; - PRUint32 mReallocCount; - PRUint32 mFreeCount; - - /* - ** Total events, operation counter. - */ - PRUint32 mOperationCount; - - /* - ** The "run" of the input. - */ - STRun mRun; - - /* - ** Operation minimum/maximum timevals. - ** So that we can determine the overall timeval of the run. - ** NOTE: These are NOT the options to control the data set. - */ - PRUint32 mMinTimeval; - PRUint32 mMaxTimeval; - - /* - ** Calculates peak allocation overall for all allocations. - */ - PRUint32 mPeakMemoryUsed; - PRUint32 mMemoryUsed; - - /* - ** A list of rules for categorization read in from the mCategoryFile - */ - STCategoryRule** mCategoryRules; - PRUint32 mNRules; - - /* - ** CategoryName to Node mapping table - */ - STCategoryMapEntry** mCategoryMap; - PRUint32 mNCategoryMap; - - /* - ** Categorized allocations. For now we support only one tree. - */ - STCategoryNode mCategoryRoot; - - /* - ** tmreader hash tables. - ** Moved into globals since we need to destroy these only after all - ** client threads are finishes (after PR_Cleanup). - */ - tmreader* mTMR; -} STGlobals; - - -/* -** Function prototypes -*/ -extern STRun* createRun(STContext* inContext, PRUint32 aStamp); -extern void freeRun(STRun* aRun); -extern int initCategories(STGlobals* g); -extern int categorizeRun(STOptions* inOptions, STContext* inContext, const STRun* aRun, STGlobals* g); -extern STCategoryNode* findCategoryNode(const char *catName, STGlobals *g); -extern int freeCategories(STGlobals* g); -extern int displayCategoryReport(STRequest* inRequest, STCategoryNode *root, int depth); - -extern int recalculateAllocationCost(STOptions* inOptions, STContext* inContext, STRun* aRun, STAllocation* aAllocation, PRBool updateParent); -extern void htmlHeader(STRequest* inRequest, const char* aTitle); -extern void htmlFooter(STRequest* inRequest); -extern void htmlAnchor(STRequest* inRequest, - const char* aHref, - const char* aText, - const char* aTarget, - const char* aClass, - STOptions* inOptions); -extern char *FormatNumber(PRInt32 num); - -/* -** shared globals -*/ -extern STGlobals globals; - -#endif /* spacetrace_h__ */ diff --git a/mozilla/tools/trace-malloc/stoptions.h b/mozilla/tools/trace-malloc/stoptions.h deleted file mode 100644 index 83a2bdc5f1b..00000000000 --- a/mozilla/tools/trace-malloc/stoptions.h +++ /dev/null @@ -1,336 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is stoptions.h code, released - * May 7, 2002. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Garrett Arch Blythe, 07-May-2002 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* -** stoptions.h -** -** Abstract the spacetrace options into a reusable format, such that -** many different pieces of the code can utilize the common list. -*/ - -/* -** There are three types of options. -** The destinction is quite important. -** -** CMD options are accessible from only the comamnd line. -** Such options should be considered global/static for the entire -** run of the application. -** Once set, no one can change these options during the run. -** -** WEB options are accessible from the web server options page. -** Such options can and will be changed on a per user basis during -** the run of the application. -** You should NEVER make an option a WEB only option, as this will -** break batch mode processing, and will likely not correctly -** define the options structure itself. -** These options will control the data caching used in the application -** to match a client to a cache of data. -** -** ALL options are both CMD and WEB options, with the properties of WEB -** options (the user will change these on a per client basis). -** Most likely this is the type of option you will desire to create. -*/ - -/* -** All types of options have some combination of the following elements: -** -** option_name The name of the option. -** option_genre Area the option effects; STOptionGenre. -** default_value The default value for the option. -** array_size Used to size a string array. -** multiplier Some numbers prefer conversion. -** option_help Help text to explain the option. -** -** NOTE! that the multiplier should be applied to the default value if you -** are going to assign the default_value into anything. -** -** Be very aware that adding things to a particular genre, or adding a genre, -** may completely screw up the caching algorithms of SpaceTrace. -** See contextLookup() or ask someone that knows if you are in doubt. -** -** The actual definition of the WEB and CMD macros however is left to the -** end user. -** We cover those that you do not define herein. -*/ -#if !defined(ST_CMD_OPTION_BOOL) -#define ST_CMD_OPTION_BOOL(option_name, option_genre, option_help) -#endif -#if !defined(ST_WEB_OPTION_BOOL) -#define ST_WEB_OPTION_BOOL(option_name, option_genre, option_help) -#endif -#if !defined(ST_CMD_OPTION_STRING) -#define ST_CMD_OPTION_STRING(option_name, option_genre, default_value, option_help) -#endif -#if !defined(ST_WEB_OPTION_STRING) -#define ST_WEB_OPTION_STRING(option_name, option_genre, default_value, option_help) -#endif -#if !defined(ST_CMD_OPTION_STRING_ARRAY) -#define ST_CMD_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) -#endif -#if !defined(ST_WEB_OPTION_STRING_ARRAY) -#define ST_WEB_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) -#endif -#if !defined(ST_CMD_OPTION_STRING_PTR_ARRAY) -#define ST_CMD_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) -#endif -#if !defined(ST_WEB_OPTION_STRING_PTR_ARRAY) -#define ST_WEB_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) -#endif -#if !defined(ST_CMD_OPTION_UINT32) -#define ST_CMD_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) -#endif -#if !defined(ST_WEB_OPTION_UINT32) -#define ST_WEB_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) -#endif -#if !defined(ST_CMD_OPTION_UINT64) -#define ST_CMD_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) -#endif -#if !defined(ST_WEB_OPTION_UINT64) -#define ST_WEB_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) -#endif - -/* -** ALL macros expand to both CMD and WEB macros. -** This basically means such options are accessible from both the command -** line and from the web options. -*/ -#define ST_ALL_OPTION_BOOL(option_name, option_genre, option_help) \ - ST_CMD_OPTION_BOOL(option_name, option_genre, option_help) \ - ST_WEB_OPTION_BOOL(option_name, option_genre, option_help) -#define ST_ALL_OPTION_STRING(option_name, option_genre, default_value, option_help) \ - ST_CMD_OPTION_STRING(option_name, option_genre, default_value, option_help) \ - ST_WEB_OPTION_STRING(option_name, option_genre, default_value, option_help) -#define ST_ALL_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) \ - ST_CMD_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) \ - ST_WEB_OPTION_STRING_ARRAY(option_name, option_genre, array_size, option_help) -#define ST_ALL_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) \ - ST_CMD_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) \ - ST_WEB_OPTION_STRING_PTR_ARRAY(option_name, option_genre, option_help) -#define ST_ALL_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) \ - ST_CMD_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) \ - ST_WEB_OPTION_UINT32(option_name, option_genre, default_value, multiplier, option_help) -#define ST_ALL_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) \ - ST_CMD_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) \ - ST_WEB_OPTION_UINT64(option_name, option_genre, default_value, multiplier, option_help) - - - -/**************************************************************************** -** BEGIN, THE OPTIONS -** -** Order is somewhat relevant in that it will control 3 different things: -** 1) The order the members will be in the options structure. -** 2) The order the options are presented on the command line. -** 3) The order the options are presented on the web options page. -*/ - -ST_ALL_OPTION_STRING(CategoryName, - CategoryGenre, - ST_ROOT_CATEGORY_NAME, - "Specify a category for reports to focus upon.\n" - "See http://lxr.mozilla.org/mozilla/source/tools/trace-malloc/rules.txt\n") - -ST_ALL_OPTION_UINT32(OrderBy, - DataSortGenre, - ST_SIZE, /* for dp :-D */ - 1, - "Determine the sort order.\n" - "0 by weight (size * lifespan).\n" - "1 by size.\n" - "2 by lifespan.\n" - "3 by allocation count.\n" - "4 by performance cost.\n") - -ST_ALL_OPTION_STRING_ARRAY(RestrictText, - DataSetGenre, - ST_SUBSTRING_MATCH_MAX, - "Exclude allocations which do not have this text in their backtrace.\n" - "Multiple restrictions are treated as a logical AND operation.\n") - -ST_ALL_OPTION_UINT32(SizeMin, - DataSetGenre, - 0, - 1, - "Exclude allocations that are below this byte size.\n") - -ST_ALL_OPTION_UINT32(SizeMax, - DataSetGenre, - 0xFFFFFFFF, - 1, - "Exclude allocations that are above this byte size.\n") - -ST_ALL_OPTION_UINT32(LifetimeMin, - DataSetGenre, - ST_DEFAULT_LIFETIME_MIN, - ST_TIMEVAL_RESOLUTION, - "Allocations must live this number of seconds or be ignored.\n") - -ST_ALL_OPTION_UINT32(LifetimeMax, - DataSetGenre, - ST_TIMEVAL_MAX / ST_TIMEVAL_RESOLUTION, - ST_TIMEVAL_RESOLUTION, - "Allocations living longer than this number of seconds will be ignored.\n") - -ST_ALL_OPTION_UINT32(TimevalMin, - DataSetGenre, - 0, - ST_TIMEVAL_RESOLUTION, - "Allocations existing solely before this second will be ignored.\n" - "Live allocations at this second and after can be considered.\n") - -ST_ALL_OPTION_UINT32(TimevalMax, - DataSetGenre, - ST_TIMEVAL_MAX / ST_TIMEVAL_RESOLUTION, - ST_TIMEVAL_RESOLUTION, - "Allocations existing solely after this second will be ignored.\n" - "Live allocations at this second and before can be considered.\n") - -ST_ALL_OPTION_UINT32(AllocationTimevalMin, - DataSetGenre, - 0, - ST_TIMEVAL_RESOLUTION, - "Live and dead allocations created before this second will be ignored.\n") - -ST_ALL_OPTION_UINT32(AllocationTimevalMax, - DataSetGenre, - ST_TIMEVAL_MAX / ST_TIMEVAL_RESOLUTION, - ST_TIMEVAL_RESOLUTION, - "Live and dead allocations created after this second will be ignored.\n") - -ST_ALL_OPTION_UINT32(AlignBy, - DataSizeGenre, - ST_DEFAULT_ALIGNMENT_SIZE, - 1, - "All allocation sizes are made to be a multiple of this number.\n" - "Closer to actual heap conditions; set to 1 for true sizes.\n") - -ST_ALL_OPTION_UINT32(Overhead, - DataSizeGenre, - ST_DEFAULT_OVERHEAD_SIZE, - 1, - "After alignment, all allocations are made to increase by this number.\n" - "Closer to actual heap conditions; set to 0 for true sizes.\n") - -ST_ALL_OPTION_UINT32(ListItemMax, - UIGenre, - 500, - 1, - "Specifies the maximum number of list items to present in each list.\n") - -ST_ALL_OPTION_UINT64(WeightMin, - DataSetGenre, - LL_INIT(0, 0), - LL_INIT(0, 1), - "Exclude allocations that are below this weight (lifespan * size).\n") - -ST_ALL_OPTION_UINT64(WeightMax, - DataSetGenre, - LL_INIT(0xFFFFFFFF, 0xFFFFFFFF), - LL_INIT(0, 1), - "Exclude allocations that are above this weight (lifespan * size).\n") - -ST_CMD_OPTION_STRING(FileName, - DataSetGenre, - "-", - "Specifies trace-malloc input file.\n" - "\"-\" indicates stdin will be used as input.\n") - -ST_CMD_OPTION_STRING(CategoryFile, - CategoryGenre, - "rules.txt", - "Specifies the category rules file.\n" - "This file contains rules about how to categorize allocations.\n") - - -ST_CMD_OPTION_UINT32(HttpdPort, - ServerGenre, - 1969, - 1, - "Specifies the default port the web server will listen on.\n") - -ST_CMD_OPTION_STRING(OutputDir, - BatchModeGenre, - ".", - "Specifies a directory to output batch mode requests.\n" - "The directory must exist and must not use a trailing slash.\n") - -ST_CMD_OPTION_STRING_PTR_ARRAY(BatchRequest, - BatchModeGenre, - "This implicitly turns on batch mode.\n" - "Save each requested file into the output dir, then exit.\n") - -ST_CMD_OPTION_UINT32(Contexts, - ServerGenre, - 1, - 1, - "How many configurations to cache at the cost of a lot of memory.\n" - "Dedicated servers can cache more client configurations for performance.\n") - -ST_CMD_OPTION_BOOL(Help, - UIGenre, - "Show command line help.\n" - "See http://www.mozilla.org/projects/footprint/spaceTrace.html\n") - -/* -** END, THE OPTIONS -****************************************************************************/ - -/* -** Everything is undefined after the header is included. -** This sets it up for multiple inclusion if so desired. -*/ -#undef ST_ALL_OPTION_BOOL -#undef ST_CMD_OPTION_BOOL -#undef ST_WEB_OPTION_BOOL -#undef ST_ALL_OPTION_STRING -#undef ST_CMD_OPTION_STRING -#undef ST_WEB_OPTION_STRING -#undef ST_ALL_OPTION_STRING_ARRAY -#undef ST_CMD_OPTION_STRING_ARRAY -#undef ST_WEB_OPTION_STRING_ARRAY -#undef ST_ALL_OPTION_STRING_PTR_ARRAY -#undef ST_CMD_OPTION_STRING_PTR_ARRAY -#undef ST_WEB_OPTION_STRING_PTR_ARRAY -#undef ST_ALL_OPTION_UINT32 -#undef ST_CMD_OPTION_UINT32 -#undef ST_WEB_OPTION_UINT32 -#undef ST_ALL_OPTION_UINT64 -#undef ST_CMD_OPTION_UINT64 -#undef ST_WEB_OPTION_UINT64 diff --git a/mozilla/tools/trace-malloc/tmfrags.c b/mozilla/tools/trace-malloc/tmfrags.c deleted file mode 100644 index eafdc12182a..00000000000 --- a/mozilla/tools/trace-malloc/tmfrags.c +++ /dev/null @@ -1,994 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is tmfrags.c code, released - * Oct 26, 2002. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Garrett Arch Blythe, 26-October-2002 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include -#include -#include -#include -#include -#include -#include - -#include "nspr.h" -#include "tmreader.h" - - -#define ERROR_REPORT(num, val, msg) fprintf(stderr, "error(%d):\t\"%s\"\t%s\n", (num), (val), (msg)); -#define CLEANUP(ptr) do { if(NULL != ptr) { free(ptr); ptr = NULL; } } while(0) - - -#define ticks2msec(reader, ticks) ticks2xsec((reader), (ticks), 1000) -#define ticks2usec(reader, ticks) ticks2xsec((reader), (ticks), 1000000) -#define TICK_RESOLUTION 1000 -#define TICK_PRINTABLE(timeval) ((PRFloat64)(timeval) / (PRFloat64)ST_TIMEVAL_RESOLUTION) - - -typedef struct __struct_Options -/* -** Options to control how we perform. -** -** mProgramName Used in help text. -** mInputName Name of the file. -** mOutput Output file, append. -** Default is stdout. -** mOutputName Name of the file. -** mHelp Wether or not help should be shown. -** mOverhead How much overhead an allocation will have. -** mAlignment What boundry will the end of an allocation line up on. -** mPageSize Controls the page size. A page containing only fragments -** is not fragmented. A page containing any life memory -** costs mPageSize in bytes. -*/ -{ - const char* mProgramName; - char* mInputName; - FILE* mOutput; - char* mOutputName; - int mHelp; - unsigned mOverhead; - unsigned mAlignment; - unsigned mPageSize; -} -Options; - - -typedef struct __struct_Switch -/* -** Command line options. -*/ -{ - const char* mLongName; - const char* mShortName; - int mHasValue; - const char* mValue; - const char* mDescription; -} -Switch; - -#define DESC_NEWLINE "\n\t\t" - -static Switch gInputSwitch = {"--input", "-i", 1, NULL, "Specify input file." DESC_NEWLINE "stdin is default."}; -static Switch gOutputSwitch = {"--output", "-o", 1, NULL, "Specify output file." DESC_NEWLINE "Appends if file exists." DESC_NEWLINE "stdout is default."}; -static Switch gHelpSwitch = {"--help", "-h", 0, NULL, "Information on usage."}; -static Switch gAlignmentSwitch = {"--alignment", "-al", 1, NULL, "All allocation sizes are made to be a multiple of this number." DESC_NEWLINE "Closer to actual heap conditions; set to 1 for true sizes." DESC_NEWLINE "Default value is 16."}; -static Switch gOverheadSwitch = {"--overhead", "-ov", 1, NULL, "After alignment, all allocations are made to increase by this number." DESC_NEWLINE "Closer to actual heap conditions; set to 0 for true sizes." DESC_NEWLINE "Default value is 8."}; -static Switch gPageSizeSwitch = {"--page-size", "-ps", 1, NULL, "Sets the page size which aids the identification of fragmentation." DESC_NEWLINE "Closer to actual heap conditions; set to 4294967295 for true sizes." DESC_NEWLINE "Default value is 4096."}; - -static Switch* gSwitches[] = { - &gInputSwitch, - &gOutputSwitch, - &gAlignmentSwitch, - &gOverheadSwitch, - &gPageSizeSwitch, - &gHelpSwitch -}; - - -typedef struct __struct_AnyArray -/* -** Variable sized item array. -** -** mItems The void pointer items. -** mItemSize Size of each different item. -** mCount The number of items in the array. -** mCapacity How many more items we can hold before reallocing. -** mGrowBy How many items we allocate when we grow. -*/ -{ - void* mItems; - unsigned mItemSize; - unsigned mCount; - unsigned mCapacity; - unsigned mGrowBy; -} -AnyArray; - - -typedef int (*arrayMatchFunc)(void* inContext, AnyArray* inArray, void* inItem, unsigned inItemIndex) -/* -** Callback function for the arrayIndexFn function. -** Used to determine an item match by customizable criteria. -** -** inContext The criteria and state of the search. -** User specified/created. -** inArray The array the item is in. -** inItem The item to evaluate for match. -** inItemIndex The index of this particular item in the array. -** -** return int 0 to specify a match. -** !0 to continue the search performed by arrayIndexFn. -*/ -; - - -typedef enum __enum_HeapEventType -/* -** Simple heap events are really one of two things. -*/ -{ - FREE, - ALLOC -} -HeapEventType; - - -typedef enum __enum_HeapObjectType -/* -** The various types of heap objects we track. -*/ -{ - ALLOCATION, - FRAGMENT -} -HeapObjectType; - - -typedef struct __struct_HeapObject HeapObject; -typedef struct __struct_HeapHistory -/* -** A marker as to what has happened. -** -** mTimestamp When history occurred. -** mTMRSerial The historical state as known to the tmreader. -** mObjectIndex Index to the object that was before or after this event. -** The index as in the index according to all heap objects -** kept in the TMState structure. -** We use an index instead of a pointer as the array of -** objects can change location in the heap. -*/ -{ - unsigned mTimestamp; - unsigned mTMRSerial; - unsigned mObjectIndex; -} -HeapHistory; - - -struct __struct_HeapObject -/* -** An object in the heap. -** -** A special case should be noted here. If either the birth or death -** history leads to an object of the same type, then this object -** is the same as that object, but was modified somehow. -** Also note that multiple objects may have the same birth object, -** as well as the same death object. -** -** mUniqueID Each object is unique. -** mType Either allocation or fragment. -** mHeapOffset Where in the heap the object is. -** mSize How much of the heap the object takes. -** mBirth History about the birth event. -** mDeath History about the death event. -*/ -{ - unsigned mUniqueID; - - HeapObjectType mType; - unsigned mHeapOffset; - unsigned mSize; - - HeapHistory mBirth; - HeapHistory mDeath; -}; - - -typedef struct __struct_TMState -/* -** State of our current operation. -** Stats we are trying to calculate. -** -** mOptions Obilgatory options pointer. -** mTMR The tmreader, used in tmreader API calls. -** mLoopExitTMR Set to non zero in order to quickly exit from tmreader -** input loop. This will also result in an error. -** uMinTicks Start of run, milliseconds. -** uMaxTicks End of run, milliseconds. -*/ -{ - Options* mOptions; - tmreader* mTMR; - - int mLoopExitTMR; - - unsigned uMinTicks; - unsigned uMaxTicks; -} -TMState; - - -int initOptions(Options* outOptions, int inArgc, char** inArgv) -/* -** returns int 0 if successful. -*/ -{ - int retval = 0; - int loop = 0; - int switchLoop = 0; - int match = 0; - const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]); - Switch* current = NULL; - - /* - ** Set any defaults. - */ - memset(outOptions, 0, sizeof(Options)); - outOptions->mProgramName = inArgv[0]; - outOptions->mInputName = strdup("-"); - outOptions->mOutput = stdout; - outOptions->mOutputName = strdup("stdout"); - outOptions->mAlignment = 16; - outOptions->mOverhead = 8; - - if(NULL == outOptions->mOutputName || NULL == outOptions->mInputName) - { - retval = __LINE__; - ERROR_REPORT(retval, "stdin/stdout", "Unable to strdup."); - } - - /* - ** Go through and attempt to do the right thing. - */ - for(loop = 1; loop < inArgc && 0 == retval; loop++) - { - match = 0; - current = NULL; - - for(switchLoop = 0; switchLoop < switchCount && 0 == retval; switchLoop++) - { - if(0 == strcmp(gSwitches[switchLoop]->mLongName, inArgv[loop])) - { - match = __LINE__; - } - else if(0 == strcmp(gSwitches[switchLoop]->mShortName, inArgv[loop])) - { - match = __LINE__; - } - - if(match) - { - if(gSwitches[switchLoop]->mHasValue) - { - /* - ** Attempt to absorb next option to fullfill value. - */ - if(loop + 1 < inArgc) - { - loop++; - - current = gSwitches[switchLoop]; - current->mValue = inArgv[loop]; - } - } - else - { - current = gSwitches[switchLoop]; - } - - break; - } - } - - if(0 == match) - { - outOptions->mHelp = __LINE__; - retval = __LINE__; - ERROR_REPORT(retval, inArgv[loop], "Unknown command line switch."); - } - else if(NULL == current) - { - outOptions->mHelp = __LINE__; - retval = __LINE__; - ERROR_REPORT(retval, inArgv[loop], "Command line switch requires a value."); - } - else - { - /* - ** Do something based on address/swtich. - */ - if(current == &gInputSwitch) - { - CLEANUP(outOptions->mInputName); - outOptions->mInputName = strdup(current->mValue); - if(NULL == outOptions->mInputName) - { - retval = __LINE__; - ERROR_REPORT(retval, current->mValue, "Unable to strdup."); - } - } - else if(current == &gOutputSwitch) - { - CLEANUP(outOptions->mOutputName); - if(NULL != outOptions->mOutput && stdout != outOptions->mOutput) - { - fclose(outOptions->mOutput); - outOptions->mOutput = NULL; - } - - outOptions->mOutput = fopen(current->mValue, "a"); - if(NULL == outOptions->mOutput) - { - retval = __LINE__; - ERROR_REPORT(retval, current->mValue, "Unable to open output file."); - } - else - { - outOptions->mOutputName = strdup(current->mValue); - if(NULL == outOptions->mOutputName) - { - retval = __LINE__; - ERROR_REPORT(retval, current->mValue, "Unable to strdup."); - } - } - } - else if(current == &gHelpSwitch) - { - outOptions->mHelp = __LINE__; - } - else if(current == &gAlignmentSwitch) - { - unsigned arg = 0; - char* endScan = NULL; - - errno = 0; - arg = strtoul(current->mValue, &endScan, 0); - if(0 == errno && endScan != current->mValue) - { - outOptions->mAlignment = arg; - } - else - { - retval = __LINE__; - ERROR_REPORT(retval, current->mValue, "Unable to convert to a number."); - } - } - else if(current == &gOverheadSwitch) - { - unsigned arg = 0; - char* endScan = NULL; - - errno = 0; - arg = strtoul(current->mValue, &endScan, 0); - if(0 == errno && endScan != current->mValue) - { - outOptions->mOverhead = arg; - } - else - { - retval = __LINE__; - ERROR_REPORT(retval, current->mValue, "Unable to convert to a number."); - } - } - else if(current == &gPageSizeSwitch) - { - unsigned arg = 0; - char* endScan = NULL; - - errno = 0; - arg = strtoul(current->mValue, &endScan, 0); - if(0 == errno && endScan != current->mValue) - { - outOptions->mPageSize = arg; - } - else - { - retval = __LINE__; - ERROR_REPORT(retval, current->mValue, "Unable to convert to a number."); - } - } - else - { - retval = __LINE__; - ERROR_REPORT(retval, current->mLongName, "No hanlder for command line switch."); - } - } - } - - return retval; -} - - -PRUint32 ticks2xsec(tmreader* aReader, PRUint32 aTicks, PRUint32 aResolution) -/* -** Convert platform specific ticks to second units -*/ -{ - PRUint32 retval = 0; - PRUint64 bigone; - PRUint64 tmp64; - - LL_UI2L(bigone, aResolution); - LL_UI2L(tmp64, aTicks); - LL_MUL(bigone, bigone, tmp64); - LL_UI2L(tmp64, aReader->ticksPerSec); - LL_DIV(bigone, bigone, tmp64); - LL_L2UI(retval, bigone); - return retval; -} - - -void cleanOptions(Options* inOptions) -/* -** Clean up any open handles. -*/ -{ - unsigned loop = 0; - - CLEANUP(inOptions->mInputName); - CLEANUP(inOptions->mOutputName); - if(NULL != inOptions->mOutput && stdout != inOptions->mOutput) - { - fclose(inOptions->mOutput); - } - - memset(inOptions, 0, sizeof(Options)); -} - - -void showHelp(Options* inOptions) -/* -** Show some simple help text on usage. -*/ -{ - int loop = 0; - const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]); - const char* valueText = NULL; - - printf("usage:\t%s [arguments]\n", inOptions->mProgramName); - printf("\n"); - printf("arguments:\n"); - - for(loop = 0; loop < switchCount; loop++) - { - if(gSwitches[loop]->mHasValue) - { - valueText = " "; - } - else - { - valueText = ""; - } - - printf("\t%s%s\n", gSwitches[loop]->mLongName, valueText); - printf("\t %s%s", gSwitches[loop]->mShortName, valueText); - printf(DESC_NEWLINE "%s\n\n", gSwitches[loop]->mDescription); - } - - printf("This tool reports heap fragmentation stats from a trace-malloc log.\n"); -} - - -AnyArray* arrayCreate(unsigned inItemSize, unsigned inGrowBy) -/* -** Create an array container object. -*/ -{ - AnyArray* retval = NULL; - - if(0 != inGrowBy && 0 != inItemSize) - { - retval = (AnyArray*)calloc(1, sizeof(AnyArray)); - retval->mItemSize = inItemSize; - retval->mGrowBy = inGrowBy; - } - - return retval; -} - - -void arrayDestroy(AnyArray* inArray) -/* -** Release the memory the array contains. -** This will release the items as well. -*/ -{ - if(NULL != inArray) - { - if(NULL != inArray->mItems) - { - free(inArray->mItems); - } - free(inArray); - } -} - - -unsigned arrayAlloc(AnyArray* inArray, unsigned inItems) -/* -** Resize the item array capcity to a specific number of items. -** This could possibly truncate the array, so handle that as well. -** -** returns unsigned <= inArray->mCapactiy on success. -*/ -{ - unsigned retval = (unsigned)-1; - - if(NULL != inArray) - { - void* moved = NULL; - - moved = realloc(inArray->mItems, inItems * inArray->mItemSize); - if(NULL != moved) - { - inArray->mItems = moved; - inArray->mCapacity = inItems; - if(inArray->mCount > inItems) - { - inArray->mCount = inItems; - } - - retval = inItems; - } - } - - return retval; -} - - -void* arrayItem(AnyArray* inArray, unsigned inIndex) -/* -** Return the array item at said index. -** Zero based index. -** -** returns void* NULL on failure. -*/ -{ - void* retval = NULL; - - if(NULL != inArray && inIndex < inArray->mCount) - { - retval = (void*)((char*)inArray->mItems + (inArray->mItemSize * inIndex)); - } - - return retval; -} - - -unsigned arrayIndex(AnyArray* inArray, void* inItem, unsigned inStartIndex) -/* -** Go through the array from the index specified looking for an item -** match based on byte for byte comparison. -** We allow specifying the start index in order to handle arrays with -** duplicate items. -** -** returns unsigned >= inArray->mCount on failure. -*/ -{ - unsigned retval = (unsigned)-1; - - if(NULL != inArray && NULL != inItem && inStartIndex < inArray->mCount) - { - void* curItem = NULL; - - for(retval = inStartIndex; retval < inArray->mCount; retval++) - { - curItem = arrayItem(inArray, retval); - if(0 == memcmp(inItem, curItem, inArray->mItemSize)) - { - break; - } - } - } - - - return retval; -} - - -unsigned arrayIndexFn(AnyArray* inArray, arrayMatchFunc inFunc, void* inFuncContext, unsigned inStartIndex) -/* -** Go through the array from the index specified looking for an item -** match based upon the return value of inFunc (0, Zero, is a match). -** We allow specifying the start index in order to facilitate looping over -** the array which could have multiple matches. -** -** returns unsigned >= inArray->mCount on failure. -*/ -{ - unsigned retval = (unsigned)-1; - - if(NULL != inArray && NULL != inFunc && inStartIndex < inArray->mCount) - { - void* curItem = NULL; - - for(retval = inStartIndex; retval < inArray->mCount; retval++) - { - curItem = arrayItem(inArray, retval); - if(0 == inFunc(inFuncContext, inArray, curItem, retval)) - { - break; - } - } - } - - return retval; -} - - -unsigned arrayAddItem(AnyArray* inArray, void* inItem) -/* -** Add a new item to the array. -** This is done by copying the item. -** -** returns unsigned < inArray->mCount on success. -*/ -{ - unsigned retval = (unsigned)-1; - - if(NULL != inArray && NULL != inItem) - { - int noCopy = 0; - - /* - ** See if the array should grow. - */ - if(inArray->mCount == inArray->mCapacity) - { - unsigned allocRes = 0; - - allocRes = arrayAlloc(inArray, inArray->mCapacity + inArray->mGrowBy); - if(allocRes > inArray->mCapacity) - { - noCopy = __LINE__; - } - } - - if(0 == noCopy) - { - retval = inArray->mCount; - - inArray->mCount++; - memcpy(arrayItem(inArray, retval), inItem, inArray->mItemSize); - } - } - - return retval; -} - - -HeapObject* initHeapObject(HeapObject* inObject) -/* -** Function to init the heap object just right. -** Sets the unique ID to something unique. -*/ -{ - HeapObject* retval = inObject; - - if(NULL != inObject) - { - static unsigned uniqueGenerator = 0; - - memset(inObject, -1, sizeof(HeapObject)); - - inObject->mUniqueID = uniqueGenerator; - uniqueGenerator++; - } - - return retval; -} - - -int simpleHeapEvent(TMState* inStats, HeapEventType inType, unsigned mTimestamp, unsigned inSerial, unsigned inHeapID, unsigned inSize) -/* -** A new heap event will cause the creation of a new heap object. -** The new heap object will displace, or replace, a heap object of a different type. -*/ -{ - int retval = 0; - HeapObject newObject; - - /* - ** Set the most basic object details. - */ - initHeapObject(&newObject); - newObject.mHeapOffset = inHeapID; - newObject.mSize = inSize; - if(FREE == inType) - { - newObject.mType = FRAGMENT; - } - else if(ALLOC == inType) - { - newObject.mType = ALLOCATION; - } - - /* - ** Add it to the heap object array. - */ - - /* - ** TODO GAB - ** - ** First thing to do is to add the new object to the heap in order to - ** obtain a valid index. - ** - ** Next, find all matches to this range of heap memory that this event - ** refers to, that are alive during this timestamp (no death yet). - ** Fill in the death event of those objects. - ** If the objects contain some portions outside of the range, then - ** new objects for those ranges need to be created that carry on - ** the same object type, have the index of the old object for birth, - ** and the serial of the old object, new timestamp of course. - ** The old object's death points to the new object, which tells why the - ** fragmentation took place. - ** The new object birth points to the old object only if a fragment. - ** An allocation only has a birth object when it is a realloc (complex) - ** heap event. - ** - ** I believe this give us enough information to look up particular - ** details of the heap at any given time. - */ - - return retval; -} - - -int complexHeapEvent(TMState* inStats, unsigned mTimestamp, unsigned inOldSerial, unsigned inOldHeapID, unsigned inOSize, unsigned inNewSerial, unsigned inNewHeapID, unsigned inNewSize) -/* -** Generally, this event intends to chain one old heap object to a newer heap object. -** Otherwise, the functionality should recognizable ala simpleHeapEvent. -*/ -{ - int retval = 0; - - /* - ** TODO GAB - */ - - return retval; -} - - -unsigned actualByteSize(Options* inOptions, unsigned retval) -/* -** Apply alignment and overhead to size to figure out actual byte size. -** This by default mimics spacetrace with default options (msvc crt heap). -*/ -{ - if(0 != retval) - { - unsigned eval = 0; - unsigned over = 0; - - eval = retval - 1; - if(0 != inOptions->mAlignment) - { - over = eval % inOptions->mAlignment; - } - retval = eval + inOptions->mOverhead + inOptions->mAlignment - over; - } - - return retval; -} - - -void tmEventHandler(tmreader* inReader, tmevent* inEvent) -/* -** Callback from the tmreader_eventloop. -** Build up our fragmentation information herein. -*/ -{ - char type = inEvent->type; - TMState* stats = (TMState*)inReader->data; - - /* - ** Only intersted in handling events of a particular type. - */ - switch(type) - { - default: - return; - - case TM_EVENT_MALLOC: - case TM_EVENT_CALLOC: - case TM_EVENT_REALLOC: - case TM_EVENT_FREE: - break; - } - - /* - ** Should we even try to look? - ** Set mLoopExitTMR to non-zero to abort the read loop faster. - */ - if(0 == stats->mLoopExitTMR) - { - Options* options = (Options*)stats->mOptions; - unsigned timestamp = ticks2msec(stats->mTMR, inEvent->u.alloc.interval); - unsigned actualSize = actualByteSize(options, inEvent->u.alloc.size); - unsigned heapID = inEvent->u.alloc.ptr; - unsigned serial = inEvent->serial; - - /* - ** Check the timestamp range of our overall state. - */ - if(stats->uMinTicks > timestamp) - { - stats->uMinTicks = timestamp; - } - if(stats->uMaxTicks < timestamp) - { - stats->uMaxTicks = timestamp; - } - - /* - ** Realloc in general deserves some special attention if dealing - ** with an old allocation (not new memory). - */ - if(TM_EVENT_REALLOC == type && 0 != inEvent->u.alloc.oldserial) - { - unsigned oldActualSize = actualByteSize(options, inEvent->u.alloc.oldsize); - unsigned oldHeapID = inEvent->u.alloc.oldptr; - unsigned oldSerial = inEvent->u.alloc.oldserial; - - if(0 == actualSize) - { - /* - ** Reallocs of size zero are to become free events. - */ - stats->mLoopExitTMR = simpleHeapEvent(stats, FREE, timestamp, serial, oldHeapID, oldActualSize); - } - else if(heapID != oldHeapID || actualSize != oldActualSize) - { - /* - ** Reallocs which moved generate two events. - ** Reallocs which changed size generate two events. - ** - ** One event to free the old memory area. - ** Another event to allocate the new memory area. - ** They are to be linked to one another, so the history - ** and true origin can be tracked. - */ - stats->mLoopExitTMR = complexHeapEvent(stats, timestamp, oldSerial, oldHeapID, oldActualSize, serial, heapID, actualSize); - } - else - { - /* - ** The realloc is not considered an operation and is skipped. - ** It is not an operation, because it did not move or change - ** size; this can happen if a realloc falls within the - ** alignment of an allocation. - ** Say if you realloc a 1 byte allocation to 2 bytes, it will - ** not really change heap impact unless you have 1 set as - ** the alignment of your allocations. - */ - } - } - else if(TM_EVENT_FREE == type) - { - /* - ** Generate a free event to create a fragment. - */ - stats->mLoopExitTMR = simpleHeapEvent(stats, FREE, timestamp, serial, heapID, actualSize); - } - else - { - /* - ** Generate an allocation event to clear fragments. - */ - stats->mLoopExitTMR = simpleHeapEvent(stats, ALLOC, timestamp, serial, heapID, actualSize); - } - } -} - - -int tmfrags(Options* inOptions) -/* -** Load the input file and report stats. -*/ -{ - int retval = 0; - TMState stats; - - memset(&stats, 0, sizeof(stats)); - stats.mOptions = inOptions; - stats.uMinTicks = 0xFFFFFFFFU; - - /* - ** Need a tmreader. - */ - stats.mTMR = tmreader_new(inOptions->mProgramName, &stats); - if(NULL != stats.mTMR) - { - int tmResult = 0; - - tmResult = tmreader_eventloop(stats.mTMR, inOptions->mInputName, tmEventHandler); - if(0 == tmResult) - { - retval = __LINE__; - ERROR_REPORT(retval, inOptions->mInputName, "Problem reading trace-malloc data."); - } - if(0 != stats.mLoopExitTMR) - { - retval = stats.mLoopExitTMR; - ERROR_REPORT(retval, inOptions->mInputName, "Aborted trace-malloc input loop."); - } - - tmreader_destroy(stats.mTMR); - stats.mTMR = NULL; - } - else - { - retval = __LINE__; - ERROR_REPORT(retval, inOptions->mProgramName, "Unable to obtain tmreader."); - } - - return retval; -} - - -int main(int inArgc, char** inArgv) -{ - int retval = 0; - Options options; - - retval = initOptions(&options, inArgc, inArgv); - if(options.mHelp) - { - showHelp(&options); - } - else if(0 == retval) - { - retval = tmfrags(&options); - } - - cleanOptions(&options); - return retval; -} - diff --git a/mozilla/tools/trace-malloc/tmreader.c b/mozilla/tools/trace-malloc/tmreader.c deleted file mode 100644 index af8bf3e4225..00000000000 --- a/mozilla/tools/trace-malloc/tmreader.c +++ /dev/null @@ -1,881 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is tmreader.h/tmreader.c code, released - * July 7, 2000. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Brendan Eich, 7-July-2000 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include -#include -#include -#include /* XXX push error reporting out to clients? */ -#ifndef XP_WIN -#include -#else -#include -#endif -#include "prlog.h" -#include "plhash.h" -/* make sure this happens before tmreader.h */ -#define PL_ARENA_CONST_ALIGN_MASK 2 -#include "plarena.h" - -#include "prnetdb.h" -#include "nsTraceMalloc.h" -#include "tmreader.h" - -static int accum_byte(FILE *fp, uint32 *uip) -{ - int c = getc(fp); - if (c == EOF) - return 0; - *uip = (*uip << 8) | c; - return 1; -} - -static int get_uint32(FILE *fp, uint32 *uip) -{ - int c; - uint32 ui; - - c = getc(fp); - if (c == EOF) - return 0; - ui = 0; - if (c & 0x80) { - c &= 0x7f; - if (c & 0x40) { - c &= 0x3f; - if (c & 0x20) { - c &= 0x1f; - if (c & 0x10) { - if (!accum_byte(fp, &ui)) - return 0; - } else { - ui = (uint32) c; - } - if (!accum_byte(fp, &ui)) - return 0; - } else { - ui = (uint32) c; - } - if (!accum_byte(fp, &ui)) - return 0; - } else { - ui = (uint32) c; - } - if (!accum_byte(fp, &ui)) - return 0; - } else { - ui = (uint32) c; - } - *uip = ui; - return 1; -} - -static char *get_string(FILE *fp) -{ - char *cp; - int c; - static char buf[256]; - static char *bp = buf, *ep = buf + sizeof buf; - static size_t bsize = sizeof buf; - - cp = bp; - do { - c = getc(fp); - if (c == EOF) - return 0; - if (cp == ep) { - if (bp == buf) { - bp = malloc(2 * bsize); - if (bp) - memcpy(bp, buf, bsize); - } else { - bp = realloc(bp, 2 * bsize); - } - if (!bp) - return 0; - cp = bp + bsize; - bsize *= 2; - ep = bp + bsize; - } - *cp++ = c; - } while (c != '\0'); - return strdup(bp); -} - -static int get_tmevent(FILE *fp, tmevent *event) -{ - int c; - char *s; - - c = getc(fp); - if (c == EOF) - return 0; - event->type = (char) c; - if (!get_uint32(fp, &event->serial)) - return 0; - switch (c) { - case TM_EVENT_LIBRARY: - s = get_string(fp); - if (!s) - return 0; - event->u.libname = s; - break; - - case TM_EVENT_FILENAME: - s = get_string(fp); - if (!s) - return 0; - event->u.srcname = s; - break; - - case TM_EVENT_METHOD: - if (!get_uint32(fp, &event->u.method.library)) - return 0; - if (!get_uint32(fp, &event->u.method.filename)) - return 0; - if (!get_uint32(fp, &event->u.method.linenumber)) - return 0; - s = get_string(fp); - if (!s) - return 0; - event->u.method.name = s; - break; - - case TM_EVENT_CALLSITE: - if (!get_uint32(fp, &event->u.site.parent)) - return 0; - if (!get_uint32(fp, &event->u.site.method)) - return 0; - if (!get_uint32(fp, &event->u.site.offset)) - return 0; - break; - - case TM_EVENT_MALLOC: - case TM_EVENT_CALLOC: - case TM_EVENT_FREE: - if (!get_uint32(fp, &event->u.alloc.interval)) - return 0; - if (!get_uint32(fp, &event->u.alloc.cost)) - return 0; - if (!get_uint32(fp, &event->u.alloc.ptr)) - return 0; - if (!get_uint32(fp, &event->u.alloc.size)) - return 0; - event->u.alloc.oldserial = 0; - event->u.alloc.oldptr = 0; - event->u.alloc.oldsize = 0; -#if defined(DEBUG_dp) - if (c == TM_EVENT_MALLOC) - printf("%d malloc %d 0x%p\n", event->u.alloc.cost, - event->u.alloc.size, event->u.alloc.ptr); - else if (c == TM_EVENT_CALLOC) - printf("%d calloc %d 0x%p\n", event->u.alloc.cost, - event->u.alloc.size, event->u.alloc.ptr); - else - printf("%d free %d 0x%p\n", event->u.alloc.cost, - event->u.alloc.size, event->u.alloc.ptr); -#endif - break; - - case TM_EVENT_REALLOC: - if (!get_uint32(fp, &event->u.alloc.interval)) - return 0; - if (!get_uint32(fp, &event->u.alloc.cost)) - return 0; - if (!get_uint32(fp, &event->u.alloc.ptr)) - return 0; - if (!get_uint32(fp, &event->u.alloc.size)) - return 0; - if (!get_uint32(fp, &event->u.alloc.oldserial)) - return 0; - if (!get_uint32(fp, &event->u.alloc.oldptr)) - return 0; - if (!get_uint32(fp, &event->u.alloc.oldsize)) - return 0; -#if defined(DEBUG_dp) - printf("%d realloc %d 0x%p %d\n", event->u.alloc.cost, - event->u.alloc.size, event->u.alloc.ptr, event->u.alloc.oldsize); -#endif - break; - - case TM_EVENT_STATS: - if (!get_uint32(fp, &event->u.stats.tmstats.calltree_maxstack)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.calltree_maxdepth)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.calltree_parents)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.calltree_maxkids)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.calltree_kidhits)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.calltree_kidmisses)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.calltree_kidsteps)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.callsite_recurrences)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.backtrace_calls)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.backtrace_failures)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.btmalloc_failures)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.dladdr_failures)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.malloc_calls)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.malloc_failures)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.calloc_calls)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.calloc_failures)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.realloc_calls)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.realloc_failures)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.free_calls)) - return 0; - if (!get_uint32(fp, &event->u.stats.tmstats.null_free_calls)) - return 0; - if (!get_uint32(fp, &event->u.stats.calltree_maxkids_parent)) - return 0; - if (!get_uint32(fp, &event->u.stats.calltree_maxstack_top)) - return 0; - break; - } - return 1; -} - -static void *arena_alloc(void* pool, PRSize size) -{ - PLArenaPool* arena = (PLArenaPool*)pool; - void* result; - PL_ARENA_ALLOCATE(result, arena, size); - memset(result, 0, size); - return result; -} - -static void *generic_alloctable(void *pool, PRSize size) -{ - return arena_alloc(pool, size); -} - -static void generic_freetable(void *pool, void *item) -{ - /* do nothing - arena-allocated */ -} - -static PLHashEntry *filename_allocentry(void *pool, const void *key) -{ - return (PLHashEntry*)arena_alloc(pool, sizeof(PLHashEntry)); -} - -static PLHashEntry *callsite_allocentry(void *pool, const void *key) -{ - return (PLHashEntry*)arena_alloc(pool, sizeof(tmcallsite)); -} - -static void init_graphnode(tmgraphnode* node) -{ - node->in = node->out = NULL; - node->up = node->down = node->next = NULL; - node->low = 0; - node->allocs.bytes.direct = node->allocs.bytes.total = 0; - node->allocs.calls.direct = node->allocs.calls.total = 0; - node->frees.bytes.direct = node->frees.bytes.total = 0; - node->frees.calls.direct = node->frees.calls.total = 0; - node->sqsum = 0; - node->sort = -1; -} - -static PLHashEntry *graphnode_allocentry(void *pool, const void *key) -{ - tmgraphnode* node = (tmgraphnode*)arena_alloc(pool, sizeof(tmgraphnode)); - if (!node) - return NULL; - init_graphnode(node); - return &node->entry; -} - -static void init_method(tmmethodnode *node) -{ - node->graphnode.in = node->graphnode.out = NULL; - node->graphnode.up = node->graphnode.down = node->graphnode.next = NULL; - node->graphnode.low = 0; - node->graphnode.allocs.bytes.direct = node->graphnode.allocs.bytes.total = 0; - node->graphnode.allocs.calls.direct = node->graphnode.allocs.calls.total = 0; - node->graphnode.frees.bytes.direct = node->graphnode.frees.bytes.total = 0; - node->graphnode.frees.calls.direct = node->graphnode.frees.calls.total = 0; - node->graphnode.sqsum = 0; - node->graphnode.sort = -1; - node->sourcefile = NULL; - node->linenumber = 0; -} - -static PLHashEntry *method_allocentry(void *pool, const void *key) -{ - tmmethodnode *node = - (tmmethodnode*) arena_alloc(pool, sizeof(tmmethodnode)); - if (!node) - return NULL; - init_method(node); - return &node->graphnode.entry; -} - -static void graphnode_freeentry(void *pool, PLHashEntry *he, PRUintn flag) -{ - /* Always free the value, which points to a strdup'd string. */ - free(he->value); -#if 0 /* using arenas now, no freeing! */ - /* Free the whole thing if we're told to. */ - if (flag == HT_FREE_ENTRY) - free((void*) he); -#endif -} - -static void component_freeentry(void *pool, PLHashEntry *he, PRUintn flag) -{ - if (flag == HT_FREE_ENTRY) { - tmgraphnode *comp = (tmgraphnode*) he; - - /* Free the key, which was strdup'd (N.B. value also points to it). */ - free((void*) tmcomponent_name(comp)); -#if 0 /* using arenas now, no freeing! */ - free((void*) comp); -#endif - } -} - -static PLHashAllocOps filename_hashallocops = { - generic_alloctable, generic_freetable, - filename_allocentry, graphnode_freeentry -}; - -static PLHashAllocOps callsite_hashallocops = { - generic_alloctable, generic_freetable, - callsite_allocentry, graphnode_freeentry -}; - -static PLHashAllocOps graphnode_hashallocops = { - generic_alloctable, generic_freetable, - graphnode_allocentry, graphnode_freeentry -}; - -static PLHashAllocOps method_hashallocops = { - generic_alloctable, generic_freetable, - method_allocentry, graphnode_freeentry -}; - -static PLHashAllocOps component_hashallocops = { - generic_alloctable, generic_freetable, - graphnode_allocentry, component_freeentry -}; - -static PLHashNumber hash_serial(const void *key) -{ - return (PLHashNumber) key; -} - -tmreader *tmreader_new(const char *program, void *data) -{ - tmreader *tmr; - - tmr = calloc(1, sizeof *tmr); - if (!tmr) - return NULL; - tmr->program = program; - tmr->data = data; - PL_INIT_ARENA_POOL(&tmr->arena, "TMReader", 256*1024); - - tmr->libraries = PL_NewHashTable(100, hash_serial, PL_CompareValues, - PL_CompareStrings, &graphnode_hashallocops, - &tmr->arena); - tmr->filenames = PL_NewHashTable(100, hash_serial, PL_CompareValues, - PL_CompareStrings, &filename_hashallocops, - &tmr->arena); - tmr->components = PL_NewHashTable(10000, PL_HashString, PL_CompareStrings, - PL_CompareValues, &component_hashallocops, - &tmr->arena); - tmr->methods = PL_NewHashTable(10000, hash_serial, PL_CompareValues, - PL_CompareStrings, &method_hashallocops, - &tmr->arena); - tmr->callsites = PL_NewHashTable(200000, hash_serial, PL_CompareValues, - PL_CompareValues, &callsite_hashallocops, - &tmr->arena); - tmr->calltree_root.entry.value = (void*) strdup("root"); - - if (!tmr->libraries || !tmr->components || !tmr->methods || - !tmr->callsites || !tmr->calltree_root.entry.value || - !tmr->filenames) { - tmreader_destroy(tmr); - return NULL; - } - return tmr; -} - -void tmreader_destroy(tmreader *tmr) -{ - if (tmr->libraries) - PL_HashTableDestroy(tmr->libraries); - if (tmr->filenames) - PL_HashTableDestroy(tmr->filenames); - if (tmr->components) - PL_HashTableDestroy(tmr->components); - if (tmr->methods) - PL_HashTableDestroy(tmr->methods); - if (tmr->callsites) - PL_HashTableDestroy(tmr->callsites); - PL_FinishArenaPool(&tmr->arena); - free(tmr); -} - -int tmreader_eventloop(tmreader *tmr, const char *filename, - tmeventhandler eventhandler) -{ - FILE *fp; - char buf[NS_TRACE_MALLOC_MAGIC_SIZE]; - tmevent event; - static const char magic[] = NS_TRACE_MALLOC_MAGIC; - - if (strcmp(filename, "-") == 0) { - fp = stdin; - } else { -#if defined(XP_WIN32) - fp = fopen(filename, "rb"); -#else - fp = fopen(filename, "r"); -#endif - if (!fp) { - fprintf(stderr, "%s: can't open %s: %s.\n", - tmr->program, filename, strerror(errno)); - return 0; - } - } - - if (read(fileno(fp), buf, sizeof buf) != sizeof buf || - strncmp(buf, magic, sizeof buf) != 0) { - fprintf(stderr, "%s: bad magic string %s at start of %s.\n", - tmr->program, buf, filename); - fprintf(stderr, "either the data file is out of date,\nor your tools are out of date.\n"); - return 0; - } - - /* Read in ticks per second. Used to convert platform specific intervals to time values */ - if (read(fileno(fp), &tmr->ticksPerSec, sizeof tmr->ticksPerSec) != sizeof tmr->ticksPerSec) { - fprintf(stderr, "%s: Cannot read ticksPerSec. Log file read error.\n", - tmr->program); - return 0; - } - tmr->ticksPerSec = PR_ntohl(tmr->ticksPerSec); -#ifdef DEBUG_dp - printf("DEBUG: ticks per sec = %d\n", tmr->ticksPerSec); -#endif - while (get_tmevent(fp, &event)) { - switch (event.type) { - case TM_EVENT_LIBRARY: { - const void *key; - PLHashNumber hash; - PLHashEntry **hep, *he; - - key = (const void*) event.serial; - hash = hash_serial(key); - hep = PL_HashTableRawLookup(tmr->libraries, hash, key); - he = *hep; - PR_ASSERT(!he); - if (he) exit(2); - - he = PL_HashTableRawAdd(tmr->libraries, hep, hash, key, - event.u.libname); - if (!he) { - perror(tmr->program); - return -1; - } - break; - } - - case TM_EVENT_FILENAME: { - const void *key; - PLHashNumber hash; - PLHashEntry **hep, *he; - - key = (const void*) event.serial; - hash = hash_serial(key); - hep = PL_HashTableRawLookup(tmr->filenames, hash, key); - he = *hep; - PR_ASSERT(!he); - if (he) exit(2); - - he = PL_HashTableRawAdd(tmr->filenames, hep, hash, key, - event.u.srcname); - if (!he) { - perror(tmr->program); - return -1; - } - break; - } - - case TM_EVENT_METHOD: { - const void *key, *sourcekey; - PLHashNumber hash, sourcehash; - PLHashEntry **hep, *he, **sourcehep, *sourcehe; - char *name, *head, *mark, save; - tmgraphnode *comp, *lib; - tmmethodnode *meth; - - key = (const void*) event.serial; - hash = hash_serial(key); - hep = PL_HashTableRawLookup(tmr->methods, hash, key); - he = *hep; - PR_ASSERT(!he); - if (he) exit(2); - - name = event.u.method.name; - he = PL_HashTableRawAdd(tmr->methods, hep, hash, key, name); - if (!he) { - perror(tmr->program); - return -1; - } - meth = (tmmethodnode*) he; - - meth->linenumber = event.u.method.linenumber; - sourcekey = (const void*)event.u.method.filename; - sourcehash = hash_serial(sourcekey); - sourcehep = PL_HashTableRawLookup(tmr->filenames, sourcehash, sourcekey); - sourcehe = *sourcehep; - meth->sourcefile = filename_name(sourcehe); - - head = name; - mark = strchr(name, ':'); - if (!mark) { - mark = name; - while (*mark != '\0' && *mark == '_') - mark++; - head = mark; - mark = strchr(head, '_'); - if (!mark) { - mark = strchr(head, '+'); - if (!mark) - mark = head + strlen(head); - } - } - - save = *mark; - *mark = '\0'; - hash = PL_HashString(head); - hep = PL_HashTableRawLookup(tmr->components, hash, head); - he = *hep; - if (he) { - comp = (tmgraphnode*) he; - } else { - head = strdup(head); - if (head) { - he = PL_HashTableRawAdd(tmr->components, hep, hash, head, - head); - } - if (!he) { - perror(tmr->program); - return -1; - } - comp = (tmgraphnode*) he; - - key = (const void*) event.u.method.library; - hash = hash_serial(key); - lib = (tmgraphnode*) - *PL_HashTableRawLookup(tmr->libraries, hash, key); - if (lib) { - comp->up = lib; - comp->next = lib->down; - lib->down = comp; - } - } - *mark = save; - - meth->graphnode.up = comp; - meth->graphnode.next = comp->down; - comp->down = &(meth->graphnode); - break; - } - - case TM_EVENT_CALLSITE: { - const void *key, *mkey; - PLHashNumber hash, mhash; - PLHashEntry **hep, *he; - tmcallsite *site, *parent; - tmmethodnode *meth; - - key = (const void*) event.serial; - hash = hash_serial(key); - hep = PL_HashTableRawLookup(tmr->callsites, hash, key); - he = *hep; - - /* there should not be an entry here! */ - PR_ASSERT(!he); - if (he) exit(2); - - if (event.u.site.parent == 0) { - parent = &tmr->calltree_root; - } else { - parent = tmreader_callsite(tmr, event.u.site.parent); - if (!parent) { - fprintf(stderr, "%s: no parent for %lu (%lu)!\n", - tmr->program, (unsigned long) event.serial, - (unsigned long) event.u.site.parent); - continue; - } - } - - he = PL_HashTableRawAdd(tmr->callsites, hep, hash, key, NULL); - if (!he) { - perror(tmr->program); - return -1; - } - - site = (tmcallsite*) he; - site->parent = parent; - site->siblings = parent->kids; - parent->kids = site; - site->kids = NULL; - - mkey = (const void*) event.u.site.method; - mhash = hash_serial(mkey); - meth = (tmmethodnode*) - *PL_HashTableRawLookup(tmr->methods, mhash, mkey); - site->method = meth; - site->offset = event.u.site.offset; - site->allocs.bytes.direct = site->allocs.bytes.total = 0; - site->allocs.calls.direct = site->allocs.calls.total = 0; - site->frees.bytes.direct = site->frees.bytes.total = 0; - site->frees.calls.direct = site->frees.calls.total = 0; - break; - } - - case TM_EVENT_MALLOC: - case TM_EVENT_CALLOC: - case TM_EVENT_REALLOC: { - tmcallsite *site; - uint32 size, oldsize; - double delta, sqdelta, sqszdelta = 0; - tmgraphnode *comp, *lib; - tmmethodnode *meth; - - site = tmreader_callsite(tmr, event.serial); - if (!site) { - fprintf(stderr, "%s: no callsite for '%c' (%lu)!\n", - tmr->program, event.type, (unsigned long) event.serial); - continue; - } - - size = event.u.alloc.size; - oldsize = event.u.alloc.oldsize; - delta = (double)size - (double)oldsize; - site->allocs.bytes.direct += (unsigned long)delta; - if (event.type != TM_EVENT_REALLOC) - site->allocs.calls.direct++; - meth = site->method; - if (meth) { - meth->graphnode.allocs.bytes.direct += (unsigned long)delta; - sqdelta = delta * delta; - if (event.type == TM_EVENT_REALLOC) { - sqszdelta = ((double)size * size) - - ((double)oldsize * oldsize); - meth->graphnode.sqsum += sqszdelta; - } else { - meth->graphnode.sqsum += sqdelta; - meth->graphnode.allocs.calls.direct++; - } - comp = meth->graphnode.up; - if (comp) { - comp->allocs.bytes.direct += (unsigned long)delta; - if (event.type == TM_EVENT_REALLOC) { - comp->sqsum += sqszdelta; - } else { - comp->sqsum += sqdelta; - comp->allocs.calls.direct++; - } - lib = comp->up; - if (lib) { - lib->allocs.bytes.direct += (unsigned long)delta; - if (event.type == TM_EVENT_REALLOC) { - lib->sqsum += sqszdelta; - } else { - lib->sqsum += sqdelta; - lib->allocs.calls.direct++; - } - } - } - } - break; - } - - case TM_EVENT_FREE: { - tmcallsite *site; - uint32 size; - tmgraphnode *comp, *lib; - tmmethodnode *meth; - - site = tmreader_callsite(tmr, event.serial); - if (!site) { - fprintf(stderr, "%s: no callsite for '%c' (%lu)!\n", - tmr->program, event.type, (unsigned long) event.serial); - continue; - } - size = event.u.alloc.size; - site->frees.bytes.direct += size; - site->frees.calls.direct++; - meth = site->method; - if (meth) { - meth->graphnode.frees.bytes.direct += size; - meth->graphnode.frees.calls.direct++; - comp = meth->graphnode.up; - if (comp) { - comp->frees.bytes.direct += size; - comp->frees.calls.direct++; - lib = comp->up; - if (lib) { - lib->frees.bytes.direct += size; - lib->frees.calls.direct++; - } - } - } - break; - } - - case TM_EVENT_STATS: - break; - } - - eventhandler(tmr, &event); - } - - return 1; -} - -tmgraphnode *tmreader_library(tmreader *tmr, uint32 serial) -{ - const void *key; - PLHashNumber hash; - - key = (const void*) serial; - hash = hash_serial(key); - return (tmgraphnode*) *PL_HashTableRawLookup(tmr->libraries, hash, key); -} - -tmgraphnode *tmreader_filename(tmreader *tmr, uint32 serial) -{ - const void *key; - PLHashNumber hash; - - key = (const void*) serial; - hash = hash_serial(key); - return (tmgraphnode*) *PL_HashTableRawLookup(tmr->filenames, hash, key); -} - -tmgraphnode *tmreader_component(tmreader *tmr, const char *name) -{ - PLHashNumber hash; - - hash = PL_HashString(name); - return (tmgraphnode*) *PL_HashTableRawLookup(tmr->components, hash, name); -} - -tmmethodnode *tmreader_method(tmreader *tmr, uint32 serial) -{ - const void *key; - PLHashNumber hash; - - key = (const void*) serial; - hash = hash_serial(key); - return (tmmethodnode*) *PL_HashTableRawLookup(tmr->methods, hash, key); -} - -tmcallsite *tmreader_callsite(tmreader *tmr, uint32 serial) -{ - const void *key; - PLHashNumber hash; - - key = (const void*) serial; - hash = hash_serial(key); - return (tmcallsite*) *PL_HashTableRawLookup(tmr->callsites, hash, key); -} - -int tmgraphnode_connect(tmgraphnode *from, tmgraphnode *to, tmcallsite *site) -{ - tmgraphlink *outlink; - tmgraphedge *edge; - - for (outlink = from->out; outlink; outlink = outlink->next) { - if (outlink->node == to) { - /* - * Say the stack looks like this: ... => JS => js => JS => js. - * We must avoid overcounting JS=>js because the first edge total - * includes the second JS=>js edge's total (which is because the - * lower site's total includes all its kids' totals). - */ - edge = TM_LINK_TO_EDGE(outlink, TM_EDGE_OUT_LINK); - if (!to->low || to->low < from->low) { - /* Add the direct and total counts to edge->allocs. */ - edge->allocs.bytes.direct += site->allocs.bytes.direct; - edge->allocs.bytes.total += site->allocs.bytes.total; - edge->allocs.calls.direct += site->allocs.calls.direct; - edge->allocs.calls.total += site->allocs.calls.total; - - /* Now update the free counts. */ - edge->frees.bytes.direct += site->frees.bytes.direct; - edge->frees.bytes.total += site->frees.bytes.total; - edge->frees.calls.direct += site->frees.calls.direct; - edge->frees.calls.total += site->frees.calls.total; - } - return 1; - } - } - - edge = (tmgraphedge*) malloc(sizeof(tmgraphedge)); - if (!edge) - return 0; - edge->links[TM_EDGE_OUT_LINK].node = to; - edge->links[TM_EDGE_OUT_LINK].next = from->out; - from->out = &edge->links[TM_EDGE_OUT_LINK]; - edge->links[TM_EDGE_IN_LINK].node = from; - edge->links[TM_EDGE_IN_LINK].next = to->in; - to->in = &edge->links[TM_EDGE_IN_LINK]; - edge->allocs = site->allocs; - edge->frees = site->frees; - return 1; -} diff --git a/mozilla/tools/trace-malloc/tmreader.h b/mozilla/tools/trace-malloc/tmreader.h deleted file mode 100644 index 9b55e70a90e..00000000000 --- a/mozilla/tools/trace-malloc/tmreader.h +++ /dev/null @@ -1,222 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is tmreader.h/tmreader.c code, released - * July 7, 2000. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Brendan Eich, 7-July-2000 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef tmreader_h___ -#define tmreader_h___ - -#include "prtypes.h" -#include "plhash.h" -#include "nsTraceMalloc.h" -#include "plarena.h" - -PR_BEGIN_EXTERN_C - -typedef struct tmreader tmreader; -typedef struct tmevent tmevent; -typedef struct tmcounts tmcounts; -typedef struct tmallcounts tmallcounts; -typedef struct tmgraphlink tmgraphlink; -typedef struct tmgraphedge tmgraphedge; -typedef struct tmgraphnode tmgraphnode; -typedef struct tmcallsite tmcallsite; -typedef struct tmmethodnode tmmethodnode; - -struct tmevent { - char type; - uint32 serial; - union { - char *libname; - char *srcname; - struct { - uint32 library; - uint32 filename; - uint32 linenumber; - char *name; - } method; - struct { - uint32 parent; - uint32 method; - uint32 offset; - } site; - struct { - uint32 interval; /* in ticks */ - uint32 ptr; - uint32 size; - uint32 oldserial; - uint32 oldptr; - uint32 oldsize; - uint32 cost; /* in ticks */ - } alloc; - struct { - nsTMStats tmstats; - uint32 calltree_maxkids_parent; - uint32 calltree_maxstack_top; - } stats; - } u; -}; - -struct tmcounts { - uint32 direct; /* things allocated by this node's code */ - uint32 total; /* direct + things from all descendents */ -}; - -struct tmallcounts { - tmcounts bytes; - tmcounts calls; -}; - -struct tmgraphnode { - PLHashEntry entry; /* key is serial or name, value must be name */ - tmgraphlink *in; - tmgraphlink *out; - tmgraphnode *up; /* parent in supergraph, e.g., JS for JS_*() */ - tmgraphnode *down; /* subgraph kids, declining bytes.total order */ - tmgraphnode *next; /* next kid in supergraph node's down list */ - int low; /* 0 or lowest current tree walk level */ - tmallcounts allocs; - tmallcounts frees; - double sqsum; /* sum of squared bytes.direct */ - int sort; /* sorted index in node table, -1 if no table */ -}; - -struct tmmethodnode { - tmgraphnode graphnode; - char *sourcefile; - uint32 linenumber; -}; - -#define tmgraphnode_name(node) ((char*) (node)->entry.value) -#define tmmethodnode_name(node) ((char*) (node)->graphnode.entry.value) - -#define tmlibrary_serial(lib) ((uint32) (lib)->entry.key) -#define tmcomponent_name(comp) ((const char*) (comp)->entry.key) -#define filename_name(hashentry) ((char*)hashentry->value) - -/* Half a graphedge, not including per-edge allocation stats. */ -struct tmgraphlink { - tmgraphlink *next; /* next fanning out from or into a node */ - tmgraphnode *node; /* the other node (to if OUT, from if IN) */ -}; - -/* - * It's safe to downcast a "from" tmgraphlink (one linked from a node's out - * pointer) to tmgraphedge. To go from an "out" (linked via tmgraphedge.from) - * or "in" (linked via tmgraphedge.to) list link to its containing edge, use - * TM_LINK_TO_EDGE(link, which). - */ -struct tmgraphedge { - tmgraphlink links[2]; - tmallcounts allocs; - tmallcounts frees; -}; - -/* Indices into tmgraphedge.links -- out must come first. */ -#define TM_EDGE_OUT_LINK 0 -#define TM_EDGE_IN_LINK 1 - -#define TM_LINK_TO_EDGE(link,which) ((tmgraphedge*) &(link)[-(which)]) - -struct tmcallsite { - PLHashEntry entry; /* key is site serial number */ - tmcallsite *parent; /* calling site */ - tmcallsite *siblings; /* other sites reached from parent */ - tmcallsite *kids; /* sites reached from here */ - tmmethodnode *method; /* method node in tmr->methods graph */ - uint32 offset; /* pc offset from start of method */ - tmallcounts allocs; - tmallcounts frees; - void *data; /* tmreader clients can stick arbitrary - * data onto a callsite. - */ -}; - -struct tmreader { - const char *program; - void *data; - PLHashTable *libraries; - PLHashTable *filenames; - PLHashTable *components; - PLHashTable *methods; - PLHashTable *callsites; - PLArenaPool arena; - tmcallsite calltree_root; - uint32 ticksPerSec; -}; - -typedef void (*tmeventhandler)(tmreader *tmr, tmevent *event); - -/* The tmreader constructor and destructor. */ -extern tmreader *tmreader_new(const char *program, void *data); -extern void tmreader_destroy(tmreader *tmr); - -/* - * Return -1 on permanent fatal error, 0 if filename can't be opened or is not - * a trace-malloc logfile, and 1 on success. - */ -extern int tmreader_eventloop(tmreader *tmr, const char *filename, - tmeventhandler eventhandler); - -/* Map serial number or name to graphnode or callsite. */ -extern tmgraphnode *tmreader_library(tmreader *tmr, uint32 serial); -extern tmgraphnode *tmreader_filename(tmreader *tmr, uint32 serial); -extern tmgraphnode *tmreader_component(tmreader *tmr, const char *name); -extern tmmethodnode *tmreader_method(tmreader *tmr, uint32 serial); -extern tmcallsite *tmreader_callsite(tmreader *tmr, uint32 serial); - -/* - * Connect node 'from' to node 'to' with an edge, if there isn't one already - * connecting the nodes. Add site's allocation stats to the edge only if we - * create the edge, or if we find that it exists, but that to->low is zero or - * less than from->low. - * - * If the callsite tree already totals allocation costs (tmcounts.total for - * each site includes tmcounts.direct for that site, plus tmcounts.total for - * all kid sites), then the node->low watermarks should be set from the tree - * level when walking the callsite tree, and should be set to non-zero values - * only if zero (the root is at level 0). A low watermark should be cleared - * when the tree walk unwinds past the level at which it was set non-zero. - * - * Return 0 on error (malloc failure) and 1 on success. - */ -extern int tmgraphnode_connect(tmgraphnode *from, tmgraphnode *to, - tmcallsite *site); - -PR_END_EXTERN_C - -#endif /* tmreader_h___ */ diff --git a/mozilla/tools/trace-malloc/tmstats.c b/mozilla/tools/trace-malloc/tmstats.c deleted file mode 100644 index eb1d936651b..00000000000 --- a/mozilla/tools/trace-malloc/tmstats.c +++ /dev/null @@ -1,880 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is tmstats.c code, released - * Oct 25, 2002. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Garrett Arch Blythe, 25-October-2002 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include -#include -#include -#include -#include -#include -#include - -#include "nspr.h" -#include "tmreader.h" - -#define ERROR_REPORT(num, val, msg) fprintf(stderr, "error(%d):\t\"%s\"\t%s\n", (num), (val), (msg)); -#define CLEANUP(ptr) do { if(NULL != ptr) { free(ptr); ptr = NULL; } } while(0) - - -#define COST_RESOLUTION 1000 -#define COST_PRINTABLE(cost) ((PRFloat64)(cost) / (PRFloat64)COST_RESOLUTION) - - -typedef struct __struct_Options -/* -** Options to control how we perform. -** -** mProgramName Used in help text. -** mInputName Name of the file. -** mOutput Output file, append. -** Default is stdout. -** mOutputName Name of the file. -** mHelp Wether or not help should be shown. -** mOverhead How much overhead an allocation will have. -** mAlignment What boundry will the end of an allocation line up on. -** mAverages Whether or not to display averages. -** mDeviances Whether or not to display standard deviations. -** mRunLength Whether or not to display run length. -*/ -{ - const char* mProgramName; - char* mInputName; - FILE* mOutput; - char* mOutputName; - int mHelp; - unsigned mOverhead; - unsigned mAlignment; - int mAverages; - int mDeviances; - int mRunLength; -} -Options; - - -typedef struct __struct_Switch -/* -** Command line options. -*/ -{ - const char* mLongName; - const char* mShortName; - int mHasValue; - const char* mValue; - const char* mDescription; -} -Switch; - -#define DESC_NEWLINE "\n\t\t" - -static Switch gInputSwitch = {"--input", "-i", 1, NULL, "Specify input file." DESC_NEWLINE "stdin is default."}; -static Switch gOutputSwitch = {"--output", "-o", 1, NULL, "Specify output file." DESC_NEWLINE "Appends if file exists." DESC_NEWLINE "stdout is default."}; -static Switch gHelpSwitch = {"--help", "-h", 0, NULL, "Information on usage."}; -static Switch gAlignmentSwitch = {"--alignment", "-al", 1, NULL, "All allocation sizes are made to be a multiple of this number." DESC_NEWLINE "Closer to actual heap conditions; set to 1 for true sizes." DESC_NEWLINE "Default value is 16."}; -static Switch gOverheadSwitch = {"--overhead", "-ov", 1, NULL, "After alignment, all allocations are made to increase by this number." DESC_NEWLINE "Closer to actual heap conditions; set to 0 for true sizes." DESC_NEWLINE "Default value is 8."}; -static Switch gAveragesSwitch = {"--averages", "-avg", 0, NULL, "Display averages."}; -static Switch gDeviationsSwitch = {"--deviations", "-dev", 0, NULL, "Display standard deviations from the average." DESC_NEWLINE "Implies --averages."}; -static Switch gRunLengthSwitch = {"--run-length", "-rl", 0, NULL, "Display the run length in seconds."}; - -static Switch* gSwitches[] = { - &gInputSwitch, - &gOutputSwitch, - &gAlignmentSwitch, - &gOverheadSwitch, - &gAveragesSwitch, - &gDeviationsSwitch, - &gRunLengthSwitch, - &gHelpSwitch -}; - - -typedef struct _struct_VarianceState -/* -** State for a single pass variance calculation. -*/ -{ - unsigned mCount; - PRUint64 mSum; - PRUint64 mSquaredSum; -} -VarianceState; - - -typedef struct __struct_TMStats -/* -** Stats we are trying to calculate. -** -** mOptions Obilgatory options pointer. -** uMemoryInUse Current tally of memory in use. -** uPeakMemory Heap topped out at this byte level. -** uObjectsInUse Different allocations outstanding. -** uPeakObjects Highest object count. -** uMallocs Number of malloc calls. -** uCallocs Number of calloc calls. -** uReallocs Number of realloc calls. -** uFrees Number of free calls. -** uMallocSize Bytes from malloc. -** uCallocSize Bytes from calloc. -** uReallocSize Bytes from realloc. -** uFreeSize Bytes from free. -** mMallocSizeVar Variance of bytes. -** mCallocSizeVar Variance of bytes. -** mReallocSizeVar Variance of bytes. -** mFreeSizeVar Variance of bytes. -** uMallocCost Time of mallocs. -** uCallocCost Time of callocs. -** uReallocCost Time of reallocs. -** uFreeCost Time of frees. -** mMallocCostVar Variance of cost. -** mCallocCostVar Variance of cost. -** mReallocCostVar Variance of cost. -** mFreeCostVar Variance of cost. -** uMinTicks Start of run. -** uMaxTicks End of run. -*/ -{ - Options* mOptions; - unsigned uMemoryInUse; - unsigned uPeakMemory; - unsigned uObjectsInUse; - unsigned uPeakObjects; - unsigned uMallocs; - unsigned uCallocs; - unsigned uReallocs; - unsigned uFrees; - - unsigned uMallocSize; - unsigned uCallocSize; - unsigned uReallocSize; - unsigned uFreeSize; - VarianceState mMallocSizeVar; - VarianceState mCallocSizeVar; - VarianceState mReallocSizeVar; - VarianceState mFreeSizeVar; - - unsigned uMallocCost; - unsigned uCallocCost; - unsigned uReallocCost; - unsigned uFreeCost; - VarianceState mMallocCostVar; - VarianceState mCallocCostVar; - VarianceState mReallocCostVar; - VarianceState mFreeCostVar; - - unsigned uMinTicks; - unsigned uMaxTicks; -} -TMStats; - - -int initOptions(Options* outOptions, int inArgc, char** inArgv) -/* -** returns int 0 if successful. -*/ -{ - int retval = 0; - int loop = 0; - int switchLoop = 0; - int match = 0; - const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]); - Switch* current = NULL; - - /* - ** Set any defaults. - */ - memset(outOptions, 0, sizeof(Options)); - outOptions->mProgramName = inArgv[0]; - outOptions->mInputName = strdup("-"); - outOptions->mOutput = stdout; - outOptions->mOutputName = strdup("stdout"); - outOptions->mAlignment = 16; - outOptions->mOverhead = 8; - - if(NULL == outOptions->mOutputName || NULL == outOptions->mInputName) - { - retval = __LINE__; - ERROR_REPORT(retval, "stdin/stdout", "Unable to strdup."); - } - - /* - ** Go through and attempt to do the right thing. - */ - for(loop = 1; loop < inArgc && 0 == retval; loop++) - { - match = 0; - current = NULL; - - for(switchLoop = 0; switchLoop < switchCount && 0 == retval; switchLoop++) - { - if(0 == strcmp(gSwitches[switchLoop]->mLongName, inArgv[loop])) - { - match = __LINE__; - } - else if(0 == strcmp(gSwitches[switchLoop]->mShortName, inArgv[loop])) - { - match = __LINE__; - } - - if(match) - { - if(gSwitches[switchLoop]->mHasValue) - { - /* - ** Attempt to absorb next option to fullfill value. - */ - if(loop + 1 < inArgc) - { - loop++; - - current = gSwitches[switchLoop]; - current->mValue = inArgv[loop]; - } - } - else - { - current = gSwitches[switchLoop]; - } - - break; - } - } - - if(0 == match) - { - outOptions->mHelp = __LINE__; - retval = __LINE__; - ERROR_REPORT(retval, inArgv[loop], "Unknown command line switch."); - } - else if(NULL == current) - { - outOptions->mHelp = __LINE__; - retval = __LINE__; - ERROR_REPORT(retval, inArgv[loop], "Command line switch requires a value."); - } - else - { - /* - ** Do something based on address/swtich. - */ - if(current == &gInputSwitch) - { - CLEANUP(outOptions->mInputName); - outOptions->mInputName = strdup(current->mValue); - if(NULL == outOptions->mInputName) - { - retval = __LINE__; - ERROR_REPORT(retval, current->mValue, "Unable to strdup."); - } - } - else if(current == &gOutputSwitch) - { - CLEANUP(outOptions->mOutputName); - if(NULL != outOptions->mOutput && stdout != outOptions->mOutput) - { - fclose(outOptions->mOutput); - outOptions->mOutput = NULL; - } - - outOptions->mOutput = fopen(current->mValue, "a"); - if(NULL == outOptions->mOutput) - { - retval = __LINE__; - ERROR_REPORT(retval, current->mValue, "Unable to open output file."); - } - else - { - outOptions->mOutputName = strdup(current->mValue); - if(NULL == outOptions->mOutputName) - { - retval = __LINE__; - ERROR_REPORT(retval, current->mValue, "Unable to strdup."); - } - } - } - else if(current == &gHelpSwitch) - { - outOptions->mHelp = __LINE__; - } - else if(current == &gAlignmentSwitch) - { - unsigned arg = 0; - char* endScan = NULL; - - errno = 0; - arg = strtoul(current->mValue, &endScan, 0); - if(0 == errno && endScan != current->mValue) - { - outOptions->mAlignment = arg; - } - else - { - retval = __LINE__; - ERROR_REPORT(retval, current->mValue, "Unable to convert to a number."); - } - } - else if(current == &gOverheadSwitch) - { - unsigned arg = 0; - char* endScan = NULL; - - errno = 0; - arg = strtoul(current->mValue, &endScan, 0); - if(0 == errno && endScan != current->mValue) - { - outOptions->mOverhead = arg; - } - else - { - retval = __LINE__; - ERROR_REPORT(retval, current->mValue, "Unable to convert to a number."); - } - } - else if(current == &gAveragesSwitch) - { - outOptions->mAverages = __LINE__; - } - else if(current == &gDeviationsSwitch) - { - outOptions->mAverages = __LINE__; - outOptions->mDeviances = __LINE__; - } - else if(current == &gRunLengthSwitch) - { - outOptions->mRunLength = __LINE__; - } - else - { - retval = __LINE__; - ERROR_REPORT(retval, current->mLongName, "No hanlder for command line switch."); - } - } - } - - return retval; -} - - -void cleanOptions(Options* inOptions) -/* -** Clean up any open handles. -*/ -{ - unsigned loop = 0; - - CLEANUP(inOptions->mInputName); - CLEANUP(inOptions->mOutputName); - if(NULL != inOptions->mOutput && stdout != inOptions->mOutput) - { - fclose(inOptions->mOutput); - } - - memset(inOptions, 0, sizeof(Options)); -} - - -void showHelp(Options* inOptions) -/* -** Show some simple help text on usage. -*/ -{ - int loop = 0; - const int switchCount = sizeof(gSwitches) / sizeof(gSwitches[0]); - const char* valueText = NULL; - - printf("usage:\t%s [arguments]\n", inOptions->mProgramName); - printf("\n"); - printf("arguments:\n"); - - for(loop = 0; loop < switchCount; loop++) - { - if(gSwitches[loop]->mHasValue) - { - valueText = " "; - } - else - { - valueText = ""; - } - - printf("\t%s%s\n", gSwitches[loop]->mLongName, valueText); - printf("\t %s%s", gSwitches[loop]->mShortName, valueText); - printf(DESC_NEWLINE "%s\n\n", gSwitches[loop]->mDescription); - } - - printf("This tool reports simple heap usage and allocation call counts.\n"); - printf("Useful for eyeballing trace-malloc numbers quickly.\n"); -} - - -void addVariance(VarianceState* inVariance, unsigned inValue) -/* -** Add a value to a variance state. -*/ -{ - PRUint64 squared; - PRUint64 bigValue; - - LL_UI2L(bigValue, inValue); - - LL_ADD(inVariance->mSum, inVariance->mSum, bigValue); - - LL_MUL(squared, bigValue, bigValue); - LL_ADD(inVariance->mSquaredSum, inVariance->mSquaredSum, squared); - - inVariance->mCount++; -} - - -PRFloat64 getAverage(VarianceState* inVariance) -/* -** Determine the mean/average based on the given state. -*/ -{ - PRFloat64 retval = 0.0; - - if(NULL != inVariance && 0 < inVariance->mCount) - { - PRFloat64 count; - PRFloat64 sum; - PRInt64 isum; - - /* - ** Avoids a compiler error (not impl) under MSVC. - */ - isum = inVariance->mSum; - - count = (PRFloat64)inVariance->mCount; - LL_L2F(sum, isum); - - retval = sum / count; - } - - return retval; -} - - -PRFloat64 getVariance(VarianceState* inVariance) -/* -** Determine the variance based on the given state. -*/ -{ - PRFloat64 retval = 0.0; - - if(NULL != inVariance && 1 < inVariance->mCount) - { - PRFloat64 count; - PRFloat64 squaredSum; - PRFloat64 avg; - PRFloat64 squaredAvg; - PRInt64 isquaredSum; - - /* - ** Avoids a compiler error (not impl) under MSVC. - */ - isquaredSum = inVariance->mSquaredSum; - - count = (PRFloat64)inVariance->mCount; - LL_L2F(squaredSum, isquaredSum); - - avg = getAverage(inVariance); - squaredAvg = avg * avg; - - retval = (squaredSum - (count * squaredAvg)) / (count - 1.0); - } - - return retval; -} - - -PRFloat64 getStdDev(VarianceState* inVariance) -/* -** Determine the standard deviation based on the given state. -*/ -{ - PRFloat64 retval = 0.0; - PRFloat64 variance; - - variance = getVariance(inVariance); - retval = sqrt(variance); - - return retval; -} - - -unsigned actualByteSize(Options* inOptions, unsigned retval) -/* -** Apply alignment and overhead to size to figure out actual byte size. -** This by default mimics spacetrace with default options (msvc crt heap). -*/ -{ - if(0 != retval) - { - unsigned eval = 0; - unsigned over = 0; - - eval = retval - 1; - if(0 != inOptions->mAlignment) - { - over = eval % inOptions->mAlignment; - } - retval = eval + inOptions->mOverhead + inOptions->mAlignment - over; - } - - return retval; -} - - -PRUint32 ticks2xsec(tmreader* aReader, PRUint32 aTicks, PRUint32 aResolution) -/* -** Convert platform specific ticks to second units -** Returns 0 on success. -*/ -{ - PRUint32 retval = 0; - PRUint64 bigone; - PRUint64 tmp64; - - LL_UI2L(bigone, aResolution); - LL_UI2L(tmp64, aTicks); - LL_MUL(bigone, bigone, tmp64); - LL_UI2L(tmp64, aReader->ticksPerSec); - LL_DIV(bigone, bigone, tmp64); - LL_L2UI(retval, bigone); - - return retval; -} -#define ticks2msec(reader, ticks) ticks2xsec((reader), (ticks), 1000) - - -void tmEventHandler(tmreader* inReader, tmevent* inEvent) -/* -** Callback from the tmreader_eventloop. -** Keep it simple in here, this is where we'll spend the most time. -** The goal is to be fast. -*/ -{ - TMStats* stats = (TMStats*)inReader->data; - Options* options = (Options*)stats->mOptions; - char type = inEvent->type; - unsigned size = inEvent->u.alloc.size; - unsigned actualSize = 0; - unsigned actualOldSize = 0; - PRUint32 interval = 0; - - /* - ** To match spacetrace stats, reallocs of size zero are frees. - ** Adjust the size to match what free expects. - */ - if(TM_EVENT_REALLOC == type && 0 == size) - { - type = TM_EVENT_FREE; - if(0 != inEvent->u.alloc.oldserial) - { - size = inEvent->u.alloc.oldsize; - } - } - - /* - ** Adjust the size due to the options. - */ - actualSize = actualByteSize(options, size); - if(TM_EVENT_REALLOC == type && 0 != inEvent->u.alloc.oldserial) - { - actualOldSize = actualByteSize(options, inEvent->u.alloc.oldsize); - } - - /* - ** Modify event specific data. - */ - switch(type) - { - case TM_EVENT_MALLOC: - stats->uMallocs++; - stats->uMallocSize += actualSize; - stats->uMallocCost += ticks2msec(inReader, inEvent->u.alloc.cost); - stats->uMemoryInUse += actualSize; - stats->uObjectsInUse++; - - addVariance(&stats->mMallocSizeVar, actualSize); - addVariance(&stats->mMallocCostVar, inEvent->u.alloc.cost); - break; - - case TM_EVENT_CALLOC: - stats->uCallocs++; - stats->uCallocSize += actualSize; - stats->uCallocCost += ticks2msec(inReader, inEvent->u.alloc.cost); - stats->uMemoryInUse += actualSize; - stats->uObjectsInUse++; - - addVariance(&stats->mCallocSizeVar, actualSize); - addVariance(&stats->mCallocCostVar, inEvent->u.alloc.cost); - break; - - case TM_EVENT_REALLOC: - stats->uReallocs++; - stats->uReallocSize -= actualOldSize; - stats->uReallocSize += actualSize; - stats->uReallocCost += ticks2msec(inReader, inEvent->u.alloc.cost); - stats->uMemoryInUse -= actualOldSize; - stats->uMemoryInUse += actualSize; - if(0 == inEvent->u.alloc.oldserial) - { - stats->uObjectsInUse++; - } - - if(actualSize > actualOldSize) - { - addVariance(&stats->mReallocSizeVar, actualSize - actualOldSize); - } - else - { - addVariance(&stats->mReallocSizeVar, actualOldSize - actualSize); - } - addVariance(&stats->mReallocCostVar, inEvent->u.alloc.cost); - break; - - case TM_EVENT_FREE: - stats->uFrees++; - stats->uFreeSize += actualSize; - stats->uFreeCost += ticks2msec(inReader, inEvent->u.alloc.cost); - stats->uMemoryInUse -= actualSize; - stats->uObjectsInUse--; - - addVariance(&stats->mFreeSizeVar, actualSize); - addVariance(&stats->mFreeCostVar, inEvent->u.alloc.cost); - break; - - default: - /* - ** Don't care. - */ - break; - } - - switch(type) - { - case TM_EVENT_MALLOC: - case TM_EVENT_CALLOC: - case TM_EVENT_REALLOC: - /* - ** Check the peaks. - */ - if(stats->uMemoryInUse > stats->uPeakMemory) - { - stats->uPeakMemory = stats->uMemoryInUse; - } - if(stats->uObjectsInUse > stats->uPeakObjects) - { - stats->uPeakObjects = stats->uObjectsInUse; - } - - /* - ** Falling through. - */ - - case TM_EVENT_FREE: - /* - ** Check the overall time. - */ - interval = ticks2msec(inReader, inEvent->u.alloc.interval); - if(stats->uMinTicks > interval) - { - stats->uMinTicks = interval; - } - if(stats->uMaxTicks < interval) - { - stats->uMaxTicks = interval; - } - break; - - default: - /* - ** Don't care. - */ - break; - } - -} - -int report_stats(Options* inOptions, TMStats* inStats) -{ - int retval = 0; - - fprintf(inOptions->mOutput, "Peak Memory Usage: %11d\n", inStats->uPeakMemory); - fprintf(inOptions->mOutput, "Memory Leaked: %11d\n", inStats->uMemoryInUse); - fprintf(inOptions->mOutput, "\n"); - - fprintf(inOptions->mOutput, "Peak Object Count: %11d\n", inStats->uPeakObjects); - fprintf(inOptions->mOutput, "Objects Leaked: %11d\n", inStats->uObjectsInUse); - if(0 != inOptions->mAverages && 0 != inStats->uObjectsInUse) - { - fprintf(inOptions->mOutput, "Average Leaked Object Size: %11.4f\n", (PRFloat64)inStats->uMemoryInUse / (PRFloat64)inStats->uObjectsInUse); - } - fprintf(inOptions->mOutput, "\n"); - - fprintf(inOptions->mOutput, "Call Total: %11d\n", inStats->uMallocs + inStats->uCallocs + inStats->uReallocs + inStats->uFrees); - fprintf(inOptions->mOutput, " malloc: %11d\n", inStats->uMallocs); - fprintf(inOptions->mOutput, " calloc: %11d\n", inStats->uCallocs); - fprintf(inOptions->mOutput, " realloc: %11d\n", inStats->uReallocs); - fprintf(inOptions->mOutput, " free: %11d\n", inStats->uFrees); - fprintf(inOptions->mOutput, "\n"); - - fprintf(inOptions->mOutput, "Byte Total (sans free): %11d\n", inStats->uMallocSize + inStats->uCallocSize + inStats->uReallocSize); - fprintf(inOptions->mOutput, " malloc: %11d\n", inStats->uMallocSize); - fprintf(inOptions->mOutput, " calloc: %11d\n", inStats->uCallocSize); - fprintf(inOptions->mOutput, " realloc: %11d\n", inStats->uReallocSize); - fprintf(inOptions->mOutput, " free: %11d\n", inStats->uFreeSize); - if(0 != inOptions->mAverages) - { - fprintf(inOptions->mOutput, "Byte Averages:\n"); - fprintf(inOptions->mOutput, " malloc: %11.4f\n", getAverage(&inStats->mMallocSizeVar)); - fprintf(inOptions->mOutput, " calloc: %11.4f\n", getAverage(&inStats->mCallocSizeVar)); - fprintf(inOptions->mOutput, " realloc: %11.4f\n", getAverage(&inStats->mReallocSizeVar)); - fprintf(inOptions->mOutput, " free: %11.4f\n", getAverage(&inStats->mFreeSizeVar)); - } - if(0 != inOptions->mDeviances) - { - fprintf(inOptions->mOutput, "Byte Standard Deviations:\n"); - fprintf(inOptions->mOutput, " malloc: %11.4f\n", getStdDev(&inStats->mMallocSizeVar)); - fprintf(inOptions->mOutput, " calloc: %11.4f\n", getStdDev(&inStats->mCallocSizeVar)); - fprintf(inOptions->mOutput, " realloc: %11.4f\n", getStdDev(&inStats->mReallocSizeVar)); - fprintf(inOptions->mOutput, " free: %11.4f\n", getStdDev(&inStats->mFreeSizeVar)); - } - fprintf(inOptions->mOutput, "\n"); - - fprintf(inOptions->mOutput, "Overhead Total: %11.4f\n", COST_PRINTABLE(inStats->uMallocCost) + COST_PRINTABLE(inStats->uCallocCost) + COST_PRINTABLE(inStats->uReallocCost) + COST_PRINTABLE(inStats->uFreeCost)); - fprintf(inOptions->mOutput, " malloc: %11.4f\n", COST_PRINTABLE(inStats->uMallocCost)); - fprintf(inOptions->mOutput, " calloc: %11.4f\n", COST_PRINTABLE(inStats->uCallocCost)); - fprintf(inOptions->mOutput, " realloc: %11.4f\n", COST_PRINTABLE(inStats->uReallocCost)); - fprintf(inOptions->mOutput, " free: %11.4f\n", COST_PRINTABLE(inStats->uFreeCost)); - if(0 != inOptions->mAverages) - { - fprintf(inOptions->mOutput, "Overhead Averages:\n"); - fprintf(inOptions->mOutput, " malloc: %11.4f\n", COST_PRINTABLE(getAverage(&inStats->mMallocCostVar))); - fprintf(inOptions->mOutput, " calloc: %11.4f\n", COST_PRINTABLE(getAverage(&inStats->mCallocCostVar))); - fprintf(inOptions->mOutput, " realloc: %11.4f\n", COST_PRINTABLE(getAverage(&inStats->mReallocCostVar))); - fprintf(inOptions->mOutput, " free: %11.4f\n", COST_PRINTABLE(getAverage(&inStats->mFreeCostVar))); - } - if(0 != inOptions->mDeviances) - { - fprintf(inOptions->mOutput, "Overhead Standard Deviations:\n"); - fprintf(inOptions->mOutput, " malloc: %11.4f\n", COST_PRINTABLE(getStdDev(&inStats->mMallocCostVar))); - fprintf(inOptions->mOutput, " calloc: %11.4f\n", COST_PRINTABLE(getStdDev(&inStats->mCallocCostVar))); - fprintf(inOptions->mOutput, " realloc: %11.4f\n", COST_PRINTABLE(getStdDev(&inStats->mReallocCostVar))); - fprintf(inOptions->mOutput, " free: %11.4f\n", COST_PRINTABLE(getStdDev(&inStats->mFreeCostVar))); - } - fprintf(inOptions->mOutput, "\n"); - - if(0 != inOptions->mRunLength) - { - unsigned length = inStats->uMaxTicks - inStats->uMinTicks; - - fprintf(inOptions->mOutput, "Run Length: %11.4f\n", COST_PRINTABLE(length)); - fprintf(inOptions->mOutput, "\n"); - } - - return retval; -} - - -int tmstats(Options* inOptions) -/* -** As quick as possible, load the input file and report stats. -*/ -{ - int retval = 0; - tmreader* tmr = NULL; - TMStats stats; - - memset(&stats, 0, sizeof(stats)); - stats.mOptions = inOptions; - stats.uMinTicks = 0xFFFFFFFFU; - - /* - ** Need a tmreader. - */ - tmr = tmreader_new(inOptions->mProgramName, &stats); - if(NULL != tmr) - { - int tmResult = 0; - - tmResult = tmreader_eventloop(tmr, inOptions->mInputName, tmEventHandler); - if(0 == tmResult) - { - retval = __LINE__; - ERROR_REPORT(retval, inOptions->mInputName, "Problem reading trace-malloc data."); - } - - tmreader_destroy(tmr); - tmr = NULL; - - if(0 == retval) - { - retval = report_stats(inOptions, &stats); - } - } - else - { - retval = __LINE__; - ERROR_REPORT(retval, inOptions->mProgramName, "Unable to obtain tmreader."); - } - - return retval; -} - - -int main(int inArgc, char** inArgv) -{ - int retval = 0; - Options options; - - retval = initOptions(&options, inArgc, inArgv); - if(options.mHelp) - { - showHelp(&options); - } - else if(0 == retval) - { - retval = tmstats(&options); - } - - cleanOptions(&options); - return retval; -} - diff --git a/mozilla/tools/trace-malloc/types.dat b/mozilla/tools/trace-malloc/types.dat deleted file mode 100644 index 41f5e12b1ee..00000000000 --- a/mozilla/tools/trace-malloc/types.dat +++ /dev/null @@ -1,6076 +0,0 @@ -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code is types.dat, released Nov 27, 2000. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 2000 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# Chris Waterson -# -# -# This file contains type inference information that is intended to be -# used with TraceMalloc.pm. The format of the file is: -# -# -# Stack1 -# Stack2 -# ... -# StackN -# -# Where Stack1...StackN imply that the object's type is -# InferredType. Note that in many cases, we'll ``roll up'' storage -# that's part of an object's implementation into the object itself. -# - -# Here's a handy regexp for cleaning up strings copied from the -# uncategorized file: -# -# \(^ *([0-9]+) \|\[.*\]$\) -# - -#---------------------------------------------------------------------- - - -__builtin_new -__builtin_vec_new -nsDeque::GrowCapacity(void) -nsDeque::Push(void *) -nsStringRecycler::Recycle(nsString *) - -#---------------------------------------------------------------------- -# -# AtomImpl -# - -# Give AtomImpl objects the memory they allocate for storage - -__builtin_new -AtomImpl::operator new(unsigned int, basic_nsAReadableString const &) - -# Give AtomImpl objects the memory allocated for their table - -PL_DHashAllocTable -PL_DHashTableFinish -PL_DHashTableOperate -NS_NewPermanentAtom(char const *) -NS_NewAtom(nsAString const &) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -NS_NewAtom(nsAString const &) -NS_NewAtom(char const *) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -NS_NewAtom(nsAString const &) -NS_NewAtom(unsigned short const *) - -#---------------------------------------------------------------------- - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsStr::StrAppend(nsStr &, nsStr const &, unsigned int, int) -nsStr::StrAssign(nsStr &, nsStr const &, unsigned int, int) -nsString::nsString(nsString const &) -nsAttrSelector::nsAttrSelector(nsAttrSelector const &) -nsCSSSelector::nsCSSSelector(nsCSSSelector const &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsStr::StrAppend(nsStr &, nsStr const &, unsigned int, int) -nsStr::StrAssign(nsStr &, nsStr const &, unsigned int, int) -nsString::nsString(nsString const &) -nsAttrSelector::nsAttrSelector(nsAttrSelector const &) -nsAttrSelector::nsAttrSelector(nsAttrSelector const &) -nsCSSSelector::nsCSSSelector(nsCSSSelector const &) - - -__builtin_new -nsCSSRule::operator new(unsigned int) - -#---------------------------------------------------------------------- -# -# CSSLoaderImpl -# - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -CSSLoaderImpl::CSSLoaderImpl(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsStr::StrAppend(nsStr &, nsStr const &, unsigned int, int) -nsString::AppendWithConversion(char const *, int) -nsString::AssignWithConversion(char const *) -CSSLoaderImpl::SetCharset(nsString const &) - - -PL_strdup -URLKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -CSSLoaderImpl::SheetComplete(nsICSSStyleSheet *, SheetLoadData *) - -#---------------------------------------------------------------------- - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -CSSNameSpaceRuleImpl::SetURLSpec(nsString const &) - -#---------------------------------------------------------------------- -# -# nsFont -# - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsStr::StrAppend(nsStr &, nsStr const &, unsigned int, int) -nsStr::StrAssign(nsStr &, nsStr const &, unsigned int, int) -nsString::nsString(nsString const &) -nsFont::nsFont(nsFont const &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsStr::StrAppend(nsStr &, nsStr const &, unsigned int, int) -nsString::AppendWithConversion(char const *, int) -nsString::AssignWithConversion(char const *) -nsFont::nsFont(char const *, unsigned char, unsigned char, unsigned short, unsigned char, int, float) - -#---------------------------------------------------------------------- - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -CSSImportRuleImpl::SetURLSpec(nsString const &) - - -__builtin_new -nsClassList::ParseClasses(nsClassList **, basic_nsAReadableString const &) - -# ---------------------------------------------------------------------- -# -# nsLocalFile -# - - -__builtin_new -nsLocalFile::Clone(nsIFile **) - - -PR_Malloc -_PR_Getfd -PR_GetConnectStatus -PR_OpenFile -PR_Open -nsLocalFile::OpenNSPRFileDesc(int, int, PRFileDesc **) - - -PR_Calloc -PR_LoadLibrary -PR_LoadLibraryWithFlags -PR_LoadLibrary -nsLocalFile::Load(PRLibrary **) - - -__strdup -PR_LoadLibrary -PR_LoadLibraryWithFlags -PR_LoadLibrary -nsLocalFile::Load(PRLibrary **) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewCString(nsACString const &) -nsLocalFile::AppendRelativePath(char const *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Clone(void const *, unsigned int) -nsLocalFile::InitWithPath(char const *) - - -PL_strdup -nsLocalFile::ParseURL(char const *, char **, char **, char **, char **) - -# ---------------------------------------------------------------------- - - -__builtin_new -nsXULAttribute::operator new(unsigned int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -unsigned short * AllocateStringCopy(nsAString const &, unsigned short *) -ToNewUnicode(nsAString const &) -nsXULAttributeValue::SetValue(nsAString const &, int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewUnicode(nsAString const &) -nsXULAttributeValue::SetValue(nsAString const &, int) - - -__builtin_new -nsXULAttributes::Create(nsIContent *, nsXULAttributes **) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -NS_NewAtom(nsAString const &) -NS_NewAtom(unsigned short const *) -nsClassList::ParseClasses(nsClassList **, nsAString const &) -nsXULAttributes::UpdateClassList(nsAString const &) - - -__builtin_new -nsXULElement::Create(nsINodeInfo *, nsIContent **) - - -PR_Realloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsXULElement::EnsureSlots(void) - - -PR_Realloc -nsVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsXULElement::AppendChildTo(nsIContent *, int, int) - - -__builtin_new -nsXULElement::EnsureSlots(void) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsXULElement::AppendChildTo(nsIContent *, int, int) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsXULElement::EnsureSlots(void) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsXULElement::AddBroadcastListener(nsAString const &, nsIDOMElement *) - - -iconv_close - - -tsearch - - -PR_Realloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -CSSDeclarationImpl::AppendValue(nsCSSProperty, nsCSSValue const &) - - -__builtin_new -CSSDeclarationImpl::AppendValue(nsCSSProperty, nsCSSValue const &) - - -__builtin_new -CSSDeclarationImpl::SetValueImportant(nsCSSProperty) - - -__builtin_new -CSSDeclarationImpl::operator new(unsigned int) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -CSSDeclarationImpl::AppendValue(nsCSSProperty, nsCSSValue const &) - - -__builtin_new -__builtin_vec_new -nsVoidArray::InsertElementAt(void *, int) - - -__builtin_new -__builtin_vec_new -nsVoidArray::nsVoidArray(int) - - -__builtin_new -__builtin_vec_new -nsVoidArray::Compact(void) - - -__builtin_new -__builtin_vec_new -nsVoidArray::ReplaceElementAt(void *, int) - - -__builtin_new -nsCheapVoidArray::SwitchToVector(void) -nsCheapVoidArray::AppendElement(void *) -nsGenericHTMLContainerElement::AppendChildTo(nsIContent *, int) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::Compact(void) -nsAutoVoidArray::Compact(void) -nsCheapVoidArray::Compact(void) -nsGenericHTMLContainerElement::Compact(void) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsCheapVoidArray::AppendElement(void *) -nsGenericHTMLContainerElement::AppendChildTo(nsIContent *, int, int) - - -PR_Realloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsCheapVoidArray::AppendElement(void *) -nsGenericHTMLContainerElement::AppendChildTo(nsIContent *, int, int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -~.* -~.* -basic_nsAWritableString::Assign(basic_nsAReadableString const &) -nsString::nsString(basic_nsAReadableString const &) -nsGenericAttribute::nsGenericAttribute(nsINodeInfo *, basic_nsAReadableString const &) - - -__builtin_new -__builtin_vec_new -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) - - -__builtin_new -nsSupportsArray::Create(nsISupports *, nsID const &, void **) - - -__builtin_new -__builtin_vec_new -nsZipArchive::BuildFileList(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsZipReaderCache::GetZip(nsIFile *, nsIZipReader **) - - -__builtin_new -__builtin_vec_new -InMemoryDataSource::AllocTable(void *, unsigned int) - - -PL_DHashAllocTable -PL_DHashTableFinish -PL_DHashTableOperate -InMemoryDataSource::LockedAssert(nsIRDFResource *, nsIRDFResource *, nsIRDFNode *, int) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::AddBucket(unsigned int) -nsFixedSizeAllocator::Init(char const *, unsigned int const *, int, int, int) -InMemoryDataSource::InMemoryDataSource(nsISupports *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -InMemoryDataSource::AllocEntry(void *, void const *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -Assertion::operator new(unsigned int, nsFixedSizeAllocator &) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -InMemoryDataSource::AllocEntry(void *, void const *) -PL_HashTableRawAdd -PL_HashTableAdd -InMemoryDataSource::SetReverseArcs(nsIRDFNode *, Assertion *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -InMemoryDataSource::AllocEntry(void *, void const *) -PL_HashTableRawAdd -PL_HashTableAdd -InMemoryDataSource::SetForwardArcs(nsIRDFResource *, Assertion *) - - -PL_DHashAllocTable -PL_DHashTableInit -InMemoryDataSource::Init(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -nsString::nsString(nsAString const &) -nsNameSpaceMap::Put(nsAString const &, nsIAtom *) -RDFXMLDataSourceImpl::AddNameSpace(nsIAtom *, nsString const &) - - -__builtin_new -__builtin_vec_new -xptiTypelibGuts::xptiTypelibGuts(XPTHeader *) - -# ---------------------------------------------------------------------- -# -# nsFontMetricsGTK -# - - -__builtin_new -nsDrawingSurfaceGTK::Init(_GdkGC *, unsigned int, unsigned int, unsigned int) -nsFontMetricsGTK::Init(nsFont const &, nsIAtom *, nsIDeviceContext *) - - -__builtin_new -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -PR_Malloc -nsCompressedCharMap::NewCCMap(void) -MapToCCMap(unsigned int *) -MapperToCCMap(nsICharRepresentable *) -nsFontMetricsGTK::GetFontHandle(void *&) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsCStringArray::InsertCStringAt(nsCString const &, int) -nsFontMetricsGTK::QueryInterface(nsID const &, void **) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -__builtin_new -__builtin_vec_new -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -PR_Calloc -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -__builtin_vec_new -nsDrawingSurfaceGTK type_info function -nsFontMetricsGTK::Init(nsFont const &, nsIAtom *, nsIDeviceContext *) - - -__builtin_new -nsFontWeight::operator new(unsigned int) -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -__builtin_new -nsFontNode::operator new(unsigned int) -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -__builtin_new -nsFontStretch::operator new(unsigned int) -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -__builtin_new -nsFontStyle::operator new(unsigned int) -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -PR_Realloc -PR_vsxprintf -PR_WaitForPollableEvent -PR_vsmprintf -PR_smprintf -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -PR_Malloc -PR_vsxprintf -PR_WaitForPollableEvent -PR_WaitForPollableEvent -PR_WaitForPollableEvent -PR_vsmprintf -PR_smprintf -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -PR_Realloc -PR_vsxprintf -PR_WaitForPollableEvent -PR_WaitForPollableEvent -PR_WaitForPollableEvent -PR_vsmprintf -PR_smprintf -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -PR_Realloc -nsFontMetricsGTK::PickASizeAndLoad(nsFontStretch *, nsFontCharSetInfo *, unsigned short) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsDrawingSurfaceGTK type_info function -nsFontMetricsGTK::Init(nsFont const &, nsIAtom *, nsIDeviceContext *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsDrawingSurfaceGTK type_info function -nsFontMetricsGTK::Init(nsFont const &, nsIAtom *, nsIDeviceContext *) - - -__builtin_new -nsFontMetricsGTK::SearchNode - - -PR_Malloc -PR_vsxprintf -PR_WaitForPollableEvent -PR_WaitForPollableEvent -PR_vsmprintf -PR_smprintf -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsFontMetricsGTK::TryNodes(nsACString &, unsigned short) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsFontMetricsGTK::TryNode(nsCString *, unsigned short) - - -PR_Realloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -PR_Realloc -nsFontMetricsGTK::AddToLoadedFontsList(nsFontGTK *) - - -PR_Realloc -PR_vsxprintf -PR_WaitForPollableEvent -PR_WaitForPollableEvent -PR_vsmprintf -PR_smprintf -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsDrawingSurfaceGTK::Init(_GdkGC *, unsigned int, unsigned int, unsigned int) -nsFontMetricsGTK::Init(nsFont const &, nsIAtom *, nsIDeviceContext *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsFontMetricsGTK::TryNodes(nsACString &, unsigned short) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsFontMetricsGTK::TryNode(nsCString *, unsigned short) - - -__builtin_new -nsFontMetricsGTK::TryNodes(nsACString &, unsigned short) - -# ---------------------------------------------------------------------- -# -# nsPluginTag -# - - -__builtin_new -__builtin_vec_new -nsPluginTag::nsPluginTag(nsPluginInfo *) - - -__builtin_new -__builtin_vec_new -new_str(char const *) -nsPluginTag::nsPluginTag(nsPluginInfo *) - - -__builtin_new -__builtin_vec_new -nsPluginTag::nsPluginTag(char const *, char const *, char const *, char const *, char const *const *, char const *const *, char const *const *, int, long long) - - -__builtin_new -__builtin_vec_new -nsPluginTag::nsPluginTag(nsPluginTag *) - -#---------------------------------------------------------------------- -# -# nsXBLInsertionPoint -# - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -nsXBLInsertionPoint::AddChild(nsIContent *) - -#---------------------------------------------------------------------- -# -# nsXBLBinding -# - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXBLBinding::GetInsertionPointsFor(nsIContent *, nsISupportsArray **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsXBLBinding::GetInsertionPointsFor(nsIContent *, nsISupportsArray **) - - -__builtin_new -nsXBLBinding::GetInsertionPointsFor(nsIContent *, nsISupportsArray **) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -NS_NewAtom(nsAString const &) -NS_NewAtom(char const *) -nsXBLBinding::nsXBLBinding(nsIXBLPrototypeBinding *) - -# ---------------------------------------------------------------------- -# -# nsXBLPrototypeBinding -# - - -__builtin_new -nsXBLPrototypeBinding::InitClass(nsCString const &, nsIScriptContext *, void *, void **) - - -__builtin_new -nsXBLPrototypeBinding::ConstructInsertionTable(nsIContent *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsXBLPrototypeBinding::ConstructAttributeTable(nsIContent *) - - -JS_DHashAllocTable -JS_DHashTableInit -JS_NewDHashTable -js_LookupProperty -JS_DefinePropertyWithTinyId -JS_LookupProperty -nsXBLPrototypeBinding::InitClass(nsCString const &, nsIScriptContext *, void *, void **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXBLPrototypeBinding::ConstructInsertionTable(nsIContent *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::AddBucket(unsigned int) -nsFixedSizeAllocator::Init(char const *, unsigned int const *, int, int, int) -nsXBLPrototypeBinding::nsXBLPrototypeBinding(nsCString const &, nsIContent *, nsIXBLDocumentInfo *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::AddBucket(unsigned int) -nsFixedSizeAllocator::Init(char const *, unsigned int const *, int, int, int) -nsXBLPrototypeBinding::nsXBLPrototypeBinding(basic_nsAReadableString const &, nsIContent *, nsIXBLDocumentInfo *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXBLPrototypeBinding::ConstructAttributeTable(nsIContent *) - - -__builtin_new -nsISupportsKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXBLPrototypeBinding::ConstructAttributeTable(nsIContent *) - - -__builtin_new -nsXBLPrototypeBinding::ConstructAttributeTable(nsIContent *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsXBLPrototypeBinding::ConstructAttributeTable(nsIContent *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::AddBucket(unsigned int) -nsFixedSizeAllocator::Init(char const *, unsigned int const *, int, int, int) -nsXBLPrototypeBinding::nsXBLPrototypeBinding(nsACString const &, nsIXBLDocumentInfo *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsXBLPrototypeBinding::InitClass(nsCString const &, nsIScriptContext *, void *, void **) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsCString::SetCapacity(unsigned int) -nsCString::SetLength(unsigned int) -nsACString::do_AssignFromReadable(nsACString const &) -nsACString::AssignFromReadable(nsACString const &) -nsCString::nsCString(nsACString const &) -nsXBLPrototypeBinding::nsXBLPrototypeBinding(nsACString const &, nsIXBLDocumentInfo *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewCString(nsACString const &) -nsXBLJSClass::nsXBLJSClass(nsCString const &) -nsXBLPrototypeBinding::InitClass(nsCString const &, nsIScriptContext *, void *, void **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXBLPrototypeBinding::ConstructInterfaceTable(nsIContent *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsXBLPrototypeBinding::InitClass(nsCString const &, nsIScriptContext *, void *, void **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsXBLPrototypeBinding::ConstructInsertionTable(nsIContent *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsXBLPrototypeBinding::ConstructInterfaceTable(nsIContent *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsXBLAttributeEntry::Create(nsIAtom *, nsIAtom *, nsIContent *) -nsXBLPrototypeBinding::ConstructAttributeTable(nsIContent *) - -#---------------------------------------------------------------------- -# -# -# - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -nsGenericContainerElement::GetAttr(int, nsIAtom *, nsIAtom *&, nsAString &) const -nsGenericContainerElement::GetAttr(int, nsIAtom *, nsAString &) const -nsXBLPrototypeProperty::ParseProperty(nsIScriptContext *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -nsGenericContainerElement::GetAttr(int, nsIAtom *, nsIAtom *&, nsAString &) const -nsGenericContainerElement::GetAttr(int, nsIAtom *, nsAString &) const -nsXBLPrototypeProperty::ParseMethod(nsIScriptContext *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -nsGenericContainerElement::GetAttr(int, nsIAtom *, nsIAtom *&, nsAString &) const -nsGenericContainerElement::GetAttr(int, nsIAtom *, nsAString &) const -nsXBLPrototypeProperty::ParseField(nsIScriptContext *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AppendFromReadable(nsAString const &) -nsAString::AppendFromReadable(nsAString const &) -nsXBLPrototypeProperty::ParseField(nsIScriptContext *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsCString::SetCapacity(unsigned int) -nsCString::SetLength(unsigned int) -nsACString::do_AppendFromReadable(nsACString const &) -nsACString::do_AppendFromElementPtr(char const *) -nsXBLPrototypeBinding::GetBindingURI(nsCString &) -nsXBLPrototypeProperty::ConstructProperty(nsIContent *, nsIContent *) - - -JS_DHashAllocTable -JS_DHashTableFinish -JS_DHashTableOperate -js_AddRootRT -JS_AddNamedRootRT -NS_NewXBLPrototypeBinding(nsACString const &, nsIContent *, nsIXBLDocumentInfo *, nsIXBLPrototypeBinding **) -nsXBLPrototypeProperty::ParseMethod(nsIScriptContext *) - -# ---------------------------------------------------------------------- -# -# The frame arena -# - - -PR_Malloc -PL_ArenaAllocate -FrameArena::AllocateFrame(unsigned int, void **) - - -PR_Malloc -PL_ArenaAllocate -nsDST::NodeArena::AllocLeafNode(void) -nsDST::Insert(void *, void *, void **) -PresShell::SetSubShellFor(nsIContent *, nsISupports *) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -PresShell::AppendReflowCommandInternal(nsIReflowCommand *, nsVoidArray &) - -# The anonymous content table in the PresShell - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -PresShell::SetAnonymousContentFor(nsIContent *, nsISupportsArray *) - - -__builtin_new -nsISupportsKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -PresShell::SetAnonymousContentFor(nsIContent *, nsISupportsArray *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -PresShell::SetAnonymousContentFor(nsIContent *, nsISupportsArray *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -PresShell::SetAnonymousContentFor(nsIContent *, nsISupportsArray *) - -# ---------------------------------------------------------------------- -# -# StackArena -# - - -PR_Malloc -StackArena::StackArena(void) - - -PR_Malloc -StackArena::Allocate(unsigned int, void **) - - -PR_Malloc -StackBlock::StackBlock(void) -StackArena::StackArena(void) - - -__builtin_new -__builtin_vec_new -StackArena::StackArena(void) - - -PR_Malloc -StackArena::Allocate(unsigned int, void **) - -# The following will only show up if you turn off the FrameArena - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsBoxLayoutState::Allocate(unsigned int, nsIPresShell *) - - -# ---------------------------------------------------------------------- -# -# nsFrameManager -# - - -PR_Malloc -PL_ArenaAllocate -nsDST::NodeArena::AllocLeafNode(void) -nsDST::LeafNode::operator new(unsigned int, nsDST::NodeArena *) -nsDST::Insert(void *, void *, void **) - - -PR_Malloc -PL_ArenaAllocate -nsDST::NodeArena::AllocTwoNode(void) -nsDST::ConvertToTwoNode(nsDST::LeafNode **) -nsDST::Insert(void *, void *, void **) -FrameManager::SetFrameProperty(nsIFrame *, nsIAtom *, void *, void (*)(nsIPresContext *, nsIFrame *, nsIAtom *, void *)) - - -PR_Malloc -PL_ArenaAllocate -nsDST::NodeArena::AllocTwoNode(void) -nsDST::TwoNode::operator new(unsigned int, nsDST::NodeArena *) -nsDST::ConvertToTwoNode(nsDST::LeafNode **) -nsDST::Insert(void *, void *, void **) -FrameManager::SetPrimaryFrameFor(nsIContent *, nsIFrame *) - - -PR_Malloc -PL_ArenaAllocate -nsDST::NodeArena::AllocTwoNode(void) -nsDST::TwoNode::operator new(unsigned int, nsDST::NodeArena *) -nsDST::ConvertToTwoNode(nsDST::LeafNode **) -nsDST::Insert(void *, void *, void **) -FrameManager::SetFrameProperty(nsIFrame *, nsIAtom *, void *, void (*)(nsIPresContext *, nsIFrame *, nsIAtom *, void *)) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -FrameHashTable::Put(void *, void *) -FrameManager::SetPlaceholderFrameFor(nsIFrame *, nsIFrame *) - - -__builtin_new -nsDST::NewMemoryArena(unsigned int) -FrameManager::Init(nsIPresShell *, nsIStyleSet *) - - -PR_Malloc -PL_ArenaAllocate -nsDST::NodeArena::AllocTwoNode(void) -nsDST::ConvertToTwoNode(nsDST::LeafNode **) -nsDST::Insert(void *, void *, void **) -FrameManager::SetPrimaryFrameFor(nsIContent *, nsIFrame *) - - -PR_Malloc -PL_ArenaAllocate -nsDST::NodeArena::AllocLeafNode(void) -nsDST::Insert(void *, void *, void **) -FrameManager::SetFrameProperty(nsIFrame *, nsIAtom *, void *, void (*)(nsIPresContext *, nsIFrame *, nsIAtom *, void *)) - - -PR_Malloc -PL_ArenaAllocate -nsDST::NodeArena::AllocLeafNode(void) -nsDST::Insert(void *, void *, void **) -FrameManager::SetPrimaryFrameFor(nsIContent *, nsIFrame *) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -UndisplayedMap::AppendNodeFor(UndisplayedNode *, nsIContent *) - - -__builtin_new -UndisplayedMap::AddNodeFor(nsIContent *, nsIContent *, nsIStyleContext *) - - -PR_Malloc -PL_ArenaFinish -PL_NewHashTable -UndisplayedMap::UndisplayedMap(unsigned int) - - -PR_Calloc -PR_NewLock - - -PR_Calloc -PR_NewMonitor - -# ---------------------------------------------------------------------- -# -# RDFServiceImpl -# - - -PR_Malloc -PL_ArenaFinish -PL_NewHashTable -RDFServiceImpl::Init(void) - - -PR_Malloc -nsRDFParserUtils::GetQuotedAttributeValue(nsString const &, nsString const &, nsString &) -PL_HashTableRawAdd -PL_HashTableAdd -RDFServiceImpl::RegisterDataSource(nsIRDFDataSource *, int) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -RDFServiceImpl::RegisterResource(nsIRDFResource *, int) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -PL_HashTableAdd -RDFServiceImpl::RegisterLiteral(nsIRDFLiteral *, int) - - -PR_Malloc -nsRDFParserUtils::IsJavaScriptLanguage(nsString const &, char const **) -PL_NewHashTable -RDFServiceImpl::Init(void) - - -PR_Malloc -nsRDFParserUtils::IsJavaScriptLanguage(nsString const &, char const **) -PL_HashTableRawAdd -PL_HashTableAdd -RDFServiceImpl::RegisterDataSource(nsIRDFDataSource *, int) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawRemove -RDFServiceImpl::UnregisterResource(nsIRDFResource *) - - -PL_strdup -RDFServiceImpl::RegisterDataSource(nsIRDFDataSource *, int) - -# ---------------------------------------------------------------------- - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsRDFResource::Init(char const *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -~.* -~.* -basic_nsAWritableString::Assign(basic_nsAReadableString const &) -nsString::operator=(nsString const &) -nsHTMLImageLoader::SetURL(nsString const &) - - -__builtin_new -__builtin_vec_new -nsHTMLEntities::AddRefTable(void) - - -__builtin_new -nsAVLTree::AddItem(void *) -nsHTMLEntities::AddRefTable(void) - - -__builtin_new -__builtin_vec_new -nsStaticCaseInsensitiveNameTable::Init(char const **, int) - - -__builtin_new -CNavDTD::CNavDTD(void) - - -__builtin_new -__builtin_vec_new -InitializeElementTable(void) -CNavDTD::CNavDTD(void) - - -__builtin_new -__builtin_vec_new -nsDeque::GrowCapacity(void) -nsDeque::Push(void *) -CNodeRecycler::RecycleNode(nsCParserNode *) -CNavDTD::CloseContainersTo(int, nsHTMLTag, int) - - -__builtin_new -COtherDTD::COtherDTD(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsScanner::Append(char const *, unsigned int) - - -__builtin_new -nsSlidingString::AppendBuffer(unsigned short *, unsigned short *, unsigned short *) -nsScanner::AppendToBuffer(unsigned short *, unsigned short *, unsigned short *) - - -__builtin_new -nsScanner::AppendToBuffer(unsigned short *, unsigned short *, unsigned short *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -unsigned short * AllocateStringCopy(basic_nsAReadableString const &, unsigned short *) -ToNewUnicode(basic_nsAReadableString const &) -nsScanner::Append(basic_nsAReadableString const &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -CopyUnicodeTo(nsReadingIterator const &, nsReadingIterator const &, basic_nsAWritableString &) -nsScanner::CopyUnusedData(nsString &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsStr::StrAppend(nsStr &, nsStr const &, unsigned int, int) -nsStr::StrAssign(nsStr &, nsStr const &, unsigned int, int) -nsString::nsString(nsString const &) -nsScanner::nsScanner(nsString &, int, nsString const &, nsCharsetSource) - - -__builtin_new -__builtin_vec_new -nsDeque::GrowCapacity(void) -nsDeque::Push(void *) -nsHTMLTokenizer::ScanDocStructure(int) - - -__builtin_new -__builtin_vec_new -nsDeque::GrowCapacity(void) -nsDeque::Push(void *) -nsHTMLTokenizer::AddToken(CToken *&, unsigned int, nsDeque *, nsTokenAllocator *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -CToken::operator new(unsigned int, nsFixedSizeAllocator &) -nsTokenAllocator::CreateTokenOfType(eHTMLTokenTypes, nsHTMLTag) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::AddBucket(unsigned int) -nsFixedSizeAllocator::Init(char const *, unsigned int const *, int, int, int) -nsNodeAllocator::nsNodeAllocator(void) - -# ---------------------------------------------------------------------- -# -# xptiWorkingSet -# - - -__builtin_new -__builtin_vec_new -xptiWorkingSet::NewFileArray(unsigned int) - - -__builtin_new -__builtin_vec_new -xptiWorkingSet::ExtendFileArray(unsigned int) - -# ---------------------------------------------------------------------- - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -HTMLContentSink::OnStreamComplete(nsIStreamLoader *, nsISupports *, unsigned int, unsigned int, char const *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsStr::StrAppend(nsStr &, nsStr const &, unsigned int, int) -nsStr::StrAssign(nsStr &, nsStr const &, unsigned int, int) -nsString::nsString(nsString const &) -HTMLContentSink::SetTitle(nsString const &) - - -__builtin_new -__builtin_vec_new -DeviceContextImpl::DeviceContextImpl(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -DeviceContextImpl::CreateFontAliasTable(void) - - -__builtin_new -FontAliasKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -DeviceContextImpl::AliasFont(nsString const &, nsString const &, nsString const &, int) - - -__builtin_new -__builtin_vec_new -nsCompressedMap::nsCompressedMap(unsigned short *, unsigned int) - - -__builtin_new -__builtin_vec_new -nsHTMLDocument::nsHTMLDocument(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsHTMLDocument::nsHTMLDocument(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsHTMLDocument::InvalidateHashTables(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -~.* -~.* -basic_nsAWritableString::Assign(basic_nsAReadableString const &) -nsString::nsString(basic_nsAReadableString const &) -nsHTMLDocument::SetReferrer(basic_nsAReadableString const &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -~.* -~.* -basic_nsAWritableString::Assign(basic_nsAReadableString const &) -nsString::nsString(basic_nsAReadableString const &) -nsHTMLDocument::SetLastModified(basic_nsAReadableString const &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -~.* -~.* -basic_nsAWritableString::Assign(basic_nsAReadableString const &) -nsString::nsString(basic_nsAReadableString const &) -nsHTMLDocument::SetTitle(basic_nsAReadableString const &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -nsString::nsString(nsAString const &) -nsDOMDocumentType::nsDOMDocumentType(nsAString const &, nsIDOMNamedNodeMap *, nsIDOMNamedNodeMap *, nsAString const &, nsAString const &, nsAString const &) - -#---------------------------------------------------------------------- -# -# XPC stuff -# - - -JS_DHashAllocTable -JS_DHashTableInit -JS_NewDHashTable -Native2WrappedNativeMap::Native2WrappedNativeMap(int) - - -JS_DHashAllocTable -JS_DHashTableInit -JS_NewDHashTable -ClassInfo2WrappedNativeProtoMap::ClassInfo2WrappedNativeProtoMap(int) - - -JS_DHashAllocTable -JS_DHashTableInit -JS_NewDHashTable -IID2NativeInterfaceMap::IID2NativeInterfaceMap(int) - - -JS_DHashAllocTable -JS_DHashTableInit -JS_NewDHashTable -IID2WrappedJSClassMap::IID2WrappedJSClassMap(int) - - -JS_DHashAllocTable -JS_DHashTableInit -JS_NewDHashTable -IID2ThisTranslatorMap::IID2ThisTranslatorMap(int) - - -JS_DHashAllocTable -JS_DHashTableInit -JS_NewDHashTable -XPCNativeScriptableSharedMap::XPCNativeScriptableSharedMap(int) - - -__builtin_new -XPCNativeScriptableSharedMap::GetNewOrUsed(unsigned int, char *, XPCNativeScriptableInfo *) - - -JS_DHashAllocTable -JS_DHashTableInit -JS_NewDHashTable -JSContext2XPCContextMap::JSContext2XPCContextMap(int) - - -JS_DHashAllocTable -JS_DHashTableInit -JS_NewDHashTable -NativeSetMap::NativeSetMap(int) - - -JS_DHashAllocTable -JS_DHashTableInit -JS_NewDHashTable -JSObject2WrappedJSMap::JSObject2WrappedJSMap(int) - - -JS_DHashAllocTable -JS_DHashTableFinish -JS_DHashTableOperate -nsXPCWrappedJS::GetNewOrUsed(XPCCallContext &, JSObject *, nsID const &, nsISupports *, nsXPCWrappedJS **) - - -JS_DHashAllocTable -JS_DHashTableInit -JS_NewDHashTable -XPCWrappedNativeProtoMap::XPCWrappedNativeProtoMap(int) - - -JS_DHashAllocTable -JS_DHashTableFinish -JS_DHashTableOperate -XPCWrappedNativeProto::GetNewOrUsed(XPCCallContext &, XPCWrappedNativeScope *, nsIClassInfo *, XPCNativeScriptableCreateInfo const *, int) - - -__builtin_new -XPCWrappedNativeProto::GetNewOrUsed(XPCCallContext &, XPCWrappedNativeScope *, nsIClassInfo *, XPCNativeScriptableCreateInfo const *, int) - - -__builtin_new -__builtin_vec_new -XPCNativeSet::NewInstance(XPCCallContext &, XPCNativeInterface **, unsigned short) -XPCNativeSet::GetNewOrUsed(XPCCallContext &, nsIClassInfo *) -XPCWrappedNativeProto::GetNewOrUsed(XPCCallContext &, XPCWrappedNativeScope *, nsIClassInfo *, XPCNativeScriptableCreateInfo const *, int) - - -__builtin_new -XPCNativeScriptableInfo::Construct(XPCCallContext &, XPCNativeScriptableCreateInfo const *) -XPCWrappedNativeProto::Init(XPCCallContext &, XPCNativeScriptableCreateInfo const *) - - -JS_DHashAllocTable -JS_DHashTableFinish -JS_DHashTableOperate -XPCNativeSet::GetNewOrUsed(XPCCallContext &, nsIClassInfo *) -XPCWrappedNativeProto::GetNewOrUsed(XPCCallContext &, XPCWrappedNativeScope *, nsIClassInfo *, XPCNativeScriptableCreateInfo const *, int) - - -JS_DHashAllocTable -JS_DHashTableFinish -JS_DHashTableOperate -XPCWrappedNative::~XPCWrappedNative(void) - - -__builtin_new -XPCWrappedNative::FindTearOff(XPCCallContext &, XPCNativeInterface *, int, unsigned int *) - - -JS_DHashAllocTable -JS_DHashTableFinish -JS_DHashTableOperate -XPCWrappedNative::GetNewOrUsed(XPCCallContext &, nsISupports *, XPCWrappedNativeScope *, XPCNativeInterface *, XPCWrappedNative **) - - -JS_DHashAllocTable -JS_DHashTableInit -JS_NewDHashTable -js_LookupProperty -js_GetProperty -XPCWrappedNativeScope::SetGlobal(XPCCallContext &, JSObject *) - - -__builtin_new -__builtin_vec_new -nsXPCWrappedNativeClass::BuildMemberDescriptors(XPCContext *) - -#---------------------------------------------------------------------- - - -__builtin_new -__builtin_vec_new -nsNetModRegEntry::nsNetModRegEntry(char const *, nsINetNotify *, unsigned int *) -nsNetModuleMgr::RegisterModule(char const *, nsINetNotify *) - - -__builtin_new -nsProxyObjectManager::nsProxyObjectManager(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsProxyObjectManager::nsProxyObjectManager(void) - - -__builtin_new -__builtin_vec_new -nsProxyEventClass::nsProxyEventClass(nsID const &, nsIInterfaceInfo *) - - -__builtin_new -nsIDKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsProxyEventClass::nsProxyEventClass(nsID const &, nsIInterfaceInfo *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsProxyEventClass::nsProxyEventClass(nsID const &, nsIInterfaceInfo *) - - -__builtin_new -nsProxyEventKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsProxyEventObject::GetNewOrUsedProxy(nsIEventQueue *, int, nsISupports *, nsID const &) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsProxyEventObject::GetNewOrUsedProxy(nsIEventQueue *, int, nsISupports *, nsID const &) - -# ---------------------------------------------------------------------- -# -# nsComponentManagerImpl -# - - -__builtin_new -nsComponentManagerImpl::Init(void) - - -__builtin_new -nsComponentManagerImpl::GetServiceByContractID(char const *, nsID const &, void **) - - -__builtin_new -nsComponentManagerImpl::GetService(nsID const &, nsID const &, void **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsComponentManagerImpl::Init(void) - - -__builtin_vec_new -nsComponentManagerImpl::Init(void) - - -__builtin_new -nsComponentManagerImpl::PlatformPrePopulateRegistry(void) - - -__builtin_new -nsComponentManagerImpl::RegisterFactory(nsID const &, char const *, char const *, nsIFactory *, int) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::PlatformPrePopulateRegistry(void) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::HashContractID(char const *, nsID const &) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsComponentManagerImpl::Init(void) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsComponentManagerImpl::GetLoaderForType(char const *, nsIComponentLoader **) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::ContractIDToClassID(char const *, nsID *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::PlatformPrePopulateRegistry(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsComponentManagerImpl::RegisterFactory(nsID const &, char const *, char const *, nsIFactory *, int) - - -__builtin_new -nsIDKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::PlatformPrePopulateRegistry(void) - - -__builtin_new -nsIDKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::RegisterFactory(nsID const &, char const *, char const *, nsIFactory *, int) - - -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::PlatformPrePopulateRegistry(void) - - -PR_Malloc -bufio_SetBufferSize -nsXPTCStubBase::Sentinel9(void) -NR_RegSetBufferSize -nsRegistry::SetBufferSize(int) -nsComponentManagerImpl::AutoRegister(int, nsIFile *) - - -__builtin_new -nsComponentManagerImpl::HashContractID(char const *, nsID const &) - - -__builtin_new -nsComponentManagerImpl::RegisterComponentCommon(nsID const &, char const *, char const *, char const *, int, int, char const *) - - -__builtin_new -nsIDKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::RegisterComponentCommon(nsID const &, char const *, char const *, char const *, int, int, char const *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::HashContractID(char const *, nsID const &) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::RegisterFactory(nsID const &, char const *, char const *, nsIFactory *, int) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::ContractIDToClassID(char const *, nsID *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::HashContractID(char const *, nsFactoryEntry *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsComponentManagerImpl::HashContractID(char const *, nsFactoryEntry *) - - -__builtin_new -nsComponentManagerImpl::GetService(char const *, nsID const &, nsISupports **, nsIShutdownListener *) - - -__builtin_new -nsComponentManagerImpl::GetService(nsID const &, nsID const &, nsISupports **, nsIShutdownListener *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsCString::SetCapacity(unsigned int) -nsCString::SetLength(unsigned int) -nsACString::do_AssignFromReadable(nsACString const &) -nsACString::do_AssignFromElementPtr(char const *) -nsCString::nsCString(char const *) -nsFactoryEntry::nsFactoryEntry(nsID const &, char const *, int) -nsComponentManagerImpl::PlatformPrePopulateRegistry(void) - - -PL_strdup -nsComponentManagerImpl::HashContractID(char const *, nsFactoryEntry *) - - -PL_strdup -nsFactoryEntry::nsFactoryEntry(nsID const &, char const *, int) -nsComponentManagerImpl::PlatformPrePopulateRegistry(void) - - -PL_DHashAllocTable -PL_DHashTableInit -nsComponentManagerImpl::Init(void) - -# ---------------------------------------------------------------------- - - -__builtin_new -nsZipArchive::BuildFileList(void) - - -__builtin_new -nsStaticCaseInsensitiveNameTable::Init(char const **, int) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsStaticCaseInsensitiveNameTable::Init(char const **, int) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsStaticCaseInsensitiveNameTable::Init(char const **, int) - -# ---------------------------------------------------------------------- -# -# nsDrawingSurfaceGTK -# - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsDrawingSurfaceGTK::Init(_GdkGC *, unsigned int, unsigned int, unsigned int) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsDrawingSurfaceGTK::Init(_GdkGC *, unsigned int, unsigned int, unsigned int) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsDrawingSurfaceGTK type_info function - - -PR_Malloc -nsCompressedCharMap::NewCCMap(void) -nsDrawingSurfaceGTK::Init(_GdkGC *, unsigned int, unsigned int, unsigned int) - -# ---------------------------------------------------------------------- -# -# nsNativeComponentLoader -# - - -__builtin_new -nsNativeComponentLoader::Init(nsIComponentManager *, nsISupports *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsObjectHashtable::nsObjectHashtable(void *(*)(nsHashKey *, void *, void *), void *, int (*)(nsHashKey *, void *, void *), void *, unsigned int, int) -nsNativeComponentLoader::Init(nsIComponentManager *, nsISupports *) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsNativeComponentLoader::CreateDll - - -__builtin_new -nsNativeComponentLoader::CreateDll(nsIFile *, char const *, long long *, long long *, nsDll **) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsNativeComponentLoader::CreateDll(nsIFile *, char const *, long long *, long long *, nsDll **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsNativeComponentLoader::CreateDll(nsIFile *, char const *, long long *, long long *, nsDll **) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsNativeComponentLoader::CreateDll(nsIFile *, char const *, long long *, long long *, nsDll **) - - -PL_strdup -nsDll::nsDll(nsIFile *, char const *, long long *, long long *) -nsNativeComponentLoader::CreateDll(nsIFile *, char const *, long long *, long long *, nsDll **) - -# ---------------------------------------------------------------------- - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsDirectoryService::Set(char const *, nsISupports *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsDirectoryService::Init(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsDirectoryService::Set(char const *, nsISupports *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsDirectoryService::Init(char const *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsDirectoryService::Init(void) - -#---------------------------------------------------------------------- -# -# nsResProtocolHandler -# - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsResProtocolHandler::AppendSubstitution(char const *, char const *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsResProtocolHandler::nsResProtocolHandler(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsResProtocolHandler::AppendSubstitution(char const *, char const *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsResProtocolHandler::SetSubstitution(char const *, nsIURI *) - -# ---------------------------------------------------------------------- -# -# nsChromeRegistry -# - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsChromeRegistry::LoadDataSource(nsCString const &, nsIRDFDataSource **, int, char const *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsChromeRegistry::LoadDataSource(nsCString const &, nsIRDFDataSource **, int, char const *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsChromeRegistry::LoadDataSource(nsCString const &, nsIRDFDataSource **, int, char const *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewCString(nsACString const &) -nsStdURL::GetSpec(char **) -RDFXMLDataSourceImpl::Init(char const *) -nsChromeRegistry::LoadDataSource(nsCString const &, nsIRDFDataSource **, int, char const *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsChromeRegistry::LoadDataSource(nsCString const &, nsIRDFDataSource **, int, char const *) - -# ---------------------------------------------------------------------- - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsZipReaderCache::GetZip(nsIFile *, nsIZipReader **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsZipReaderCache::GetZip(nsIFile *, nsIZipReader **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsZipReaderCache::nsZipReaderCache(void) - - -__builtin_new -nsZipReaderCache::GetZip(nsIFile *, nsIZipReader **) - -# ---------------------------------------------------------------------- -# -# nsXBLDocumentInfo -# - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXBLDocumentInfo::SetPrototypeBinding(nsACString const &, nsIXBLPrototypeBinding *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsXBLDocumentInfo::SetPrototypeBinding(nsACString const &, nsIXBLPrototypeBinding *) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXBLDocumentInfo::SetPrototypeBinding(nsCString const &, nsIXBLPrototypeBinding *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXBLDocumentInfo::SetPrototypeBinding(basic_nsAReadableString const &, nsIXBLPrototypeBinding *) - - -__builtin_new -nsXBLDocumentInfo::SetPrototypeBinding(nsCString const &, nsIXBLPrototypeBinding *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXBLDocumentInfo::SetPrototypeBinding(nsCString const &, nsIXBLPrototypeBinding *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsXBLDocumentInfo::SetPrototypeBinding(basic_nsAReadableString const &, nsIXBLPrototypeBinding *) - - -__builtin_new -nsXBLDocumentInfo::SetPrototypeBinding(basic_nsAReadableString const &, nsIXBLPrototypeBinding *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsCString::SetCapacity(unsigned int) -nsCString::SetLength(unsigned int) -~.* -~.* -basic_nsAWritableString::Assign(char const *) -nsCString::operator=(char const *) -nsXBLDocumentInfo::nsXBLDocumentInfo(char const *, nsIDocument *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXBLDocumentInfo::SetPrototypeBinding(nsACString const &, nsIXBLPrototypeBinding *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsCString::SetCapacity(unsigned int) -nsCString::SetLength(unsigned int) -nsACString::do_AssignFromReadable(nsACString const &) -nsACString::do_AssignFromElementPtr(char const *) -nsXBLDocumentInfo::nsXBLDocumentInfo(char const *, nsIDocument *) - - -__builtin_new -nsXBLDocumentInfo::SetPrototypeBinding(nsACString const &, nsIXBLPrototypeBinding *) - -# ---------------------------------------------------------------------- -# -# nsXULPrototypeCache -# - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXULPrototypeCache::PutXBLDocumentInfo(nsIXBLDocumentInfo *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXULPrototypeCache::PutPrototype(nsIXULPrototypeDocument *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsXULPrototypeCache::nsXULPrototypeCache(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXULPrototypeCache::PutXBLDocumentInfo(nsIXBLDocumentInfo *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXULPrototypeCache::PutStyleSheet(nsICSSStyleSheet *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsXULPrototypeCache::nsXULPrototypeCache(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXULPrototypeCache::PutXBLDocumentInfo(nsIXBLDocumentInfo *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsXULPrototypeCache::PutScript(nsIURI *, void *) - -# nsXULPrototypeElement - -__builtin_new -XULContentSinkImpl::CreateElement(nsINodeInfo *, nsXULPrototypeElement **) - -# nsXULPrototypeNode - -__builtin_new -__builtin_vec_new -XULContentSinkImpl::CloseContainer(nsIParserNode const &) - -# nsXULPrototypeScript - -__builtin_new -XULContentSinkImpl::OpenScript(nsIParserNode const &) - -# ---------------------------------------------------------------------- -# -# nsExternalHelperAppService -# - - -__builtin_new -nsExternalHelperAppService::nsExternalHelperAppService(void) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsExternalHelperAppService::AddMimeInfoToCache(nsIMIMEInfo *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsExternalHelperAppService::AddMimeInfoToCache(nsIMIMEInfo *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsExternalHelperAppService::AddMimeInfoToCache(nsIMIMEInfo *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsExternalHelperAppService::AddMimeInfoToCache(nsIMIMEInfo *) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsCStringArray::InsertCStringAt(nsCString const &, int) -nsMIMEInfoImpl::SetFileExtensions(char const *) -nsExternalHelperAppService::AddDefaultMimeTypesToCache(void) - -# ---------------------------------------------------------------------- -# -# nsCategoryManager -# - - -__builtin_new -nsCategoryManager::AddCategoryEntry(char const *, char const *, char const *, int, int, char **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsObjectHashtable::nsObjectHashtable(void *(*)(nsHashKey *, void *, void *), void *, int (*)(nsHashKey *, void *, void *), void *, unsigned int, int) -nsCategoryManager::AddCategoryEntry(char const *, char const *, char const *, int, int, char **) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsCategoryManager::AddCategoryEntry(char const *, char const *, char const *, int, int, char **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsCategoryManager::AddCategoryEntry(char const *, char const *, char const *, int, int, char **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -__17nsObjectHashtablePFP9nsHashKeyPvPv_PvPvPFP9nsHashKeyPvPv_iT2Uii -CategoryNode::CategoryNode(void) -nsCategoryManager::AddCategoryEntry(char const *, char const *, char const *, int, int, char **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -__17nsObjectHashtablePFP9nsHashKeyPvPv_PvPvPFP9nsHashKeyPvPv_iT2Uii -nsCategoryManager::nsCategoryManager(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -__17nsObjectHashtablePFP9nsHashKeyPvPv_PvPvPFP9nsHashKeyPvPv_iT2Uii -CategoryNode::CategoryNode(void) -nsCategoryManager::AddCategoryEntry(char const *, char const *, char const *, int, int, char **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -__17nsObjectHashtablePFP9nsHashKeyPvPv_PvPvPFP9nsHashKeyPvPv_iT2Uii -nsCategoryManager::nsCategoryManager(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsCategoryManager::AddCategoryEntry(char const *, char const *, char const *, int, int, char **) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsCategoryManager::AddCategoryEntry(char const *, char const *, char const *, int, int, char **) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsCategoryManager::AddCategoryEntry(char const *, char const *, char const *, int, int, char **) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsCString::SetCapacity(unsigned int) -nsCString::SetLength(unsigned int) -nsACString::do_AssignFromReadable(nsACString const &) -nsACString::do_AssignFromElementPtr(char const *) -nsCString::nsCString(char const *) -nsCategoryManager::AddCategoryEntry(char const *, char const *, char const *, int, int, char **) - -# ---------------------------------------------------------------------- -# -# nsScriptNameSpaceManager -# - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsScriptNameSpaceManager::RegisterClassName(char const *, int) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsScriptNameSpaceManager::FillHashWithDOMInterfaces(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsScriptNameSpaceManager::FillHash(nsICategoryManager *, char const *, nsGlobalNameStruct::nametype) - - -__builtin_new -nsScriptNameSpaceManager::RegisterClassName(char const *, int) - -# ---------------------------------------------------------------------- -# -# nsScriptSecurityManager -# - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsScriptSecurityManager::InitPolicies(unsigned int, char const **, nsISecurityPref *) - - -__builtin_new -nsScriptSecurityManager::EnumeratePolicyCallback(char const *, void *) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsScriptSecurityManager::EnumeratePolicyCallback(char const *, void *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsScriptSecurityManager::InitPrefs(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -__17nsObjectHashtablePFP9nsHashKeyPvPv_PvPvPFP9nsHashKeyPvPv_iT2Uii -nsScriptSecurityManager::EnumeratePolicyCallback(char const *, void *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsScriptSecurityManager::InitPolicies(unsigned int, char const **, nsISecurityPref *) - -# ---------------------------------------------------------------------- -# -# nsStringBundleService -# - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsStringBundleService::insertIntoCache(nsIStringBundle *, nsCStringKey *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsStringBundleService::insertIntoCache(nsIStringBundle *, nsCStringKey *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsStringBundleService::nsStringBundleService(void) - - -PR_Malloc -PL_ArenaAllocate -nsStringBundleService::insertIntoCache(nsIStringBundle *, nsCStringKey *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsStringBundleService::insertIntoCache(nsIStringBundle *, nsCStringKey *) - -# ---------------------------------------------------------------------- - - -__builtin_new -CSSStyleSheetImpl::CSSStyleSheetImpl(void) - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -CSSStyleSheetImpl::AppendStyleRule(nsICSSRule *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -CSSStyleSheetImpl::CheckRuleForAttributes(nsICSSRule *) - - -__builtin_new -AtomKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -CSSStyleSheetImpl::CheckRuleForAttributes(nsICSSRule *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -CSSStyleSheetImpl::CheckRuleForAttributes(nsICSSRule *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -CSSStyleSheetInner::CSSStyleSheetInner(nsICSSStyleSheet *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -HTMLStyleSheetImpl::HTMLStyleSheetImpl(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawRemove -nsHashtable::Remove(nsHashKey *) -HTMLStyleSheetImpl::DropMappedAttributes(nsIHTMLMappedAttributes *) - - -__builtin_new -AttributeKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -HTMLStyleSheetImpl::UniqueMappedAttributes(nsIHTMLMappedAttributes *, nsIHTMLMappedAttributes *&) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -HTMLStyleSheetImpl::UniqueMappedAttributes(nsIHTMLMappedAttributes *, nsIHTMLMappedAttributes *&) - - -__builtin_new -nsStyleContextData::Create(nsIPresContext *) - - -__builtin_new -__builtin_vec_new -nsStyleContent::AllocateCounterResets(unsigned int) - - -__builtin_new -__builtin_vec_new -nsStyleContent::AllocateContents(unsigned int) - - -__builtin_new -xptiManifest::Read(xptiInterfaceInfoManager *, xptiWorkingSet *) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -PL_HashTableAdd -xptiManifest::Read(xptiInterfaceInfoManager *, xptiWorkingSet *) - - -__builtin_new -SelectorList::AddSelector(nsCSSSelector const &) -CSSParserImpl::ParseSelectorGroup(int &, SelectorList *&) - - -__builtin_new -CSSParserImpl::ParseContent(int &, nsICSSDeclaration *, int &) - -# ---------------------------------------------------------------------- -# -# RuleHash -# - - -__builtin_new -RuleHash::AppendRuleToTable(nsHashtable &, int, nsICSSStyleRule *) - - -__builtin_new -RuleHash::AppendRuleToTable(nsHashtable &, nsIAtom *, nsICSSStyleRule *) - - -__builtin_new -RuleHash::AppendRuleToTable(nsHashtable &, nsIAtom *, nsICSSStyleRule *, int) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -RuleHash::AppendRuleToTable(nsHashtable &, int, nsICSSStyleRule *) - - -__builtin_new -AtomKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -RuleHash::AppendRuleToTable(nsHashtable &, nsIAtom *, nsICSSStyleRule *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -RuleHash::RuleHash(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -RuleHash::AppendRuleToTable(nsHashtable &, nsIAtom *, nsICSSStyleRule *) - - -__builtin_new -__builtin_vec_new -RuleHash::EnumerateAllRules(nsIAtom *, nsIAtom *, nsVoidArray const &, void (*)(nsICSSStyleRule *, void *), void *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -RuleHash::AppendRuleToTable(nsHashtable &, nsIAtom *, nsICSSStyleRule *, int) - -# ---------------------------------------------------------------------- -# -# nsCSSSelector -# - - -__builtin_new -nsCSSSelector::nsCSSSelector(nsCSSSelector const &) - - -__builtin_new -nsAtomList::nsAtomList(nsAtomList const &) -nsCSSSelector::nsCSSSelector(nsCSSSelector const &) - - -__builtin_new -nsAttrSelector::nsAttrSelector(nsAttrSelector const &) -nsCSSSelector::nsCSSSelector(nsCSSSelector const &) - - -__builtin_new -nsAttrSelector::nsAttrSelector(nsAttrSelector const &) -nsAttrSelector::nsAttrSelector(nsAttrSelector const &) -nsCSSSelector::nsCSSSelector(nsCSSSelector const &) - -# ---------------------------------------------------------------------- -# -# StyleSetImpl -# - - -__builtin_new -CSSStyleSheetImpl::GetStyleRuleProcessor(nsIStyleRuleProcessor *&, nsIStyleRuleProcessor *) -StyleSetImpl::ClearOverrideRuleProcessors(void) - - -__builtin_new -CSSRuleProcessor::GetRuleCascade(nsIPresContext *, nsIAtom *) -CSSRuleProcessor::RulesMatching(nsIPresContext *, nsIAtom *, nsIContent *, nsIStyleContext *, nsIRuleWalker *) -StyleSetImpl::ReplaceBackstopStyleSheets(nsISupportsArray *) - - -__builtin_new -CSSRuleProcessor::GetRuleCascade(nsIPresContext *, nsIAtom *) -CSSRuleProcessor::RulesMatching(nsIPresContext *, nsIAtom *, nsIContent *, nsIAtom *, nsIStyleContext *, nsICSSPseudoComparator *, nsIRuleWalker *) -StyleSetImpl::ResolveStyleFor(nsIPresContext *, nsIContent *, nsIStyleContext *, int) - - -__builtin_new -nsSupportsArray::Create(nsISupports *, nsID const &, void **) -NS_NewISupportsArray(nsISupportsArray **) -StyleSetImpl::EnsureArray(nsISupportsArray **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsRuleNode::Transition(nsIStyleRule *, nsIRuleNode **) -nsRuleWalker::Forward(nsIStyleRule *) -StyleSetImpl::AddImportantRules(nsIRuleNode *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsRuleNode::Transition(nsIStyleRule *, nsIRuleNode **) -nsRuleWalker::Forward(nsIStyleRule *) -nsHTMLBodyElement::WalkInlineStyleRules(nsIRuleWalker *) -HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext *, nsIAtom *, nsIContent *, nsIStyleContext *, nsIRuleWalker *) -StyleSetImpl::ReplaceBackstopStyleSheets(nsISupportsArray *) - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -CSSRuleProcessor::CascadeSheetRulesInto(nsISupports *, void *) -nsSupportsArray::EnumerateBackwards(int (*)(nsISupports *, void *), void *) -CSSRuleProcessor::CascadeSheetRulesInto(nsISupports *, void *) -CSSRuleProcessor::GetRuleCascade(nsIPresContext *, nsIAtom *) -CSSRuleProcessor::RulesMatching(nsIPresContext *, nsIAtom *, nsIContent *, nsIStyleContext *, nsIRuleWalker *) -StyleSetImpl::ReplaceBackstopStyleSheets(nsISupportsArray *) - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -CSSRuleProcessor::AppendStyleSheet(nsICSSStyleSheet *) -CSSStyleSheetImpl::GetStyleRuleProcessor(nsIStyleRuleProcessor *&, nsIStyleRuleProcessor *) -StyleSetImpl::ClearOverrideRuleProcessors(void) - -//---------------------------------------------------------------------- - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -~.* -~.* -basic_nsAWritableString::Assign(basic_nsAReadableString const &) -nsString::operator=(nsString const &) -StyleListImpl::ResetFrom(nsStyleList const *, nsIPresContext *) - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -CSSRuleProcessor::CascadeSheetRulesInto(nsISupports *, void *) -nsSupportsArray::EnumerateBackwards(int (*)(nsISupports *, void *), void *) -CSSRuleProcessor::CascadeSheetRulesInto(nsISupports *, void *) -CSSRuleProcessor::GetRuleCascade(nsIPresContext *, nsIAtom *) -CSSRuleProcessor::RulesMatching(nsIPresContext *, nsIAtom *, nsIContent *, nsIAtom *, nsIStyleContext *, nsICSSPseudoComparator *, nsIRuleWalker *) -StyleSetImpl::ResolveStyleFor(nsIPresContext *, nsIContent *, nsIStyleContext *, int) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -CSSRuleProcessor::ClearRuleCascades(void) -nsSupportsArray::EnumerateBackwards(int (*)(nsISupports *, void *), void *) -CSSRuleProcessor::GetRuleCascade(nsIPresContext *, nsIAtom *) -CSSRuleProcessor::RulesMatching(nsIPresContext *, nsIAtom *, nsIContent *, nsIAtom *, nsIStyleContext *, nsICSSPseudoComparator *, nsIRuleWalker *) -StyleSetImpl::ResolveStyleFor(nsIPresContext *, nsIContent *, nsIStyleContext *, int) - -# ---------------------------------------------------------------------- - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -StyleContextCache::VerifyList(unsigned int) - - -__builtin_new -StyleContextCache::AllocateList(void) - -# ---------------------------------------------------------------------- -# -# nsPersistentProperties -# - - -__builtin_new -nsPersistentProperties::Create(nsISupports *, nsID const &, void **) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -nsPersistentProperties::SetStringProperty(nsAString const &, nsAString &, nsAString &) -nsPersistentProperties::Load(nsIInputStream *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCppSharedAllocator::allocate(unsigned int, void const *) -nsCRT::strndup(unsigned short const *, unsigned int) -nsCRT::strdup(unsigned short const *) -nsString::ToNewUnicode(void) const -nsPersistentProperties::SetStringProperty(nsString const &, nsString &, nsString &) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -nsPersistentProperties::SetStringProperty(nsString const &, nsString &, nsString &) - - -PR_Malloc -PL_ArenaFinish -PL_NewHashTable -nsPersistentProperties::nsPersistentProperties(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewUnicode(nsAString const &) -nsPersistentProperties::SetStringProperty(nsAString const &, nsAString &, nsAString &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -unsigned short * AllocateStringCopy(nsAString const &, unsigned short *) -ToNewUnicode(nsAString const &) -nsPersistentProperties::SetStringProperty(nsAString const &, nsAString &, nsAString &) - -# ---------------------------------------------------------------------- -# -# nsCSSValue -# - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCppSharedAllocator::allocate(unsigned int, void const *) -nsCRT::strndup(unsigned short const *, unsigned int) -nsCRT::strdup(unsigned short const *) -nsString::ToNewUnicode(void) const -nsCSSValue::operator=(nsCSSValue const &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewUnicode(nsAString const &) -nsCSSValue::SetStringValue(nsAString const &, nsCSSUnit) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -unsigned short * AllocateStringCopy(nsAString const &, unsigned short *) -ToNewUnicode(nsAString const &) -nsCSSValue::SetStringValue(nsAString const &, nsCSSUnit) - -# ---------------------------------------------------------------------- - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStringKey::Clone(void) const - -#---------------------------------------------------------------------- -# -# nsTextFragment -# - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsTextFragment::SetTo(unsigned short const *, int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewCString(nsAString const &) -nsTextFragment::operator=(nsAString const &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -char * AllocateStringCopy(basic_nsAReadableString const &, char *) -ToNewCString(basic_nsAReadableString const &) -nsTextFragment::operator=(basic_nsAReadableString const &) - -#---------------------------------------------------------------------- -# -# nsTextBoxFrame -# - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -nsTextBoxFrame::UpdateAttributes(nsIPresContext *, nsIAtom *, int &, int &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -nsTextBoxFrame::CalculateTitleForWidth(nsIPresContext *, nsIRenderingContext &, int) - -# ---------------------------------------------------------------------- -# -# nsPopupSetFrame -# - - -__builtin_new -nsPopupSetFrame::AddPopupFrame(nsIFrame *) - -#---------------------------------------------------------------------- - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewCString(nsACString const &) -nsStdURL::GetSpec(char **) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsString::ToNewCString(void) const -nsSimpleURI::SetSpec(char const *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewCString(nsAString const &) -nsSimpleURI::SetSpec(char const *) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -PL_HashTableAdd -nsNodeInfoManager::GetNodeInfo(nsIAtom *, nsIAtom *, int, nsINodeInfo *&) - - -PR_Malloc -PL_ArenaFinish -PL_NewHashTable -nsNodeInfoManager::nsNodeInfoManager(void) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawRemove -PL_HashTableRemove -nsNodeInfoManager::RemoveNodeInfo(nsNodeInfo *) - - -XPT_ArenaMalloc -xptiInterfaceInfo::CopyName(char const *, xptiWorkingSet *) - - -__builtin_new -xptiInterfaceInfo::PartiallyResolveLocked(XPTInterfaceDescriptor *, xptiWorkingSet *) - - -XPT_ArenaMalloc - - -siglongjmp -pthread_create - - -XkbAllocClientMap - - -_XiCheckExtInit - - -_XAllocScratch - - -XUnlockDisplay - - -_XlcCreateLC - - -XkbUseExtension - - -_XimServerDestroy - - -_XlcAddCharSet - - -XInitExtension - - -_XlcGenericLoader - - -_XwcDefaultDrawImageString - - -_XlcAddCT - - -XShmCreateImage - - -_XFreeAtomTable - - -XCreateRegion - - -XIntersectRegion - - -_XlcCreateLocaleDataBase - - -_XUpdateAtomCache - - -XrmMergeDatabases - - -XrmParseCommand - - -XOpenDisplay - - -XCreateGC - - -_XlcResetConverter - - -_XEnq - - -_XimLcctstowcs - - -XtMalloc - - -XtCalloc - - -Xpermalloc - - -_XlcCreateDefaultCharSet - - -_XimLocalSetICValues - - -_XimLocalCreateIC - - -_XlcSetConverter - - -_XkbGetCharset - - -g_malloc - - -g_realloc - - -g_malloc0 - - -_XimLcctstoutf8 - - -loader_png -gdk_imlib_load_image - - -loader_png -gdk_imlib_save_image - - -_dl_lookup_versioned_symbol_skip - - -_dl_dst_substitute - - -_dl_map_object_deps - - -_dl_map_object - - -_dl_debug_message - - -PR_Malloc -bufio_SetBufferSize -nsXPTCStubBase::Sentinel9(void) -NR_RegSetBufferSize -nsRegistry::SetBufferSize(int) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::AddBucket(unsigned int) -nsFixedSizeAllocator::Init(char const *, unsigned int const *, int, int, int) -nsXBLService::nsXBLService(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsXBLService::nsXBLService(void) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -InMemoryAssertionEnumeratorImpl::operator new(unsigned int, nsFixedSizeAllocator &) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsGenericModule::nsGenericModule(char const *, unsigned int, nsModuleComponentInfo *, unsigned int (*)(nsIModule *), void (*)(nsIModule *)) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsGenericModule::GetClassObject(nsIComponentManager *, nsID const &, nsID const &, void **) - - -__builtin_new -nsIDKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsGenericModule::GetClassObject(nsIComponentManager *, nsID const &, nsID const &, void **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsGenericModule::nsGenericModule(char const *, unsigned int, nsModuleComponentInfo *, void (*)(nsIModule *)) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::nsHashtable(unsigned int, int) -nsGenericModule::nsGenericModule(char const *, unsigned int, nsModuleComponentInfo *, unsigned int (*)(nsIModule *), void (*)(nsIModule *)) - - -gettext -gettext -setlocale -setlocale -nsUNIXCharset::nsUNIXCharset(void) - -# ---------------------------------------------------------------------- -# -# nsLocaleService -# - - -textdomain -textdomain -setlocale -setlocale -nsLocaleService::nsLocaleService(void) - - -setlocale -setlocale -setlocale -nsLocaleService::nsLocaleService(void) - - -PR_Malloc -PL_ArenaFinish -PL_NewHashTable -nsLocale::nsLocale(void) - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -PL_HashTableAdd -nsLocale::AddCategory(unsigned short const *, unsigned short const *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::do_AssignFromElementPtr(unsigned short const *) -nsString::nsString(unsigned short const *) -nsLocale::AddCategory(unsigned short const *, unsigned short const *) - -# ---------------------------------------------------------------------- -# -# nsServiceManagerImpl (obsolete?) -# - - -__builtin_new -nsServiceManagerImpl::nsServiceManagerImpl(void) -NS_NewServiceManager(nsIServiceManager **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsObjectHashtable::nsObjectHashtable(void *(*)(nsHashKey *, void *, void *), void *, int (*)(nsHashKey *, void *, void *), void *, unsigned int, int) -nsServiceManagerImpl::nsServiceManagerImpl(void) - - -__builtin_new -nsIDKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsServiceManagerImpl::GetService(nsID const &, nsID const &, nsISupports **, nsIShutdownListener *) - - -__builtin_new -nsServiceManagerImpl::nsServiceManagerImpl(void) -NS_NewServiceManager(nsIServiceManager **) - - -__builtin_new -nsServiceManagerImpl::GetService(nsID const &, nsID const &, nsISupports **, nsIShutdownListener *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsServiceManagerImpl::GetService(nsID const &, nsID const &, nsISupports **, nsIShutdownListener *) - -#---------------------------------------------------------------------- -# -# nsXMLElement -# - - -__builtin_new -nsGenericContainerElement::SetAttribute(nsINodeInfo *, basic_nsAReadableString const &, int) -nsGenericXMLElement::SetAttribute(nsINodeInfo *, basic_nsAReadableString const &, int) - - -__builtin_new -nsGenericContainerElement::SetAttribute(nsINodeInfo *, basic_nsAReadableString const &, int) -nsXMLElement::SetAttribute(nsINodeInfo *, basic_nsAReadableString const &, int) - - -__builtin_new -nsGenericContainerElement::SetAttr(nsINodeInfo *, nsAString const &, int) -nsXMLElement::SetAttr(nsINodeInfo *, nsAString const &, int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -nsString::nsString(nsAString const &) -nsGenericContainerElement::SetAttr(nsINodeInfo *, nsAString const &, int) -nsXMLElement::SetAttr(nsINodeInfo *, nsAString const &, int) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsCheapVoidArray::AppendElement(void *) -nsGenericContainerElement::AppendChildTo(nsIContent *, int, int) -nsXMLContentSink::AddContentAsLeaf(nsIContent *) - -#---------------------------------------------------------------------- -# -# nsXMLDocument -# - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -nsDocument::nsDocument(void) -nsMarkupDocument::nsMarkupDocument(void) -nsXMLDocument::nsXMLDocument(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsStr::StrAppend(nsStr &, nsStr const &, unsigned int, int) -nsString::AppendWithConversion(char const *, int) -nsString::AssignWithConversion(char const *) -nsDocument::StartDocumentLoad(char const *, nsIChannel *, nsILoadGroup *, nsISupports *, nsIStreamListener **, int) -nsXMLDocument::StartDocumentLoad(char const *, nsIChannel *, nsILoadGroup *, nsISupports *, nsIStreamListener **, int) - -#---------------------------------------------------------------------- - - -__builtin_new -nsGCCache::nsGCCache(void) - -#---------------------------------------------------------------------- -# -# prefs -# - - -_init -PL_HashTableRawAdd -PL_HashTableAdd -pref_HashPref - - -_init -PL_NewHashTable -PREF_Init - - -pref_HashPref - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsPref::nsPref(void) - - -PREF_RegisterCallback - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsStr::StrAppend(nsStr &, nsStr const &, unsigned int, int) -nsStr::StrAssign(nsStr &, nsStr const &, unsigned int, int) -nsCString::nsCString(nsCString const &) -nsCStringArray::InsertCStringAt(nsCString const &, int) -nsPrefBranch::AddObserver(char const *, nsIObserver *) - -#---------------------------------------------------------------------- - - -PR_Calloc -PR_SetThreadPrivate -nsThread::RegisterThreadSelf(void) - - -XFreeFont - - -__builtin_new -nsFontGTK::operator new(unsigned int) - - -__builtin_new -nsCheapVoidArray::SwitchToVector(void) -nsCheapVoidArray::AppendElement(void *) -nsGenericContainerElement::AppendChildTo(nsIContent *, int) - - -PR_Realloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsCheapVoidArray::AppendElement(void *) -nsGenericContainerElement::AppendChildTo(nsIContent *, int, int) - -#---------------------------------------------------------------------- -# -# nsObserverService -# - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsObserverService::GetObserverList(unsigned short const *, nsIObserverList **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsObjectHashtable::nsObjectHashtable(void *(*)(nsHashKey *, void *, void *), void *, int (*)(nsHashKey *, void *, void *), void *, unsigned int, int) -nsObserverService::GetObserverList(unsigned short const *, nsIObserverList **) - - -__builtin_new -nsStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsObserverService::GetObserverList(nsString const &, nsIObserverList **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsObjectHashtable::nsObjectHashtable(void *(*)(nsHashKey *, void *, void *), void *, int (*)(nsHashKey *, void *, void *), void *, unsigned int, int) -nsObserverService::GetObserverList(nsString const &, nsIObserverList **) - - -__builtin_new -NS_NewObserverList(nsIObserverList **) -nsObserverService::GetObserverList(nsString const &, nsIObserverList **) - - -__builtin_new -nsObserverService::GetObserverList(nsString const &, nsIObserverList **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsObserverService::GetObserverList(nsString const &, nsIObserverList **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsObjectHashtable::nsObjectHashtable(void *(*)(nsHashKey *, void *, void *), void *, int (*)(nsHashKey *, void *, void *), void *, unsigned int, int) -nsObserverService::GetObserverList(char const *, nsObserverList **) - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -nsObserverList::AddObserver(nsIObserver *, int) - -#---------------------------------------------------------------------- - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsViewManager::nsViewManager(void) - - -__builtin_new -nsViewManager2::AddToDisplayList(int *, nsIView *, nsRect &, nsRect &, unsigned int, int, int) - -# ---------------------------------------------------------------------- -# -# nsBindingManager -# - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsBindingManager::SetContentListFor(nsIContent *, nsISupportsArray *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsBindingManager::SetInsertionParent(nsIContent *, nsIContent *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsBindingManager::SetAnonymousNodesFor(nsIContent *, nsISupportsArray *) - - -__builtin_new -nsISupportsKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsBindingManager::SetBinding(nsIContent *, nsIXBLBinding *) - - -__builtin_new -nsBindingManager::SetBinding(nsIContent *, nsIXBLBinding *) - - -__builtin_new -nsBindingManager::SetInsertionParent(nsIContent *, nsIContent *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsBindingManager::SetBinding(nsIContent *, nsIXBLBinding *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsBindingManager::SetBinding(nsIContent *, nsIXBLBinding *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsBindingManager::SetInsertionParent(nsIContent *, nsIContent *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsBindingManager::SetInsertionParent(nsIContent *, nsIContent *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsBindingManager::SetWrappedJS(nsIContent *, nsIXPConnectWrappedJS *) - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -nsBindingManager::AddToAttachedQueue(nsIXBLBinding *) - -# ---------------------------------------------------------------------- - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -nsString::nsString(nsAString const &) -NameSpaceManagerImpl::RegisterNameSpace(nsAString const &, int &) - - -__builtin_new -nsStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsLayoutUtils::GetDynamicScriptContext(JSContext *, nsIScriptContext **) -NameSpaceManagerImpl::NameSpaceManagerImpl(void) - - -__builtin_new -nsStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -NameSpaceManagerImpl::RegisterNameSpace(basic_nsAReadableString const &, int &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsStr::StrAppend(nsStr &, nsStr const &, unsigned int, int) -nsStr::StrAssign(nsStr &, nsStr const &, unsigned int, int) -nsString::nsString(nsString const &) -nsLayoutUtils::CopyNewlineNormalizedUnicodeTo(nsReadingIterator &, nsReadingIterator const &, basic_nsAWritableString &) -NameSpaceManagerImpl::NameSpaceManagerImpl(void) - - -__builtin_new -nsErrorService::Create(nsISupports *, nsID const &, void **) - - -__builtin_new -nsVoidKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsInt2StrHashtable::Put(unsigned int, char const *) -nsErrorService::RegisterErrorStringBundleKey(unsigned int, char const *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsInt2StrHashtable::Put(unsigned int, char const *) -nsErrorService::RegisterErrorStringBundleKey(unsigned int, char const *) - - -__builtin_new -ArenaImpl::Create(nsISupports *, nsID const &, void **) -NS_NewHeapArena(nsIArena **, unsigned int) -nsDocument::Init(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsDocument::nsDocument(void) - - -__builtin_new -nsDocument::SetHeaderData(nsIAtom *, basic_nsAReadableString const &) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsDocument::AddReference(void *, nsISupports *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -~.* -~.* -basic_nsAWritableString::Assign(basic_nsAReadableString const &) -nsDocHeaderData::nsDocHeaderData(nsIAtom *, basic_nsAReadableString const &) - - -__builtin_new -XPCContext::newXPCContext(XPCJSRuntime *, JSContext *) - - -__builtin_new -nsEventQueueServiceImpl::Create(nsISupports *, nsID const &, void **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsEventQueueServiceImpl::nsEventQueueServiceImpl(void) - - -PR_Realloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsEventListenerManager::AddEventListener(nsIDOMEventListener *, EventArrayType, int, nsHashKey *, int) - - -PR_Malloc -nsEventListenerManager::AddEventListener(nsIDOMEventListener *, EventArrayType, int, nsHashKey *, int) -nsEventListenerManager::SetJSEventListener(nsIScriptContext *, nsISupports *, nsIAtom *, int) -nsEventListenerManager::AddScriptEventListener(nsIScriptContext *, nsISupports *, nsIAtom *, nsAString const &, int) - - -PR_Malloc -nsEventListenerManager::AddEventListener(nsIDOMEventListener *, EventArrayType, int, nsHashKey *, int) -nsEventListenerManager::AddEventListenerByType(nsIDOMEventListener *, nsAString const &, int) - - -PR_Malloc -nsEventListenerManager::AddEventListener(nsIDOMEventListener *, EventArrayType, int, nsHashKey *, int) -nsEventListenerManager::AddEventListenerByIID(nsIDOMEventListener *, nsID const &, int) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::ReplaceElementAt(void *, int) -nsEventListenerManager::GetListenersByType(EventArrayType, nsHashKey *, int) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::ReplaceElementAt(void *, int) -nsEventListenerManager::GetListenersByType(EventArrayType, nsHashKey *, int) - - -__builtin_new -nsEventListenerManager::AddEventListener(nsIDOMEventListener *, nsID const &, int, int) - - -PR_Malloc -nsEventListenerManager::AddEventListener(nsIDOMEventListener *, nsID const &, int, int) - - -__builtin_new -nsCParserNode::AddAttribute(CToken *) - - -__builtin_new -__builtin_vec_new -nsDeque::GrowCapacity(void) -nsDeque::Push(void *) -nsCParserNode::AddAttribute(CToken *) - - -PR_Malloc -nsSocketTransportService::Init(void) - - -PR_Malloc -nsSocketTransport::AsyncWrite(nsIInputStream *, nsIStreamObserver *, nsISupports *) - - -PR_Malloc -_PR_Getfd -PR_GetConnectStatus -PR_Socket -PR_OpenTCPSocket -nsSocketTransport::doConnection(short) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::AddBucket(unsigned int) -nsFixedSizeAllocator::Init(char const *, unsigned int const *, int, int, int) -CompositeDataSourceImpl::CompositeDataSourceImpl(void) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -CompositeDataSourceImpl::GetTargets(nsIRDFResource *, nsIRDFResource *, int, nsISimpleEnumerator **) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -CompositeDataSourceImpl::ArcLabelsIn(nsIRDFNode *, nsISimpleEnumerator **) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -CompositeDataSourceImpl::ArcLabelsOut(nsIRDFResource *, nsISimpleEnumerator **) - -# ---------------------------------------------------------------------- -# -# nsHTMLValue -# - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -unsigned short * AllocateStringCopy(basic_nsAReadableString const &, unsigned short *) -ToNewUnicode(basic_nsAReadableString const &) -nsHTMLValue::nsHTMLValue(basic_nsAReadableString const &, nsHTMLUnit) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewUnicode(nsAString const &) -nsHTMLValue::SetStringValue(nsAString const &, nsHTMLUnit) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -unsigned short * AllocateStringCopy(nsAString const &, unsigned short *) -ToNewUnicode(nsAString const &) -nsHTMLValue::nsHTMLValue(nsAString const &, nsHTMLUnit) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -unsigned short * AllocateStringCopy(nsAString const &, unsigned short *) -ToNewUnicode(nsAString const &) -nsHTMLValue::SetStringValue(nsAString const &, nsHTMLUnit) - -# ---------------------------------------------------------------------- - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsMemCache::GetCachedNetData(char const *, unsigned int, nsINetDataCacheRecord **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsMemCache::Init(void) - - -__builtin_new -nsOpaqueKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsMemCache::GetCachedNetData(char const *, unsigned int, nsINetDataCacheRecord **) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsOpaqueKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsMemCache::GetCachedNetData(char const *, unsigned int, nsINetDataCacheRecord **) - - -__builtin_new -nsOpaqueKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsMemCache::GetCachedNetData(char const *, unsigned int, nsINetDataCacheRecord **) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsOpaqueKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsMemCache::GetCachedNetData(char const *, unsigned int, nsINetDataCacheRecord **) - - -__builtin_new -__builtin_vec_new -nsMemCacheRecord::SetMetaData(unsigned int, char const *) - - -__builtin_new -__builtin_vec_new -nsMemCacheRecord::Init(char const *, unsigned int, unsigned int, nsMemCache *) - - -PR_Realloc -nsXPIDLString type_info function -nsXPIDLString type_info function -nsTextFormatter::vsmprintf(unsigned short const *, void *) -nsTextFormatter::smprintf(unsigned short const *,...) - - -PR_Malloc -nsXPIDLString type_info function -nsXPIDLString type_info function -nsTextFormatter::vsmprintf(unsigned short const *, void *) - - -PR_Realloc -nsXPIDLString type_info function -nsXPIDLString type_info function -nsTextFormatter::vsmprintf(unsigned short const *, void *) - -#---------------------------------------------------------------------- -# -# nsPresContext -# - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsPresContext::nsPresContext(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsPresContext::LoadImage(nsString const &, nsIFrame *, imgIRequest **) - -#---------------------------------------------------------------------- -# -# nsPresState -# - - -__builtin_new -nsPresState::SetStateProperty(nsAString const &, nsAString const &) - - -__builtin_new -nsPresState::SetStatePropertyAsSupports(nsAString const &, nsISupports *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsPresState::SetStatePropertyAsSupports(basic_nsAReadableString const &, nsISupports *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsPresState::SetStateProperty(basic_nsAReadableString const &, basic_nsAReadableString const &) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsPresState::SetStatePropertyAsSupports(basic_nsAReadableString const &, nsISupports *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsPresState::SetStateProperty(basic_nsAReadableString const &, basic_nsAReadableString const &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsSupportsWStringImpl::SetDataWithLength(unsigned int, unsigned short const *) -nsSupportsWStringImpl::SetData(unsigned short const *) -nsPresState::SetStateProperty(basic_nsAReadableString const &, basic_nsAReadableString const &) - - -__builtin_new -nsStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsPresState::SetStatePropertyAsSupports(basic_nsAReadableString const &, nsISupports *) - - -__builtin_new -nsStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsPresState::SetStateProperty(basic_nsAReadableString const &, basic_nsAReadableString const &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsSupportsWStringImpl::SetDataWithLength(unsigned int, unsigned short const *) -nsSupportsWStringImpl::SetData(unsigned short const *) -nsPresState::SetStateProperty(basic_nsAReadableString const &, basic_nsAReadableString const &) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsPresState::SetStateProperty(nsAString const &, nsAString const &) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsPresState::SetStatePropertyAsSupports(nsAString const &, nsISupports *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsPresState::SetStateProperty(nsAString const &, nsAString const &) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsPresState::SetStatePropertyAsSupports(nsAString const &, nsISupports *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsSupportsStringImpl::SetDataWithLength(unsigned int, char const *) -nsSupportsStringImpl::SetData(char const *) -nsPresState::SetStateProperty(nsAString const &, nsAString const &) - -# ---------------------------------------------------------------------- -# -# Prefs stuff -# - - -PL_strdup -pref_HashPref - - -PL_strdup -PREF_LockPref - - -PL_strdup -PREF_RegisterCallback - -#---------------------------------------------------------------------- -# -# Imagelib Stuff -# - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -imgRequest::AddProxy(imgRequestProxy *) - - -__builtin_new -ImageRequestImpl::AddObserver(nsIImageRequestObserver *) - - -PR_Malloc -XP_AddObserver -ImageRequestImpl::Init(void *, char const *, nsIImageRequestObserver *, unsigned int const *, unsigned int, unsigned int, unsigned int, ilINetContext *) - - -__builtin_new -ImageNetContextImpl::GetURL(ilIURL *, ImgCachePolicy, ilINetReader *, int) - -# il_group_notify() is really a call to a static rounting il_init_scaling() - -PR_Malloc -il_group_notify(_IL_GroupContext *, long) -il_size(il_container_struct *) -ImgDCallbk::ImgDCBImageSize(void) - - -PR_Calloc -il_gif_write(il_container_struct *, unsigned char const *, int) - - -PR_Malloc -il_gif_write(il_container_struct *, unsigned char const *, int) - - -PR_Calloc -il_gif_init(il_container_struct *) - - -PR_Calloc -IL_GetImage - - -PR_Calloc -il_get_container(_IL_GroupContext *, ImgCachePolicy, char const *, _NI_IRGB *, IL_DitherMode, int, int, int) - - -PR_Calloc -IL_CreateTrueColorSpace - - -PR_Calloc -il_size(il_container_struct *) -ImgDCallbk::ImgDCBImageSize(void) - - -PR_Calloc -IL_CreateGreyScaleColorSpace - - -PR_Malloc -il_BACat(char **, unsigned int, char const *, unsigned int) - - -PR_Realloc -il_BACat(char **, unsigned int, char const *, unsigned int) - - -PR_Malloc -ImageConsumer::OnStartRequest(nsIChannel *, nsISupports *) - -# These are really called from `static' routines in ilclient.cpp, -# *not* ImgDCallbk::CreateInstance() - -PR_Calloc -ImgDCallbk::CreateInstance(nsID const &, il_container_struct *, nsID const &, void **) - -#---------------------------------------------------------------------- - - -__builtin_new -__builtin_vec_new -nsImageGTK::Init(int, int, int, nsMaskRequirements) - -#---------------------------------------------------------------------- -# -# nsLayoutHistoryState -# - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsLayoutHistoryState::nsLayoutHistoryState(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsLayoutHistoryState::nsLayoutHistoryState(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsLayoutHistoryState::AddState(unsigned int, nsIPresState *, nsIStatefulFrame::StateType) - - -__builtin_new -nsVoidKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsLayoutHistoryState::AddState(unsigned int, nsIPresState *, nsIStatefulFrame::StateType) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsLayoutHistoryState::AddState(nsCString const &, nsIPresState *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsLayoutHistoryState::AddState(nsCString const &, nsIPresState *) - -# ---------------------------------------------------------------------- -# -# nsCookieService -# - - -PR_Realloc -Local_SACat(char **, char const *) -COOKIE_GetCookie(char *) - - -PR_Malloc -cookie_IsFromHost(_cookie_CookieStruct *, char *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewCString(nsAString const &) -COOKIE_Read(void) -nsCookieService::Init(void) - -# ---------------------------------------------------------------------- - - -PR_Realloc -nsMemoryImpl::Realloc(void *, unsigned int) -nsMemory::Realloc(void *, unsigned int) -nsReplacementPolicy::AssociateCacheEntryWithRecord(nsINetDataCacheRecord *, nsINetDataCache *, nsCachedNetData **) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsReplacementPolicy::Init(unsigned int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsCString::SetCapacity(unsigned int) -nsCString::SetLength(unsigned int) -nsACString::do_AssignFromReadable(nsACString const &) -nsACString::do_AssignFromElementPtr(char const *) -nsHttpHeaderArray::SetHeader(nsHttpAtom, char const *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsHTTPHandler::SetServerCapabilities(char const *, int, unsigned int) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsHTTPHandler::nsHTTPHandler(void) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsHTTPHandler::SetServerCapabilities(char const *, int, unsigned int) - - -PR_Malloc -PL_ArenaAllocate -ArenaImpl::Alloc(unsigned int) -nsCachedNetData::operator new(unsigned int, nsIArena *) - - -PR_Malloc -ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo *, nsIInputStream *, unsigned int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsSegmentedBuffer::AppendNewSegment(void) - - -PL_strndup -ExtractString - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -__17nsObjectHashtablePFP9nsHashKeyPvPv_PvPvPFP9nsHashKeyPvPv_iT2Uii -nsJAR::nsJAR(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsObjectHashtable::nsObjectHashtable(void *(*)(nsHashKey *, void *, void *), void *, int (*)(nsHashKey *, void *, void *), void *, unsigned int, int) -nsJAR::nsJAR(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewCString(nsACString const &) -nsIOService::ResolveRelativePath(char const *, char const *, char **) -nsJARURI::SetSpec(char const *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsStreamConverterService::Init(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsLayoutUtils::GetDynamicScriptContext(JSContext *, nsIScriptContext **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsDNSService::GetLookupEntry(char const *, nsDNSLookup **) - - -PL_DHashAllocTable -PL_DHashTableInit -nsDNSService::Init(void) - - -__builtin_new -nsDNSService::GetLookupEntry(char const *, nsDNSLookup **) - - -__builtin_new -nsDNSService::Lookup(char const *, nsIDNSListener *, nsISupports *, nsIRequest **) - - -__builtin_new -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsDNSService::GetLookupEntry(char const *, nsDNSLookup **) - - -gethostbyname2 -PR_GetIPNodeByName -nsDNSLookup::InitiateLookup(void) - - -__builtin_new -nsSupportsArray::Create(nsISupports *, nsID const &, void **) -NS_NewISupportsArray(nsISupportsArray **) -nsDNSLookup::Init(char const *) - - -__builtin_new -nsDNSLookup::Create(char const *) - -# ---------------------------------------------------------------------- -# -# nsFormControlList -# - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsFormControlList::AddElementToTable(nsIFormControl *, basic_nsAReadableString const &) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsFormControlList::nsFormControlList(nsIDOMHTMLFormElement *) - - -__builtin_new -nsFormControlList::AddElementToTable(nsIFormControl *, basic_nsAReadableString const &) - - -__builtin_new -nsStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsFormControlList::AddElementToTable(nsIFormControl *, basic_nsAReadableString const &) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsFormControlList::AddElementToTable(nsIFormControl *, basic_nsAReadableString const &) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsFormControlList::AddElementToTable(nsIFormControl *, nsAString const &) - -# ---------------------------------------------------------------------- -# -# nsControllerCommandManager -# - - -__builtin_new -__builtin_vec_new -NS_NewControllerCommandManager(nsIControllerCommandManager **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsControllerCommandManager::nsControllerCommandManager(void) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsControllerCommandManager::RegisterCommand(nsAString const &, nsIControllerCommand *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsControllerCommandManager::RegisterCommand(unsigned short const *, nsIControllerCommand *) - - -__builtin_new -nsStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsControllerCommandManager::RegisterCommand(unsigned short const *, nsIControllerCommand *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsSupportsHashtable::nsSupportsHashtable(unsigned int, int) -nsControllerCommandManager::nsControllerCommandManager(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsConsoleService::nsConsoleService(void) - - -__builtin_new -nsGenericElement::GetDOMSlots(void) - - -__builtin_new -HTMLAttribute::CopyHTMLAttributes(HTMLAttribute *, HTMLAttribute **) - -# ---------------------------------------------------------------------- -# -# HTMLAttributesImpl -# - - -__builtin_new -HTMLAttributesImpl::SetAttributeFor(nsIAtom *, nsAString const &, int, nsIHTMLContent *, nsIHTMLStyleSheet *) - - -__builtin_new -HTMLAttributesImpl::SetAttributeFor(nsIAtom *, nsHTMLValue const &, int, nsIHTMLContent *, nsIHTMLStyleSheet *, int &) - - -__builtin_new -__builtin_vec_new -HTMLAttributesImpl::SetAttributeName(nsIAtom *, int &) - - -__builtin_new -nsHTMLMappedAttributes::SetAttribute(nsIAtom *, nsHTMLValue const &) -HTMLAttributesImpl::SetAttributeFor(nsIAtom *, nsHTMLValue const &, int, nsIHTMLContent *, nsIHTMLStyleSheet *, int &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCRT::strndup(unsigned short const *, unsigned int) -nsCRT::strdup(unsigned short const *) -nsHTMLValue::nsHTMLValue(nsHTMLValue const &) -HTMLAttributesImpl::SetAttributeFor(nsIAtom *, nsHTMLValue const &, int, nsIHTMLContent *, nsIHTMLStyleSheet *, int &) - - -__builtin_new -nsHTMLMappedAttributes::nsHTMLMappedAttributes(nsHTMLMappedAttributes const &) -nsHTMLMappedAttributes::Clone(nsHTMLMappedAttributes **) const -HTMLAttributesImpl::EnsureSingleMappedFor(nsIHTMLContent *, nsIHTMLStyleSheet *, int) - -# ---------------------------------------------------------------------- - - -__builtin_new -__builtin_vec_new -nsEntityConverter::LoadVersionPropertyFile(void) - - -__builtin_new -__builtin_vec_new -nsTableFrame::nsTableFrame(void) - - -__builtin_new -__builtin_vec_new -nsTableFrame::BalanceColumnWidths(nsIPresContext *, nsHTMLReflowState const &, nsSize const &, nsSize *) - - -__builtin_new -nsTableFrame::Init(nsIPresContext *, nsIContent *, nsIFrame *, nsIStyleContext *, nsIFrame *) - - -__builtin_new -nsTableCellFrame::GetFrameName(nsString &) const - - -__builtin_new -nsCellMap::AppendCell(nsTableCellMap &, nsTableCellFrame &, int, int) - - -__builtin_new -nsCellMap::Grow(nsTableCellMap &, int, int) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsVoidArray::nsVoidArray(int) -nsCellMap::Grow(nsTableCellMap &, int, int) - - -__builtin_new -nsTableCellMap::InsertGroupCellMap(nsTableRowGroupFrame &, nsTableRowGroupFrame *&) - - -__builtin_new -nsTableCellMap::AddColsAtEnd(unsigned int) - - -__builtin_new -__builtin_vec_new -nsEncoderSupport::nsEncoderSupport(void) - - -__builtin_new -Init__18nsFrameImageLoaderP14nsIPresContextP13nsIImageGroupRC8nsStringPCUiPC6nsSizeP8nsIFrame16nsImageAnimationPFP14nsIPresContextP19nsIFrameImageLoaderP8nsIFramePvUi_UiPvT9 - - -__builtin_new -AddFrame__18nsFrameImageLoaderP8nsIFramePFP14nsIPresContextP19nsIFrameImageLoaderP8nsIFramePvUi_UiPvT3 - - - -__builtin_new -nsFloaterCacheFreeList::Alloc(void) - - -__builtin_new -nsDocLoaderImpl::AddChannelInfo(nsIChannel *) - - -__builtin_new -nsDocLoaderImpl::AddRequestInfo(nsIRequest *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::AddBucket(unsigned int) -nsFixedSizeAllocator::Init(char const *, unsigned int const *, int, int, int) -nsTokenAllocator::nsTokenAllocator(void) - - -__builtin_new -__builtin_vec_new -SinkContext::AddText(basic_nsAReadableString const &) - - -__builtin_new -__builtin_vec_new -SinkContext::GrowStack(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsScanner::Append(char const *, unsigned int) - - -__builtin_new -nsParser::Parse(nsIURI *, nsIStreamObserver *, int, void *, nsDTDMode) - - -__builtin_new -nsParser::Parse(basic_nsAReadableString const &, void *, nsString const &, int, int, nsDTDMode) - - -__builtin_new -__builtin_vec_new -nsParser::OnDataAvailable(nsIChannel *, nsISupports *, nsIInputStream *, unsigned int, unsigned int) - - -__builtin_new -__builtin_vec_new -InitializeElementTable(void) - - -__builtin_new -nsStorageStream::Init(unsigned int, unsigned int, nsIMemory *) - - -__builtin_new -__builtin_vec_new -nsEntryStack::EnsureCapacityFor(int, int) - - -__builtin_new -nsCacheManager::Init(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -~.* -~.* -basic_nsAWritableString::Assign(unsigned short const *) -nsScriptError::Init(unsigned short const *, unsigned short const *, unsigned short const *, unsigned int, unsigned int, unsigned int, char const *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsCString::SetCapacity(unsigned int) -nsCString::SetLength(unsigned int) -~.* -~.* -basic_nsAWritableString::Assign(char const *) -nsScriptError::Init(unsigned short const *, unsigned short const *, unsigned short const *, unsigned int, unsigned int, unsigned int, char const *) - - -PR_Malloc -bufio_SetBufferSize - - -PR_Malloc -nsMemoryImpl::Alloc -nsMemory::Alloc -ToNewUnicode - - -PR_Malloc -nsMemoryImpl::Alloc -nsMemory::Alloc -nsStr::Alloc - - -__builtin_new -nsDiskCacheDevice::Init(void) - - -__builtin_new -__builtin_vec_new -XULContentSinkImpl::AddAttributes(nsIParserNode const &, nsXULPrototypeElement *) - -# -# XPCNativeInterface::NewInstance allocates an array of XPCNativeMember -# objects, and it also allocates an array of bytes to use for -# XPCNativeInterface objects. Trace would be the same for each. -# - -__builtin_new -__builtin_vec_new -XPCNativeInterface::NewInstance(XPCCallContext &, nsIInterfaceInfo *) - - -JS_DHashAllocTable -JS_DHashTableFinish -JS_DHashTableOperate -XPCNativeInterface::GetNewOrUsed(XPCCallContext &, nsID const *) - - -__builtin_new -__builtin_vec_new -nsDiskCacheBlockFile::Open(nsILocalFile *, unsigned int) - -#---------------------------------------------------------------------- -# -# nsConflictSet -# - - -__builtin_new -__builtin_vec_new -nsConflictSet::AllocBindingTable(void *, unsigned int) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsConflictSet::AllocBindingEntry(void *, void const *) - - -__builtin_new -__builtin_vec_new -nsConflictSet::AllocClusterTable(void *, unsigned int) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsConflictSet::AllocClusterEntry(void *, void const *) - - -__builtin_new -__builtin_vec_new -nsConflictSet::AllocSupportTable(void *, unsigned int) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsConflictSet::AllocSupportEntry(void *, void const *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsRDFConMemberTestNode::Element::Clone(void *) const - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsRDFConInstanceTestNode::Element::Clone(void *) const - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsRDFConInstanceTestNode::FilterInstantiations(InstantiationSet &, void *) const - - -__builtin_new -MemoryElementSet::Add(MemoryElement *) - - -PL_DHashAllocTable -PL_DHashTableFinish -PL_DHashTableOperate -nsTemplateMatchRefSet::AddToTable(nsTemplateMatch *) -nsTemplateMatchRefSet::Add(nsTemplateMatch const *) -nsConflictSet::Add(nsTemplateMatch *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::AddBucket(unsigned int) -nsFixedSizeAllocator::Init(char const *, unsigned int const *, int, int, int) -nsConflictSet::Init(void) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsConflictSet::SupportEntry::Create(nsFixedSizeAllocator &) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsConflictSet::ClusterEntry::Create(nsFixedSizeAllocator &) - -#---------------------------------------------------------------------- - - -__builtin_new -nsAssignmentSet::Add(nsAssignment const &) - -#---------------------------------------------------------------------- -# -# nsXULTemplateBuilder -# - - -__builtin_new -nsXULTemplateBuilder::CompileSimpleRule(nsIContent *, int, InnerNode *) - - -PL_DHashAllocTable -PL_DHashTableInit -nsXULContentBuilder::nsXULContentBuilder(void) - - -PL_DHashAllocTable -PL_DHashTableInit -nsContentSupportMap::Init(void) - - -PL_DHashAllocTable -PL_DHashTableFinish -PL_DHashTableOperate -nsXULContentBuilder::BuildContentFromTemplate(nsIContent *, nsIContent *, nsIContent *, int, nsIRDFResource *, int, nsTemplateMatch *, nsIContent **, int *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCRT::strndup(unsigned short const *, unsigned int) -nsCRT::strdup(unsigned short const *) -nsXULTemplateBuilder::AddBindingsFor(nsXULTemplateBuilder *, nsAString const &, void *) - -#---------------------------------------------------------------------- -# -# nsRuleNetwork -# - - -PL_DHashAllocTable -PL_DHashTableInit -nsRuleNetwork::Init(void) - -#---------------------------------------------------------------------- -# -# nsTemplateRule -# - - -__builtin_new -nsTemplateRule::AddBinding(int, nsIRDFResource *, int) - -#---------------------------------------------------------------------- -# -# nsTemplateMatch -# - - -__builtin_new -nsAssignmentSet::Add(nsAssignment const &) -nsTemplateRule::ComputeAssignmentFor(nsConflictSet &, nsTemplateMatch *, int, Value *) const -nsTemplateMatch::GetAssignmentFor(nsConflictSet &, int, Value *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsInstantiationNode::Propogate(InstantiationSet const &, void *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet &, void *) const - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsTemplateMatch::Create(nsFixedSizeAllocator &, nsTemplateRule const *, Instantiation const &, nsAssignmentSet const &) - -#---------------------------------------------------------------------- - - -__builtin_new -__builtin_vec_new -ReteNodeSet::Add(ReteNode *) - -#---------------------------------------------------------------------- - - -__builtin_new -__builtin_vec_new -nsStaticComponentLoader::GetModuleInfo(void) - - -__builtin_new -__builtin_vec_new -RuleHash::EnumerateAllRules(int, nsIAtom *, nsIAtom *, nsVoidArray const &, void (*)(nsICSSStyleRule *, void *), void *) - - -__builtin_new -__builtin_vec_new -XPCNativeSet::NewInstance(XPCCallContext &, nsIInterfaceInfo *) - - -JS_DHashAllocTable -JS_DHashTableFinish -JS_DHashTableOperate -XPCNativeSet::ClearCacheEntryForClassInfo(nsIClassInfo *) - - -__builtin_new -__builtin_vec_new -XPCNativeSet::NewInstanceMutate(XPCNativeSet *, XPCNativeInterface *, unsigned short) - - -__builtin_new -__builtin_vec_new -nsResourceSet::Add(nsIRDFResource *) - - -__builtin_new -__builtin_vec_new -nsXPCWrappedJSClass::nsXPCWrappedJSClass(XPCCallContext &, nsID const &, nsIInterfaceInfo *) - - -__builtin_new -orkinHeap::Alloc(nsIMdbEnv *, unsigned int, void **) - - -__builtin_new -nsGenericContainerElement::SetAttribute(nsINodeInfo *, nsAString const &, int) - -# -# Space for LiteralImpl is allocated using global operator new so -# that extra space can be allocated for its string value. -# - -__builtin_new -LiteralImpl::Create - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -XULContentSinkImpl::FlushText(int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCRT::strndup(unsigned short const *, unsigned int) -nsCRT::strdup(unsigned short const *) -nsString::ToNewUnicode(void) const -nsPersistentProperties::SetStringProperty(nsString const &, nsString &, nsString &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCRT::strndup(unsigned short const *, unsigned int) -nsCRT::strdup(unsigned short const *) -nsCSSValue::operator=(nsCSSValue const &) - -#---------------------------------------------------------------------- -# -# nsXULDocument -# - - -PR_Realloc -nsVoidArray::SizeTo(int) -nsAutoVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsXULDocument::AddObserver(nsIDocumentObserver *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXULDocument::SetBoxObjectFor(nsIDOMElement *, nsIBoxObject *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXULDocument::SetTemplateBuilderFor(nsIContent *, nsIXULTemplateBuilder *) - -# ---------------------------------------------------------------------- - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewUnicode(nsAString const &) -nsElementMap::Add(nsAString const &, nsIContent *) -nsXULDocument::AddElementToMap(nsIContent *) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewUnicode(nsAString const &) -nsElementMap::Add(nsAString const &, nsIContent *) -nsXULDocument::AddElementForID(nsAString const &, nsIContent *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsXULTreeElement::SelectCallback(nsITimer *, void *) -PL_HashTableRawAdd -PL_HashTableAdd -nsElementMap::Add(nsAString const &, nsIContent *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -NS_NewControllerCommandManager(nsIControllerCommandManager **) -PL_HashTableRawAdd -PL_HashTableAdd -nsElementMap::Add(nsAString const &, nsIContent *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsElementMap::Add(nsAString const &, nsIContent *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::AddBucket(unsigned int) -nsFixedSizeAllocator::Init(char const *, unsigned int const *, int, int, int) -nsElementMap::nsElementMap(void) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -unsigned short * AllocateStringCopy(nsAString const &, unsigned short *) -ToNewUnicode(nsAString const &) -nsElementMap::Add(nsAString const &, nsIContent *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsXULDocument::AddReference(void *, nsISupports *) - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -nsXULDocument::PrepareToWalk(void) - - -PL_DHashAllocTable -PL_DHashTableInit -PL_NewDHashTable -nsXULDocument::AddBroadcastListenerFor(nsIDOMElement *, nsIDOMElement *, nsAString const &) - -#---------------------------------------------------------------------- - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ToNewUnicode(nsAString const &) -nsHTMLValue::nsHTMLValue(nsAString const &, nsHTMLUnit) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ExtractURLScheme -nsStdURL::Resolve(char const *, char **) -CSSParserImpl::ParseURL(int &, nsCSSValue &) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -ExtractURLScheme -nsStdURL::Resolve(char const *, char **) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsRuleNode::Transition(nsIStyleRule *, nsIRuleNode **) -nsRuleWalker::Forward(nsIStyleRule *) - -# -# Doesn't inherit nsISupports -# - -__builtin_new -nsRuleNode::Transition(nsIStyleRule *, nsIRuleNode **) - -# -# No vtable. -# - -__builtin_new -nsClassList::ParseClasses(nsClassList **, nsAString const &) - -# -# Doesn't inherit nsISupports -# - -__builtin_new -nsCheapVoidArray::SwitchToVector(void) - - -__builtin_new -nsEventListenerManager::GetListenersByType(EventArrayType, nsHashKey *, int) - -#---------------------------------------------------------------------- - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *) -nsHashtable::nsHashtable(unsigned int, int) -nsObjectHashtable::nsObjectHashtable(void *(*)(nsHashKey *, void *, void *), void *, int (*)(nsHashKey *, void *, void *), void *, unsigned int, int) -nsServiceManagerImpl::nsServiceManagerImpl(void) - - -__builtin_new -nsXPIDLCString::PrepareForUseAsOutParam(void) - - -__builtin_new -nsXBLBinding::InitClass - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -InMemoryDataSource::LockedAssert(nsIRDFResource *, nsIRDFResource *, nsIRDFNode *, int) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -nsXBLPrototypeBinding::ConstructAttributeTable(nsIContent *) - -#---------------------------------------------------------------------- -# -# nsRuleNode -# - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsSupportsHashtable::Put(nsHashKey *, nsISupports *, nsISupports **) -nsRuleNode::Transition(nsIStyleRule *, nsIRuleNode **) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AppendFromReadable(nsAString const &) -nsAString::do_AppendFromElementPtr(unsigned short const *) -nsRuleNode::ComputeDisplayData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AppendFromReadable(nsAString const &) -nsAString::do_AppendFromElementPtr(unsigned short const *) -nsRuleNode::ComputeBackgroundData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AppendFromReadable(nsAString const &) -nsAString::do_AppendFromElementPtr(unsigned short const *) -nsRuleNode::ComputeListData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - -# ---------------------------------------------------------------------- - -# This stuff will only show off if you've turned off the FrameArena -# in nsPresShell.cpp - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeOutlineData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeContentData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeTableData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeUIResetData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeXULData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::SetDefaultOnRoot(nsStyleStructID, nsIStyleContext *) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeListData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeTextData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeTextResetData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputePaddingData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeFontData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeVisibilityData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeColorData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - -# ---------------------------------------------------------------------- -# -# nsBookmarksService -# - - -PL_DHashAllocTable -PL_DHashTableFinish -PL_DHashTableOperate -InMemoryDataSource::LockedAssert(nsIRDFResource *, nsIRDFResource *, nsIRDFNode *, int) -InMemoryDataSource::Assert(nsIRDFResource *, nsIRDFResource *, nsIRDFNode *, int) -BookmarkParser::updateAtom(nsIRDFDataSource *, nsIRDFResource *, nsIRDFResource *, nsIRDFNode *, int *) - - -PR_Malloc -PL_ArenaAllocate -nsFixedSizeAllocator::Alloc(unsigned int) -Assertion::Create(nsFixedSizeAllocator &, nsIRDFResource *, nsIRDFResource *, nsIRDFNode *, int) -InMemoryDataSource::LockedAssert(nsIRDFResource *, nsIRDFResource *, nsIRDFNode *, int) -InMemoryDataSource::Assert(nsIRDFResource *, nsIRDFResource *, nsIRDFNode *, int) -BookmarkParser::updateAtom(nsIRDFDataSource *, nsIRDFResource *, nsIRDFResource *, nsIRDFNode *, int *) - -# ---------------------------------------------------------------------- -# -# The following types will only be visible if nsPresShell.cpp is compiled -# with the DEBUG_TRACEMALLOC_FRAMEARENA defined. -# - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsStyleContext::SetStyle(nsStyleStructID, nsStyleStruct const &) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsStyleBorder::operator new(unsigned int, nsIPresContext *) - -# XXX This one is a bit sloppy, and may include some of the other -# style data structs. - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeDisplayData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsStyleContext::SetStyle(nsStyleStructID, nsStyleStruct const &) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeBorderData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeUIData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputePositionData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsStylePadding::operator new(unsigned int, nsIPresContext *) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsStyleMargin::operator new(unsigned int, nsIPresContext *) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeBackgroundData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -nsStyleBackground::nsStyleBackground(nsStyleBackground const &) - -# XXX this'll may be subsumed as nsResetStyleData - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsRuleNode::ComputeDisplayData(nsStyleStruct *, nsCSSStruct const &, nsIStyleContext *, nsRuleNode *, nsRuleNode::RuleDetail const &, int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -nsStyleDisplay::nsStyleDisplay(nsStyleDisplay const &) - -# ---------------------------------------------------------------------- -# The following will only show up if you turn off the FrameArena -# in nsPresShell.cpp - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsStyleContext::GetUniqueStyleData(nsIPresContext *, nsStyleStructID const &) - - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsPresContext::AllocateFromShell(unsigned int, void **) -nsStyleFont::operator new(unsigned int, nsIPresContext *) - -# ---------------------------------------------------------------------- -# -# Frames -# - - -__builtin_new -nsLineBox::SetCombinedArea(nsRect const &) - -# This will only appear when the FrameArena is off. - -PR_Malloc -FrameArena::AllocateFrame(unsigned int, void **) -PresShell::AllocateFrame(unsigned int, void **) -nsLineBox::operator new(unsigned int, nsIPresShell *) - -# ---------------------------------------------------------------------- -# -# nsCacheService -# - - -__builtin_new -nsCacheService::ActivateEntry(nsCacheRequest *, nsCacheEntry **) - - -__builtin_new -nsCacheEntry::CreateDescriptor(nsCacheRequest *, int, nsICacheEntryDescriptor **) -nsCacheService::ProcessRequest(nsCacheRequest *, int, nsICacheEntryDescriptor **) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsCString::SetCapacity(unsigned int) -nsCString::SetLength(unsigned int) -nsACString::do_AppendFromReadable(nsACString const &) -nsACString::do_AppendFromElementPtr(char const *) -nsCacheService::CreateRequest(nsCacheSession *, char const *, int, int, nsICacheListener *, nsCacheRequest **) - - -PL_DHashAllocTable -PL_DHashTableFinish -PL_DHashTableOperate -nsCacheEntryHashTable::AddEntry(nsCacheEntry *) -nsCacheService::ActivateEntry(nsCacheRequest *, nsCacheEntry **) - - -PL_DHashAllocTable -PL_DHashTableFinish -PL_DHashTableOperate -nsCacheEntryHashTable::RemoveEntry(nsCacheEntry *) - -# ---------------------------------------------------------------------- - - -PL_DHashAllocTable -PL_DHashTableInit -nsCacheMetaData::Init(void) - -# ---------------------------------------------------------------------- -# -# nsXMLMIMEDataSource -# - - -PR_Malloc -PL_ArenaFinish -PL_HashTableRawAdd -PL_HashTableAdd -nsXMLMIMEDataSource::InitFromFile(nsIFile *) - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsXMLMIMEDataSource::AddMapping(char const *, char const *, char const *, nsIURI *, unsigned int, unsigned int) - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -nsCStringArray::InsertCStringAt(nsCString const &, int) -nsXMLMIMEDataSource::AddMapping(char const *, char const *, char const *, nsIURI *, unsigned int, unsigned int) - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -nsXMLMIMEDataSource::AddMapping(char const *, char const *, char const *, nsIURI *, unsigned int, unsigned int) - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsCStringKey::Clone(void) const -nsHashtable::Put(nsHashKey *, void *) -nsXMLMIMEDataSource::AddMapping(char const *, char const *, char const *, nsIURI *, unsigned int, unsigned int) - -#---------------------------------------------------------------------- -# -# nsRegion -# - - -__builtin_new -__builtin_vec_new -RgnRectMemoryAllocator::RgnRectMemoryAllocator(unsigned int) -nsRegion::Offset(int, int) - - -__builtin_new -__builtin_vec_new -RgnRectMemoryAllocator::Alloc(void) -nsRegion::Or(nsRegion const &, nsRectFast const &) - - -__builtin_new -__builtin_vec_new -RgnRectMemoryAllocator::Alloc(void) -nsRegion::SetToElements(unsigned int) - -#---------------------------------------------------------------------- -# -# nsCharsetMenu -# - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -nsCharsetConverterManager::GetRegistryEnumeration2(char *, int, nsISupportsArray **) -nsCharsetConverterManager::GetEncoderList(nsISupportsArray **) -nsCharsetMenu::InitResources(void) - - -__builtin_new -nsCharsetMenu::AddCharsetToItemArray(nsVoidArray *, nsIAtom *, nsMenuEntry **, int) - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -nsCharsetConverterManager::GetRegistryEnumeration2(char *, int, nsISupportsArray **) -nsCharsetConverterManager::GetDecoderList(nsISupportsArray **) -nsCharsetMenu::InitResources(void) - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -InMemoryDataSource::AddObserver(nsIRDFObserver *) -nsCharsetMenu::AddObserver(nsIRDFObserver *) - -#---------------------------------------------------------------------- -# -# nsLoadGroup -# - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -nsLoadGroup::AddRequest(nsIRequest *, nsISupports *) - -#---------------------------------------------------------------------- -# -# Wallet -# - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -Wallet_Decrypt2 - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::AssignFromReadable(nsAString const &) -Wallet_RandomName - - -PR_Malloc -nsVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -Wallet_RandomName - - -__builtin_new -__builtin_vec_new -Wallet_Decrypt2 - - -__builtin_new -Wallet_RandomName - - -PR_Realloc -nsVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -Wallet_Decrypt2 - - -PR_Realloc -nsVoidArray::SizeTo(int) -nsVoidArray::GrowArrayBy(int) -nsVoidArray::InsertElementAt(void *, int) -Wallet_RandomName - -#---------------------------------------------------------------------- -# -# nsMemoryCacheDevice -# - - -PL_DHashAllocTable -PL_DHashTableFinish -PL_DHashTableOperate -nsCacheEntryHashTable::RemoveEntry(nsCacheEntry *) -nsMemoryCacheDevice::EvictEntry(nsCacheEntry *) - -#---------------------------------------------------------------------- -# -# nsSHEntry -# - - -PR_Malloc -nsMemoryImpl::Alloc(unsigned int) -nsMemory::Alloc(unsigned int) -nsStr::Alloc(nsStr &, unsigned int) -nsStr::Realloc(nsStr &, unsigned int) -nsStr::EnsureCapacity(nsStr &, unsigned int) -nsStr::GrowCapacity(nsStr &, unsigned int) -nsString::SetCapacity(unsigned int) -nsString::SetLength(unsigned int) -nsAString::do_AssignFromReadable(nsAString const &) -nsAString::do_AssignFromElementPtr(unsigned short const *) -nsSHEntry::SetTitle(unsigned short const *) - -# ---------------------------------------------------------------------- - - -PR_Malloc -PL_HashTableFinalize(PLHashTable *) -PL_HashTableRawAdd -nsHashtable::Put(nsHashKey *, void *) -nsOutlinerStyleCache::GetStyleContext(nsICSSPseudoComparator *, nsIPresContext *, nsIContent *, nsIStyleContext *, nsIAtom *, nsISupportsArray *, nsIStyleContext **) - -# ---------------------------------------------------------------------- -# -# nsMsgDatabase -# - - -PL_DHashAllocTable -PL_DHashTableFinish -PL_DHashTableOperate -nsMsgDatabase::AddHdrToCache(nsIMsgDBHdr *, unsigned int) - - -PL_DHashAllocTable -PL_DHashTableFinish -PL_DHashTableOperate -nsMsgDatabase::AddHdrToUseCache(nsIMsgDBHdr *, unsigned int) - -# ---------------------------------------------------------------------- -# -# nsMsgFolderDataSource -# - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -nsMsgFolderDataSource::getFolderArcLabelsOut(nsISupportsArray **) - -# ---------------------------------------------------------------------- -# -# singsign -# - - -__builtin_new -SI_DeletePersistentUserData - -# ---------------------------------------------------------------------- -# -# LocalStoreImpl -# - - -__builtin_new -__builtin_vec_new -nsSupportsArray::GrowArrayBy(int) -nsSupportsArray::InsertElementAt(nsISupports *, unsigned int) -nsSupportsArray::AppendElement(nsISupports *) -LocalStoreImpl::AddObserver(nsIRDFObserver *) - -# ---------------------------------------------------------------------- -# -# NSS -# - - -PR_Malloc -PL_ArenaAllocate -PORT_ArenaAlloc - - -PR_Malloc -PL_ArenaAllocate -nss_ZAlloc diff --git a/mozilla/tools/trace-malloc/uncategorized.pl b/mozilla/tools/trace-malloc/uncategorized.pl deleted file mode 100755 index b9af81f7b62..00000000000 --- a/mozilla/tools/trace-malloc/uncategorized.pl +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/perl -w -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is uncategorized.pl, released -# Nov 27, 2000. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2000 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Chris Waterson -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -# This tool is used to construct the ``type inference'' file. It -# prints the total number of bytes that are attributed to a type that -# cannot be inferred, grouped by stack trace; e.g., -# -# (100) PR_Malloc -# (50) foo -# (50) foo2::foo2 -# (25) bar -# (25) baz -# (50) __builtin_new -# (50) foo2::foo2 -# -# -# Which indicates that 100 bytes were allocated by uninferrable -# classes via PR_Malloc(). Of that 100 bytes, 50 were allocated from -# calls by foo(), 25 from calls by bar(), and 25 from calls by baz(). -# 50 bytes were allocated by __builtin_new from foo2's ctor. -# -# -# From this, we might be able to infer the type of the object that was -# created by examining the PR_Malloc() usage in foo() and the -# ::operator new() usage in foo2(), and could add new type inference -# rules; e.g., -# -# -# foo -# foo2 -# -# # Attribute ::operator new() usage in foo2's ctor to foo2 -# -# __builtin_new -# foo2::foo2 - -use 5.004; -use strict; -use Getopt::Long; - -# So we can find TraceMalloc.pm -use FindBin; -use lib "$FindBin::Bin"; - -use TraceMalloc; - -# Collect program options -$::opt_help = 0; -$::opt_depth = 10; -$::opt_types = "${FindBin::Bin}/types.dat"; -GetOptions("help", "depth=n", "types=s"); - -if ($::opt_help) { - die "usage: uncategorized.pl [options] - --help Display this message - --depth= Display at most stack frames - --types= Read type heuristics from "; -} - -# Initialize type inference juju from the type file specified by -# ``--types''. -TraceMalloc::init_type_inference($::opt_types); - -# Read the objects from the dump file. For each object, remember up to -# ``--depth'' stack frames (from the top). Thread together common -# stack prefixes, accumulating the number of bytes attributed to the -# prefix. - -# This'll hold the inverted stacks -$::Stacks = { '#bytes#' => 0 }; - -sub collect_stacks($) { - my ($object) = @_; - my $stack = $object->{'stack'}; - - return unless ($object->{'type'} eq 'void*') && (TraceMalloc::infer_type($stack) eq 'void*'); - - my $count = 0; - my $link = \%::Stacks; - FRAME: foreach my $frame (@$stack) { - last FRAME unless $count++ < $::opt_depth; - - $link->{'#bytes#'} += $object->{'size'}; - $link->{$frame} = { '#bytes#' => 0 } unless $link->{$frame}; - $link = $link->{$frame}; - } -} - -TraceMalloc::read(\&collect_stacks); - -# Do a depth-first walk of the inverted stack tree. - -sub walk($$) { - my ($links, $indent) = @_; - - my @keys; - KEY: foreach my $key (keys %$links) { - next KEY if $key eq '#bytes#'; - $keys[$#keys + 1] = $key; - } - - foreach my $key (sort { $links->{$b}->{'#bytes#'} <=> $links->{$a}->{'#bytes#'} } @keys) { - for (my $i = 0; $i < $indent; ++$i) { - print " "; - } - - print "($links->{$key}->{'#bytes#'}) $key\n"; - - walk($links->{$key}, $indent + 1); - } -} - -walk(\%::Stacks, 0); - diff --git a/mozilla/tools/update-packaging/Makefile.in b/mozilla/tools/update-packaging/Makefile.in deleted file mode 100644 index 0286be7e7ad..00000000000 --- a/mozilla/tools/update-packaging/Makefile.in +++ /dev/null @@ -1,61 +0,0 @@ -# vim:set ts=8 sw=8 sts=8 noet: -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is Google Inc. -# Portions created by the Initial Developer are Copyright (C) 2005 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Darin Fisher -# -# Alternatively, the contents of this file may be used under the terms of -# either of the GNU General Public License Version 2 or later (the "GPL"), -# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk - -# Default output location for update archive -STAGE_DIR = $(DIST)/update - -ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) -PACKAGE_DIR = $(DIST)/$(MOZ_PKG_APPNAME)/$(MOZ_APP_DISPLAYNAME).app -else -PACKAGE_DIR = $(DIST)/$(MOZ_PKG_APPNAME) -endif - -full-update:: - mkdir -p $(STAGE_DIR) - MAR=$(DIST)/host/bin/mar $(srcdir)/make_full_update.sh "$(STAGE_DIR)/$(PKG_BASENAME).mar" "$(PACKAGE_DIR)" - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/tools/update-packaging/README b/mozilla/tools/update-packaging/README deleted file mode 100644 index 7029ffb8e5e..00000000000 --- a/mozilla/tools/update-packaging/README +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains a tool for generating update packages for -the update system described here: - - http://wiki.mozilla.org/Software_Update diff --git a/mozilla/tools/update-packaging/common.sh b/mozilla/tools/update-packaging/common.sh deleted file mode 100755 index 2d93e760411..00000000000 --- a/mozilla/tools/update-packaging/common.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash -# -# Code shared by update packaging scripts. -# Author: Darin Fisher -# - -# ----------------------------------------------------------------------------- -# By default just assume that these tools exist on our path -MAR=${MAR:-mar} -BZIP2=${BZIP2:-bzip2} -MBSDIFF=${MBSDIFF:-mbsdiff} - -# ----------------------------------------------------------------------------- -# Helper routines - -notice() { - echo $* 1>&2 -} - -get_file_size() { - info=($(ls -l "$1")) - echo ${info[4]} -} - -copy_perm() { - reference="$1" - target="$2" - - if [ -x "$reference" ]; then - chmod 0755 "$target" - else - chmod 0644 "$target" - fi -} - -make_add_instruction() { - f="$1" - is_extension=$(echo "$f" | grep -c 'extensions/.*/') - if [ $is_extension = "1" ]; then - # Use the subdirectory of the extensions folder as the file to test - # before performing this add instruction. - testdir=$(echo "$f" | sed 's/\(extensions\/[^\/]*\)\/.*/\1/') - echo "add-if \"$testdir\" \"$f\"" - else - echo "add \"$f\"" - fi -} - -make_patch_instruction() { - f="$1" - is_extension=$(echo "$f" | grep -c 'extensions/.*/') - if [ $is_extension = "1" ]; then - # Use the subdirectory of the extensions folder as the file to test - # before performing this add instruction. - testdir=$(echo "$f" | sed 's/\(extensions\/[^\/]*\)\/.*/\1/') - echo "patch-if \"$testdir\" \"$f.patch\" \"$f\"" - else - echo "patch \"$f.patch\" \"$f\"" - fi -} - -append_remove_instructions() { - dir="$1" - if [ -f "$dir/removed-files" ]; then - prefix= - listfile="$dir/removed-files" - elif [ -f "$dir/Contents/MacOS/removed-files" ]; then - prefix=Contents/MacOS/ - listfile="$dir/Contents/MacOS/removed-files" - fi - if [ -n "$listfile" ]; then - # Map spaces to pipes so that we correctly handle filenames with spaces. - files=($(cat "$listfile" | tr " " "|")) - num_files=${#files[*]} - for ((i=0; $i<$num_files; i=$i+1)); do - # Trim whitespace (including trailing carriage returns) - f=$(echo ${files[$i]} | tr "|" " " | sed 's/^ *\(.*\) *$/\1/' | tr -d '\r') - # Exclude any blank lines or any lines ending with a slash, which indicate - # directories. The updater doesn't know how to remove entire directories. - if [ -n "$f" ]; then - if [ $(echo "$f" | grep -c '\/$') = 0 ]; then - echo "remove \"$prefix$f\"" - else - notice "ignoring remove instruction for directory: $f" - fi - fi - done - fi -} - -# List all files in the current directory, stripping leading "./" -# Skip the channel-prefs.js file as it should not be included in any -# generated MAR files (see bug 306077). -list_files() { - find . -type f \ - ! -name "channel-prefs.js" \ - ! -name "update.manifest" \ - | sed 's/\.\/\(.*\)/"\1"/' -} diff --git a/mozilla/tools/update-packaging/make_full_update.sh b/mozilla/tools/update-packaging/make_full_update.sh deleted file mode 100755 index afc9774c2ed..00000000000 --- a/mozilla/tools/update-packaging/make_full_update.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -# -# This tool generates full update packages for the update system. -# Author: Darin Fisher -# - -. $(dirname "$0")/common.sh - -# ----------------------------------------------------------------------------- - -print_usage() { - notice "Usage: $(basename $0) [OPTIONS] ARCHIVE DIRECTORY" -} - -if [ $# = 0 ]; then - print_usage - exit 1 -fi - -if [ $1 = -h ]; then - print_usage - notice "" - notice "The contents of DIRECTORY will be stored in ARCHIVE." - notice "" - notice "Options:" - notice " -h show this help text" - notice "" - exit 1 -fi - -# ----------------------------------------------------------------------------- - -archive="$1" -targetdir="$2" -workdir="$targetdir.work" -manifest="$workdir/update.manifest" -targetfiles="update.manifest" - -# Generate a list of all files in the target directory. -list=$(cd "$targetdir" && list_files) -eval "files=($list)" - -mkdir -p "$workdir" -> $manifest - -num_files=${#files[*]} - -for ((i=0; $i<$num_files; i=$i+1)); do - f=${files[$i]} - - notice "processing $f" - - make_add_instruction "$f" >> $manifest - - dir=$(dirname "$f") - mkdir -p "$workdir/$dir" - $BZIP2 -cz9 "$targetdir/$f" > "$workdir/$f" - copy_perm "$targetdir/$f" "$workdir/$f" - - targetfiles="$targetfiles \"$f\"" -done - -# Append remove instructions for any dead files. -append_remove_instructions "$targetdir" >> $manifest - -$BZIP2 -z9 "$manifest" && mv -f "$manifest.bz2" "$manifest" - -eval "$MAR -C \"$workdir\" -c output.mar $targetfiles" -mv -f "$workdir/output.mar" "$archive" - -# cleanup -rm -fr "$workdir" diff --git a/mozilla/tools/update-packaging/make_incremental_update.sh b/mozilla/tools/update-packaging/make_incremental_update.sh deleted file mode 100755 index b84b9dbdf31..00000000000 --- a/mozilla/tools/update-packaging/make_incremental_update.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/bash -# -# This tool generates incremental update packages for the update system. -# Author: Darin Fisher -# - -. $(dirname "$0")/common.sh - -# ----------------------------------------------------------------------------- - -print_usage() { - notice "Usage: $(basename $0) [OPTIONS] ARCHIVE FROMDIR TODIR" -} - -if [ $# = 0 ]; then - print_usage - exit 1 -fi - -if [ $1 = -h ]; then - print_usage - notice "" - notice "The differences between FROMDIR and TODIR will be stored in ARCHIVE." - notice "" - notice "Options:" - notice " -h show this help text" - notice "" - exit 1 -fi - -# ----------------------------------------------------------------------------- - -archive="$1" -olddir="$2" -newdir="$3" -workdir="$newdir.work" -manifest="$workdir/update.manifest" -archivefiles="update.manifest" - -# Generate a list of all files in the target directory. -list=$(cd "$olddir" && list_files) -eval "oldfiles=($list)" -list=$(cd "$newdir" && list_files) -eval "newfiles=($list)" - -mkdir -p "$workdir" -> $manifest - -num_oldfiles=${#oldfiles[*]} - -for ((i=0; $i<$num_oldfiles; i=$i+1)); do - f=${oldfiles[$i]} - # If this file exists in the new directory as well, then check if it differs. - if [ -f "$newdir/$f" ]; then - if ! diff "$olddir/$f" "$newdir/$f" > /dev/null; then - # Compute both the compressed binary diff and the compressed file, and - # compare the sizes. Then choose the smaller of the two to package. - echo " diffing $f" - dir=$(dirname "$workdir/$f") - mkdir -p "$dir" - $MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch" - $BZIP2 -z9 "$workdir/$f.patch" - $BZIP2 -cz9 "$newdir/$f" > "$workdir/$f" - patchfile="$workdir/$f.patch.bz2" - patchsize=$(get_file_size "$patchfile") - fullsize=$(get_file_size "$workdir/$f") - if [ $patchsize -lt $fullsize -a "$f" != "removed-files" ]; then - make_patch_instruction "$f" >> $manifest - mv -f "$patchfile" "$workdir/$f.patch" - rm -f "$workdir/$f" - archivefiles="$archivefiles \"$f.patch\"" - else - make_add_instruction "$f" >> $manifest - rm -f "$patchfile" - archivefiles="$archivefiles \"$f\"" - fi - fi - else - echo "remove \"$f\"" >> $manifest - fi -done - -# Now, we just need to worry about newly added files -num_newfiles=${#newfiles[*]} - -for ((i=0; $i<$num_newfiles; i=$i+1)); do - f="${newfiles[$i]}" - - # If we've already tested this file, then skip it - for ((j=0; $j<$num_oldfiles; j=$j+1)); do - if [ "$f" = "${oldfiles[j]}" ]; then - continue 2 - fi - done - - dir=$(dirname "$workdir/$f") - mkdir -p "$dir" - - $BZIP2 -cz9 "$newdir/$f" > "$workdir/$f" - - make_add_instruction "$f" >> "$manifest" - archivefiles="$archivefiles \"$f\"" -done - -# Append remove instructions for any dead files. -append_remove_instructions "$newdir" >> $manifest - -$BZIP2 -z9 "$manifest" && mv -f "$manifest.bz2" "$manifest" - -eval "$MAR -C \"$workdir\" -c output.mar $archivefiles" -mv -f "$workdir/output.mar" "$archive" - -# cleanup -rm -fr "$workdir" diff --git a/mozilla/xulrunner/Makefile.in b/mozilla/xulrunner/Makefile.in deleted file mode 100644 index a3505f102ee..00000000000 --- a/mozilla/xulrunner/Makefile.in +++ /dev/null @@ -1,60 +0,0 @@ -# vim:set ts=8 sw=8 sts=8 et: -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the Mozilla Browser code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 2002 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Brian Ryner -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = .. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -DIRS = \ - setup \ - stub \ - util \ - app \ - examples \ - $(NULL) - -ifeq ($(OS_ARCH),WINNT) -ifdef MOZ_INSTALLER -DIRS += installer/windows -endif -endif - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xulrunner/app/Makefile.in b/mozilla/xulrunner/app/Makefile.in deleted file mode 100644 index 39c3d256a00..00000000000 --- a/mozilla/xulrunner/app/Makefile.in +++ /dev/null @@ -1,335 +0,0 @@ -# vim:set ts=8 sw=8 sts=8 et: -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications. -# Portions created by the Initial Developer are Copyright (C) 2001 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Brian Ryner -# Jonathan Wilson -# Dan Mosedale -# Darin Fisher -# Benjamin Smedberg -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MOZILLA_INTERNAL_API = 1 - -DIRS = profile - -PREF_JS_EXPORTS = $(srcdir)/xulrunner.js -GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/,xulrunner.js) - -DEFINES += -DAB_CD=$(AB_CD) - -ifeq ($(USE_SHORT_LIBNAME), 1) -PROGRAM = xulrunner$(BIN_SUFFIX) -else -PROGRAM = xulrunner-bin$(BIN_SUFFIX) -endif -DEFINES += -DXULRUNNER_PROGNAME=\"xulrunner\" - -ifdef MOZ_JAVAXPCOM -DEFINES += -DMOZ_JAVAXPCOM -endif - -REQUIRES = \ - xpcom \ - string \ - appshell \ - xulapp \ - xulrunner \ - $(NULL) - -CPPSRCS = nsXULRunnerApp.cpp - -ifeq ($(OS_ARCH),WINNT) -CPPSRCS += nsRegisterGREWin.cpp -else -ifneq (,$(filter OS2 Darwin,$(OS_ARCH))) -CPPSRCS += nsRegisterGREVoid.cpp -else -CPPSRCS += nsRegisterGREUnix.cpp -endif -endif - -LOCAL_INCLUDES += \ - -I$(topsrcdir)/toolkit/xre \ - -I$(topsrcdir)/toolkit/profile/src \ - $(NULL) - -ifdef BUILD_STATIC_LIBS -STATIC_COMPONENTS_LINKER_PATH = -L$(DIST)/lib/components -endif - -ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) -TK_LIBS := -framework Cocoa $(TK_LIBS) -endif - -LIBS = \ - $(STATIC_COMPONENTS_LINKER_PATH) \ - $(EXTRA_DSO_LIBS) \ - $(MOZ_JS_LIBS) \ - $(XPCOM_LIBS) \ - $(NSPR_LIBS) \ - $(TK_LIBS) \ - $(NULL) - -ifndef MOZ_ENABLE_LIBXUL -LIBS += $(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) -endif - -# Add explicit X11 dependency when building against X11 toolkits -ifneq (,$(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT))) -LIBS += $(XLDFLAGS) $(XLIBS) -endif - -ifdef MOZ_JPROF -LIBS += -ljprof -endif - -ifndef MOZ_WINCONSOLE -ifdef MOZ_DEBUG -MOZ_WINCONSOLE = 1 -else -MOZ_WINCONSOLE = 0 -endif -endif -DEFINES += -DMOZ_WINCONSOLE=$(MOZ_WINCONSOLE) - -NSDISTMODE = copy - -include $(topsrcdir)/config/config.mk -ifndef BUILD_STATIC_LIBS - -ifdef NS_TRACE_MALLOC -EXTRA_DSO_LIBS += tracemalloc -endif - -else -include $(topsrcdir)/config/static-config.mk - -EXTRA_DEPS += \ - $(STATIC_EXTRA_DEPS) \ - $(NULL) -DEFINES += $(STATIC_DEFINES) -CPPSRCS += $(STATIC_CPPSRCS) -EXTRA_DSO_LIBS += $(STATIC_EXTRA_DSO_LIBS) -REQUIRES += $(STATIC_REQUIRES) -EXTRA_LIBS += $(STATIC_EXTRA_LIBS) -endif - -ifeq ($(OS_ARCH),WINNT) -OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool gdi32) -RCINCLUDE = splash.rc -ifndef GNU_CC -RCFLAGS += -DMOZ_XULRUNNER -I$(srcdir) -else -RCFLAGS += -DMOZ_XULRUNNER --include-dir $(srcdir) -endif -ifdef BUILD_STATIC_LIBS -RCFLAGS += -DMOZ_STATIC_BUILD -endif -ifdef DEBUG -RCFLAGS += -DDEBUG -endif -endif - -ifeq ($(OS_ARCH),BeOS) -OS_LIBS += -ltracker -endif - -ifeq ($(OS_ARCH),OS2) -RESFILE=splashos2.res -RCFLAGS += -DMOZ_XULRUNNER -ifdef BUILD_STATIC_LIBS -EXE_DEF_FILE = xulrunner.def -RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include/widget -endif -ifdef DEBUG -RCFLAGS += -DDEBUG -endif -RCFLAGS += -DXULRUNNER_ICO=\"$(DIST)/branding/xulrunner.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\" -endif - -include $(topsrcdir)/config/rules.mk - -DEFINES += -DXULRUNNER_ICO=\"$(DIST)/branding/xulrunner.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\" - -ifdef BUILD_STATIC_LIBS -include $(topsrcdir)/config/static-rules.mk -endif - -ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) -ifdef BUILD_STATIC_LIBS -LIBS += -framework QuickTime -framework IOKit -ifdef USE_PREBINDING -BIN_FLAGS += -Wl,-headerpad -Wl,5a0c -endif -endif -endif - -ifeq ($(MOZ_WIDGET_TOOLKIT),photon) -LIBS += -lphexlib -endif - -ifeq ($(OS_ARCH),WINNT) -# -# Control the default heap size. -# This is the heap returned by GetProcessHeap(). -# As we use the CRT heap, the default size is too large and wastes VM. -# -# The default heap size is 1MB on Win32. -# The heap will grow if need be. -# -# Set it to 256k. See bug 127069. -# -ifndef GNU_CC -LDFLAGS += /HEAP:0x40000 -endif -endif - -ifeq ($(OS_ARCH),OS2) -ifdef BUILD_STATIC_LIBS -$(EXE_DEF_FILE): - rm -f $@ - @echo NAME mozilla >$(EXE_DEF_FILE) - @echo IMPORTS >>$(EXE_DEF_FILE) - @echo WinQueryProperty = PMMERGE.5450 >>$(EXE_DEF_FILE) - @echo WinRemoveProperty = PMMERGE.5451 >>$(EXE_DEF_FILE) - @echo WinSetProperty = PMMERGE.5452 >>$(EXE_DEF_FILE) - -LDFLAGS += -Zlinker /NOE -endif -endif - -ifneq (,$(filter-out OS2 WINNT Darwin,$(OS_ARCH))) - -xulrunner:: mozilla.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk - cat $< | sed -e "s|%MOZAPPDIR%|$(mozappdir)|" \ - -e "s|%MOZ_USER_DIR%|.mozilla/xulrunner|" \ - -e "s|%MREDIR%|$(mredir)|" > $@ - chmod +x $@ - -libs:: xulrunner - $(INSTALL) $< $(DIST)/bin - -install:: xulrunner - $(SYSINSTALL) $< $(DESTDIR)$(bindir) - -GARBAGE += xulrunner -endif - -ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT))) - -ICON_FILES = \ - $(DIST)/branding/mozicon50.xpm \ - $(DIST)/branding/mozicon16.xpm \ - $(DIST)/branding/document.png \ - $(NULL) - -libs:: $(ICON_FILES) - $(INSTALL) $^ $(DIST)/bin/icons - -install:: - $(SYSINSTALL) $(IFLAGS1) $(ICON_FILES) $(DESTDIR)$(mozappdir)/icons -endif - -ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) -libs:: - $(INSTALL) $(DIST)/branding/default.xpm $(DIST)/bin/chrome/icons/default - -install:: - $(SYSINSTALL) $(IFLAGS1) $(DIST)/branding/default.xpm $(DESTDIR)$(mozappdir)/icons -endif - -# XXX applications would need to supply this file -#export:: brand.dtd.in -# $(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $^ > brand.dtd - -export:: - $(NSINSTALL) -D $(DIST)/branding -ifeq ($(OS_ARCH),WINNT) - cp $(srcdir)/xulrunner.ico $(DIST)/branding/xulrunner.ico - cp $(srcdir)/xulrunner.ico $(DIST)/branding/app.ico - cp $(srcdir)/document.ico $(DIST)/branding/document.ico -endif -ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT))) - cp $(srcdir)/mozicon16.xpm $(DIST)/branding/mozicon16.xpm - cp $(srcdir)/mozicon50.xpm $(DIST)/branding/mozicon50.xpm - cp $(srcdir)/document.png $(DIST)/branding/document.png -endif -ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) - cp $(srcdir)/default.xpm $(DIST)/branding/default.xpm -endif -ifeq ($(OS_ARCH),OS2) - cp $(srcdir)/xulrunner-os2.ico $(DIST)/branding/xulrunner.ico - cp $(srcdir)/xulrunner-os2.ico $(DIST)/branding/app.ico - cp $(srcdir)/document-os2.ico $(DIST)/branding/document.ico -endif - -libs:: - touch $(DIST)/bin/.autoreg - -ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) - -FRAMEWORK_NAME = XUL -FRAMEWORK_VERSION = $(MOZILLA_VERSION) - -libs:: $(PROGRAM) - mkdir -p $(DIST)/$(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)/Resources - $(NSINSTALL) $(srcdir)/macbuild/InfoPlist.strings $(DIST)/$(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)/Resources - sed -e "s/APP_VERSION/$(APP_VERSION)/" $(srcdir)/macbuild/Info.plist.in > $(DIST)/$(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)/Info.plist - rsync -a $(DIST)/bin/ $(DIST)/$(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION) --exclude mangle --exclude shlibsign - rm -f $(DIST)/$(FRAMEWORK_NAME).framework/Versions/Current \ - $(DIST)/$(FRAMEWORK_NAME).framework/libxpcom.dylib \ - $(DIST)/$(FRAMEWORK_NAME).framework/XUL \ - $(DIST)/$(FRAMEWORK_NAME).framework/xulrunner-bin - ln -s $(FRAMEWORK_VERSION) $(DIST)/$(FRAMEWORK_NAME).framework/Versions/Current - ln -s Versions/Current/libxpcom.dylib $(DIST)/$(FRAMEWORK_NAME).framework/libxpcom.dylib - ln -s Versions/Current/XUL $(DIST)/$(FRAMEWORK_NAME).framework/XUL - ln -s Versions/Current/xulrunner-bin $(DIST)/$(FRAMEWORK_NAME).framework/xulrunner-bin - -clean clobber:: - rm -rf $(DIST)/$(FRAMEWORK_NAME).framework -endif - -README_FILE = $(topsrcdir)/README.txt - -libs:: - $(INSTALL) $(README_FILE) $(DIST)/bin - $(INSTALL) $(topsrcdir)/LICENSE $(DIST)/bin diff --git a/mozilla/xulrunner/app/default.xpm b/mozilla/xulrunner/app/default.xpm deleted file mode 100644 index d240015018d..00000000000 --- a/mozilla/xulrunner/app/default.xpm +++ /dev/null @@ -1,1144 +0,0 @@ -/* XPM */ -static char * mozicon50_xpm[] = { -"48 48 1093 2", -" c None", -". c #2099CF", -"+ c #2CA7D9", -"@ c #33AEDD", -"# c #34B2E1", -"$ c #35B8E5", -"% c #2FBAE8", -"& c #26B5E4", -"* c #199FD6", -"= c #177DB8", -"- c #2C8FC4", -"; c #43A0CE", -"> c #55ADD6", -", c #5CB5DD", -"' c #61C4E8", -") c #63CBED", -"! c #64CFF1", -"~ c #63D1F2", -"{ c #5ECCEF", -"] c #57C3E9", -"^ c #4EB8E1", -"/ c #3CABD9", -"( c #2A9ED1", -"_ c #1991C9", -": c #0F7CBA", -"< c #166EAC", -"[ c #3387BC", -"} c #4797C6", -"| c #51A0CC", -"1 c #56A7D2", -"2 c #5BAED7", -"3 c #60B6DD", -"4 c #67CDEE", -"5 c #69D3F2", -"6 c #6BD4F4", -"7 c #69D3F4", -"8 c #63CDEF", -"9 c #5AC0E6", -"0 c #51B6DF", -"a c #49ACD8", -"b c #42A2D1", -"c c #3898CA", -"d c #298CC2", -"e c #167EB9", -"f c #0B5A9C", -"g c #2674AE", -"h c #3D87BA", -"i c #4590C0", -"j c #4B97C6", -"k c #519FCB", -"l c #58A6D1", -"m c #5DADD5", -"n c #62B3DA", -"o c #69C3E6", -"p c #6ED4F2", -"q c #6FD6F4", -"r c #6ED5F4", -"s c #6AD3F2", -"t c #5FC3E7", -"u c #53B2DC", -"v c #4BA8D5", -"w c #439FCE", -"x c #3B95C7", -"y c #338BC0", -"z c #2B82B9", -"A c #1D76B1", -"B c #0C69A9", -"C c #10599A", -"D c #2D71AA", -"E c #377CB2", -"F c #3D84B8", -"G c #458DBE", -"H c #4B95C4", -"I c #529CC9", -"J c #59A4CF", -"K c #5FABD4", -"L c #65B1D8", -"M c #6BC2E4", -"N c #71D5F3", -"O c #73D6F3", -"P c #72D5F3", -"Q c #6DD1F0", -"R c #5FBBE2", -"S c #54ADD8", -"T c #4CA4D2", -"U c #439ACB", -"V c #3B91C4", -"W c #3487BD", -"X c #2D7EB7", -"Y c #2675AF", -"Z c #1E6CA9", -"` c #0F5FA0", -" . c #055296", -".. c #115394", -"+. c #2767A2", -"@. c #2F70A9", -"#. c #3679AF", -"$. c #3C81B5", -"%. c #448ABC", -"&. c #4A92C2", -"*. c #519AC7", -"=. c #58A2CD", -"-. c #5FA9D2", -";. c #65B0D7", -">. c #6EC8E9", -",. c #74D4F2", -"'. c #76D6F3", -"). c #75D6F3", -"!. c #71D3F1", -"~. c #62BCE1", -"{. c #54A9D5", -"]. c #4C9FCE", -"^. c #4396C8", -"/. c #3B8CC1", -"(. c #3483BA", -"_. c #2C7AB3", -":. c #2670AC", -"<. c #1F68A6", -"[. c #195F9F", -"}. c #0D5497", -"|. c #04488D", -"1. c #0F4A8D", -"2. c #1F5A98", -"3. c #2663A0", -"4. c #2D6DA6", -"5. c #3475AD", -"6. c #3B7EB3", -"7. c #4287B9", -"8. c #4990C1", -"9. c #51A4CF", -"0. c #569FCA", -"a. c #5DA6CF", -"b. c #66B5DB", -"c. c #6FD1F0", -"d. c #75D4F1", -"e. c #79D5F2", -"f. c #75D3F1", -"g. c #63BBE0", -"h. c #54A4D1", -"i. c #4B9BCB", -"j. c #4391C4", -"k. c #3B88BD", -"l. c #337FB6", -"m. c #2C76B0", -"n. c #266CA9", -"o. c #1F64A3", -"p. c #1A5B9C", -"q. c #145396", -"r. c #0A498E", -"s. c #034C8F", -"t. c #085293", -"u. c #164D8E", -"v. c #1D5695", -"w. c #24609C", -"x. c #2A69A3", -"y. c #3271AA", -"z. c #387AAF", -"A. c #429FCC", -"B. c #4CBFE4", -"C. c #52C4E8", -"D. c #57AFD7", -"E. c #5DB3DA", -"F. c #65C5E7", -"G. c #6DD0EE", -"H. c #72D2EF", -"I. c #78D4F0", -"J. c #7BD5F1", -"K. c #76D2EF", -"L. c #6AC5E6", -"M. c #55A5D1", -"N. c #4A95C6", -"O. c #428CC0", -"P. c #3A83B9", -"Q. c #337AB3", -"R. c #2C71AD", -"S. c #2568A6", -"T. c #1F5F9F", -"U. c #1D65A3", -"V. c #269ACA", -"W. c #1C84BA", -"X. c #0D7DB5", -"Y. c #0298CC", -"Z. c #0296CA", -"`. c #0C5998", -" + c #14498A", -".+ c #1B609C", -"++ c #2498C8", -"@+ c #2977AF", -"#+ c #2F75AC", -"$+ c #3575AC", -"%+ c #40ABD5", -"&+ c #49BFE4", -"*+ c #50C3E7", -"=+ c #56C5E8", -"-+ c #5DC8EA", -";+ c #63CBEB", -">+ c #69CEED", -",+ c #6ED0EE", -"'+ c #73D2EF", -")+ c #77D3EF", -"!+ c #72CEEC", -"~+ c #5AA7D1", -"{+ c #4F99C9", -"]+ c #4891C3", -"^+ c #4087BC", -"/+ c #387EB5", -"(+ c #3277B1", -"_+ c #2B70AB", -":+ c #2463A2", -"<+ c #1E5B9C", -"[+ c #185395", -"}+ c #165496", -"|+ c #10498D", -"1+ c #105F9E", -"2+ c #0A9ECF", -"3+ c #0088C0", -"4+ c #038DC3", -"5+ c #0A4A8C", -"6+ c #114E8E", -"7+ c #1989BD", -"8+ c #22AAD7", -"9+ c #28A2D0", -"0+ c #2C71A9", -"a+ c #3380B5", -"b+ c #3EB9E1", -"c+ c #45BDE3", -"d+ c #4CC0E5", -"e+ c #53C3E7", -"f+ c #59C6E8", -"g+ c #5EC9EA", -"h+ c #64CBEB", -"i+ c #69CDEC", -"j+ c #6ECFED", -"k+ c #70D0ED", -"l+ c #64BDE1", -"m+ c #55A6D1", -"n+ c #3D82B8", -"o+ c #3D8BBE", -"p+ c #49AFD8", -"q+ c #378DBF", -"r+ c #225F9E", -"s+ c #1D5698", -"t+ c #174E92", -"u+ c #12468B", -"v+ c #0E3F85", -"w+ c #115F9D", -"x+ c #15A2D1", -"y+ c #0395C9", -"z+ c #0088C1", -"A+ c #0190C6", -"B+ c #079ACC", -"C+ c #0FA0D0", -"D+ c #169ECF", -"E+ c #1D99CC", -"F+ c #25AAD7", -"G+ c #2BA0CE", -"H+ c #32AED8", -"I+ c #3AB7DF", -"J+ c #41BBE1", -"K+ c #47BEE3", -"L+ c #4EC1E5", -"M+ c #53C4E7", -"N+ c #5FC8E9", -"O+ c #63CAEA", -"P+ c #67CBEB", -"Q+ c #69CBEA", -"R+ c #62BCE0", -"S+ c #5AAFD7", -"T+ c #478DBF", -"U+ c #4084B9", -"V+ c #3A7CB4", -"W+ c #3E8CBF", -"X+ c #4DBADF", -"Y+ c #3383B8", -"Z+ c #215B9B", -"`+ c #1B5295", -" @ c #164A8E", -".@ c #114288", -"+@ c #0D3A82", -"@@ c #0E4C8E", -"#@ c #1380B7", -"$@ c #0D96C9", -"%@ c #0089C1", -"&@ c #007BB8", -"*@ c #0085BE", -"=@ c #008CC4", -"-@ c #0496C9", -";@ c #0B9DCF", -">@ c #1168AB", -",@ c #174F99", -"'@ c #21AAD7", -")@ c #28AED9", -"!@ c #2FB1DB", -"~@ c #36B5DE", -"{@ c #3CB8E0", -"]@ c #42BBE2", -"^@ c #49BEE4", -"/@ c #54C3E6", -"(@ c #59C5E7", -"_@ c #5DC7E8", -":@ c #5FC5E7", -"<@ c #53A9D3", -"[@ c #4B96C6", -"}@ c #478FC2", -"|@ c #4186BB", -"1@ c #3C7FB5", -"2@ c #3676AF", -"3@ c #306EA9", -"4@ c #3889BD", -"5@ c #44AFD8", -"6@ c #2F84B9", -"7@ c #194D91", -"8@ c #15458A", -"9@ c #144D90", -"0@ c #0C367E", -"a@ c #0C4086", -"b@ c #1797C8", -"c@ c #1295C8", -"d@ c #0487C0", -"e@ c #0079B6", -"f@ c #0081BC", -"g@ c #0E9ACC", -"h@ c #1597CA", -"i@ c #1CA7D5", -"j@ c #23ABD8", -"k@ c #2AAFDA", -"l@ c #31B2DC", -"m@ c #37B5DE", -"n@ c #3DB8E0", -"o@ c #43BBE2", -"p@ c #49BEE3", -"q@ c #4EC0E4", -"r@ c #53C2E5", -"s@ c #57C4E6", -"t@ c #4EAAD4", -"u@ c #4696C5", -"v@ c #438FC0", -"w@ c #4088BC", -"x@ c #3C80B6", -"y@ c #3778B1", -"z@ c #3270AB", -"A@ c #2C68A5", -"B@ c #3D9AC8", -"C@ c #46BADF", -"D@ c #3DB0D8", -"E@ c #287CB2", -"F@ c #164D90", -"G@ c #299ECC", -"H@ c #1B79B0", -"I@ c #1A8CBF", -"J@ c #199BCC", -"K@ c #1392C6", -"L@ c #0A86BE", -"M@ c #0079B7", -"N@ c #006AAC", -"O@ c #0074B3", -"P@ c #007CB9", -"Q@ c #0083BE", -"R@ c #008BC2", -"S@ c #0393C8", -"T@ c #099CCD", -"U@ c #10A1D1", -"V@ c #17A4D3", -"W@ c #1EA8D6", -"X@ c #25ABD8", -"Y@ c #2BAFDA", -"Z@ c #37B5DD", -"`@ c #3DB8DF", -" # c #42BAE1", -".# c #48BCE2", -"+# c #4CBEE3", -"@# c #50C0E4", -"## c #48A8D3", -"$# c #3F8EC0", -"%# c #3C87BC", -"&# c #3A81B7", -"*# c #3679B1", -"=# c #3171AC", -"-# c #2D6AA6", -";# c #2862A0", -"># c #40A5D1", -",# c #43B8DE", -"'# c #3DB5DC", -")# c #38B1DA", -"!# c #2D9ECC", -"~# c #2B9FCE", -"{# c #246AAA", -"]# c #1F96C7", -"^# c #1996C9", -"/# c #138DC3", -"(# c #0E84BC", -"_# c #0175B4", -":# c #0068AC", -"<# c #0070B1", -"[# c #0077B5", -"}# c #007FBA", -"|# c #0086BF", -"1# c #018DC4", -"2# c #0596C9", -"3# c #0B9DCE", -"4# c #12A1D1", -"5# c #1897C8", -"6# c #1E96C7", -"7# c #25A0CE", -"8# c #2B90C2", -"9# c #31A4D0", -"0# c #37B4DD", -"a# c #3CB7DF", -"b# c #41B9E0", -"c# c #45BBE0", -"d# c #49BCE1", -"e# c #4BBBE0", -"f# c #419FCC", -"g# c #3C91C2", -"h# c #337AB1", -"i# c #3072AC", -"j# c #2C6BA7", -"k# c #2864A1", -"l# c #255F9E", -"m# c #3FAAD4", -"n# c #40B6DC", -"o# c #3AB3DB", -"p# c #35B0D8", -"q# c #2F86BD", -"r# c #29599F", -"s# c #237DB7", -"t# c #1E99CA", -"u# c #1892C5", -"v# c #1389C0", -"w# c #0E7FBA", -"x# c #0473B2", -"y# c #0065AA", -"z# c #0064A9", -"A# c #006BAD", -"B# c #0072B2", -"C# c #0080BC", -"D# c #0082BC", -"E# c #028DC4", -"F# c #0796C9", -"G# c #0D88BD", -"H# c #1372AB", -"I# c #1982B8", -"J# c #1F79B0", -"K# c #247BB1", -"L# c #2A86B9", -"M# c #31B1DA", -"N# c #36B3DC", -"O# c #3AB5DD", -"P# c #3FB7DE", -"Q# c #42B9DF", -"R# c #45BAE0", -"S# c #48BBE0", -"T# c #47B6DD", -"U# c #3689BC", -"V# c #2D72AB", -"W# c #2C73AC", -"X# c #2F7DB3", -"Y# c #399BC9", -"Z# c #3FB4DB", -"`# c #3CB3DA", -" $ c #37B0D9", -".$ c #32AED7", -"+$ c #2CA8D3", -"@$ c #277EB8", -"#$ c #229CCC", -"$$ c #1D95C8", -"%$ c #188DC2", -"&$ c #1384BD", -"*$ c #0D7AB6", -"=$ c #066FB0", -"-$ c #0057A0", -";$ c #005FA5", -">$ c #0066AA", -",$ c #006DAF", -"'$ c #006EAC", -")$ c #004C8E", -"!$ c #005595", -"~$ c #025999", -"{$ c #085D9B", -"]$ c #0D64A0", -"^$ c #1369A4", -"/$ c #196EA7", -"($ c #1E73AA", -"_$ c #2376AD", -":$ c #2AA0CE", -"<$ c #2FAFD9", -"[$ c #34B1DB", -"}$ c #38B3DC", -"|$ c #3BB5DC", -"1$ c #3EB6DD", -"2$ c #40B7DD", -"3$ c #42B7DD", -"4$ c #43B7DE", -"5$ c #43B7DD", -"6$ c #40B5DC", -"7$ c #3DB4DB", -"8$ c #3AB2DA", -"9$ c #33AED6", -"0$ c #2EABD5", -"a$ c #29A5D2", -"b$ c #259ECD", -"c$ c #2094C6", -"d$ c #1C8DC2", -"e$ c #1787BE", -"f$ c #127EB9", -"g$ c #0D75B3", -"h$ c #076AAC", -"i$ c #005FA6", -"j$ c #00539D", -"k$ c #005AA2", -"l$ c #0060A6", -"m$ c #0068AB", -"n$ c #0063A5", -"o$ c #004487", -"p$ c #004386", -"q$ c #004789", -"r$ c #004B8D", -"s$ c #045192", -"t$ c #095997", -"u$ c #0E5F9C", -"v$ c #1365A0", -"w$ c #1869A4", -"x$ c #1D6EA7", -"y$ c #2274AB", -"z$ c #28A6D2", -"A$ c #2DAED8", -"B$ c #31AFD9", -"C$ c #34B1DA", -"D$ c #37B2DB", -"E$ c #39B3DB", -"F$ c #3BB4DB", -"G$ c #3CB4DB", -"H$ c #3BB3DA", -"I$ c #38B1D9", -"J$ c #35AFD8", -"K$ c #32ADD6", -"L$ c #2EAAD4", -"M$ c #2BA5D1", -"N$ c #2795C5", -"O$ c #2374AA", -"P$ c #1E5691", -"Q$ c #1A4C89", -"R$ c #156AA5", -"S$ c #1078B5", -"T$ c #0B6FAF", -"U$ c #0665A9", -"V$ c #004A97", -"W$ c #004D9A", -"X$ c #00509A", -"Y$ c #00579F", -"Z$ c #0062A7", -"`$ c #00468A", -" % c #00387C", -".% c #003C7F", -"+% c #004083", -"@% c #044D8E", -"#% c #095493", -"$% c #0E5A98", -"%% c #13609C", -"&% c #18659F", -"*% c #1C6BA4", -"=% c #219FCD", -"-% c #25AAD5", -";% c #29ABD6", -">% c #2DADD7", -",% c #30AED8", -"'% c #32AFD8", -")% c #34B0D8", -"!% c #34AED7", -"~% c #30ABD4", -"{% c #2DA8D2", -"]% c #2BA3CF", -"^% c #289DCC", -"/% c #2494C5", -"(% c #20659E", -"_% c #1C4684", -":% c #183D7C", -"<% c #133B7A", -"[% c #0F5695", -"}% c #0A5FA1", -"|% c #055FA5", -"1% c #00559F", -"2% c #004D99", -"3% c #004896", -"4% c #002E74", -"5% c #003C82", -"6% c #004E94", -"7% c #003377", -"8% c #003175", -"9% c #003578", -"0% c #003B7F", -"a% c #003F82", -"b% c #014285", -"c% c #044889", -"d% c #094E8E", -"e% c #0D5493", -"f% c #125997", -"g% c #167FB4", -"h% c #1A96C7", -"i% c #1EA5D2", -"j% c #22A7D3", -"k% c #25A9D4", -"l% c #28AAD5", -"m% c #2AAAD5", -"n% c #2CABD6", -"o% c #2DACD6", -"p% c #2EACD5", -"q% c #2DA9D3", -"r% c #2CA6D1", -"s% c #299FCD", -"t% c #279ACA", -"u% c #2495C7", -"v% c #218FC3", -"w% c #1D86BC", -"x% c #1A4683", -"y% c #163574", -"z% c #112C6C", -"A% c #0D2464", -"B% c #082D6F", -"C% c #044E94", -"D% c #004F9A", -"E% c #004292", -"F% c #00347D", -"G% c #002266", -"H% c #002669", -"I% c #00286C", -"J% c #002B6F", -"K% c #002E72", -"L% c #003478", -"M% c #00377B", -"N% c #003A7E", -"O% c #013D80", -"P% c #044285", -"Q% c #084889", -"R% c #0D4D8D", -"S% c #115492", -"T% c #15609B", -"U% c #189ACB", -"V% c #1CA0CF", -"W% c #1FA2CF", -"X% c #21A3D1", -"Y% c #24A4D1", -"Z% c #25A5D1", -"`% c #27A4D1", -" & c #28A4D1", -".& c #28A0CE", -"+& c #289ECC", -"@& c #2596C8", -"#& c #2392C5", -"$& c #208DC2", -"%& c #1D87BD", -"&& c #1A75AE", -"*& c #173978", -"=& c #132E6D", -"-& c #0F2565", -";& c #0B1D5D", -">& c #071555", -",& c #021151", -"'& c #001F61", -")& c #00276D", -"!& c #003D8E", -"~& c #003B89", -"{& c #001E62", -"]& c #002063", -"^& c #002569", -"/& c #002D72", -"(& c #003074", -"_& c #003579", -":& c #033C7F", -"<& c #074183", -"[& c #0B4787", -"}& c #0F5392", -"|& c #1391C5", -"1& c #1695C8", -"2& c #1998CA", -"3& c #1C99CA", -"4& c #1E9ACB", -"5& c #209BCB", -"6& c #219BCB", -"7& c #229ACA", -"8& c #2399C9", -"9& c #2397C8", -"0& c #2394C6", -"a& c #2291C4", -"b& c #1E89C0", -"c& c #1C84BC", -"d& c #1A5B97", -"e& c #174C89", -"f& c #142D6C", -"g& c #102665", -"h& c #0C1E5D", -"i& c #081756", -"j& c #040F4F", -"k& c #000847", -"l& c #000541", -"m& c #00033D", -"n& c #00368A", -"o& c #00256E", -"p& c #00185A", -"q& c #001A5D", -"r& c #001D60", -"s& c #001F63", -"t& c #002568", -"u& c #00276B", -"v& c #00296D", -"w& c #002B70", -"x& c #003276", -"y& c #023579", -"z& c #063A7D", -"A& c #0A5997", -"B& c #0D87BF", -"C& c #108AC1", -"D& c #138CC3", -"E& c #168EC4", -"F& c #188FC4", -"G& c #1A90C4", -"H& c #1C90C4", -"I& c #1D8FC4", -"J& c #1D8EC3", -"K& c #1D8CC2", -"L& c #1D8AC0", -"M& c #1C87BE", -"N& c #1B83BC", -"O& c #1A7FB9", -"P& c #1864A0", -"Q& c #164987", -"R& c #132C6A", -"S& c #102564", -"T& c #0D1E5D", -"U& c #091756", -"V& c #06104E", -"W& c #020947", -"X& c #000441", -"Y& c #00023C", -"Z& c #000038", -"`& c #003086", -" * c #001A5E", -".* c #001354", -"+* c #001658", -"@* c #001D5F", -"#* c #001F62", -"$* c #002164", -"%* c #002367", -"&* c #002D71", -"** c #014C8E", -"=* c #0474B2", -"-* c #077CB9", -";* c #0B80BA", -">* c #0E82BB", -",* c #1083BC", -"'* c #1285BD", -")* c #1485BE", -"!* c #1686BD", -"~* c #1785BD", -"{* c #1884BC", -"]* c #1882BB", -"^* c #1880B9", -"/* c #187DB7", -"(* c #177AB6", -"_* c #1571AF", -":* c #143676", -"<* c #122968", -"[* c #0F2362", -"}* c #0D1D5C", -"|* c #0A1755", -"1* c #030A47", -"2* c #000239", -"3* c #002A82", -"4* c #00175D", -"5* c #00104F", -"6* c #001252", -"7* c #001454", -"8* c #001657", -"9* c #00195C", -"0* c #001C5E", -"a* c #001D61", -"b* c #002165", -"c* c #002366", -"d* c #002468", -"e* c #006CAE", -"f* c #006FB0", -"g* c #0271B1", -"h* c #0574B3", -"i* c #0877B4", -"j* c #0B78B5", -"k* c #0F7AB6", -"l* c #107AB7", -"m* c #127AB6", -"n* c #1279B5", -"o* c #1377B4", -"p* c #1375B3", -"q* c #1372B1", -"r* c #126FAF", -"s* c #115797", -"t* c #0F2766", -"u* c #0D2160", -"v* c #0B1B5A", -"w* c #091554", -"x* c #06104D", -"y* c #030A46", -"z* c #000540", -"A* c #000036", -"B* c #00237E", -"C* c #002980", -"D* c #002372", -"E* c #001A60", -"F* c #001659", -"G* c #001358", -"H* c #001A5F", -"I* c #002064", -"J* c #001B5E", -"K* c #005397", -"L* c #0065A9", -"M* c #0067AB", -"N* c #0069AC", -"O* c #026AAD", -"P* c #046CAE", -"Q* c #0768AB", -"R* c #0965A9", -"S* c #0A6EAF", -"T* c #0C6EAE", -"U* c #0D6DAE", -"V* c #0D6CAD", -"W* c #0D6AAB", -"X* c #0D67AA", -"Y* c #0D64A7", -"Z* c #0C498C", -"`* c #0A1E5E", -" = c #091856", -".= c #071350", -"+= c #050D4B", -"@= c #020844", -"#= c #00043F", -"$= c #00023B", -"%= c #000037", -"&= c #000035", -"*= c #000034", -"== c #001A77", -"-= c #00237D", -";= c #002881", -">= c #002D84", -",= c #00287F", -"'= c #000B6C", -")= c #00388A", -"!= c #003785", -"~= c #001556", -"{= c #001759", -"]= c #00195B", -"^= c #001C5F", -"/= c #001C60", -"(= c #004B91", -"_= c #004287", -":= c #00569C", -"<= c #0061A7", -"[= c #023187", -"}= c #033388", -"|= c #0563A7", -"1= c #0662A7", -"2= c #0762A7", -"3= c #0860A6", -"4= c #085EA4", -"5= c #085CA3", -"6= c #084388", -"7= c #071B5B", -"8= c #061453", -"9= c #04104D", -"0= c #030B48", -"a= c #010742", -"b= c #00033E", -"c= c #00013A", -"d= c #000033", -"e= c #000032", -"f= c #001C79", -"g= c #00217C", -"h= c #002780", -"i= c #002B83", -"j= c #003589", -"k= c #001D63", -"l= c #000F4F", -"m= c #000F4E", -"n= c #001050", -"o= c #001152", -"p= c #001353", -"q= c #001455", -"r= c #002F74", -"s= c #00529A", -"t= c #0058A1", -"u= c #00529D", -"v= c #0156A0", -"w= c #02569F", -"x= c #02549E", -"y= c #03529D", -"z= c #034F9A", -"A= c #032062", -"B= c #020F4E", -"C= c #010C49", -"D= c #000845", -"E= c #00033C", -"F= c #000138", -"G= c #000135", -"H= c #001474", -"I= c #001F7B", -"J= c #00247E", -"K= c #002D83", -"L= c #001051", -"M= c #000A46", -"N= c #000B48", -"O= c #000C4A", -"P= c #000D4B", -"Q= c #000E4D", -"R= c #001151", -"S= c #001253", -"T= c #00377E", -"U= c #004E9A", -"V= c #004C98", -"W= c #00408C", -"X= c #000946", -"Y= c #00053F", -"Z= c #000137", -"`= c #000031", -" - c #000030", -".- c #001373", -"+- c #001876", -"@- c #001D79", -"#- c #00267F", -"$- c #000D4D", -"%- c #000741", -"&- c #000843", -"*- c #000945", -"=- c #000A47", -"-- c #000B49", -";- c #000D4C", -">- c #002F77", -",- c #00327A", -"'- c #002267", -")- c #002166", -"!- c #00256A", -"~- c #003D89", -"{- c #004393", -"]- c #003F90", -"^- c #003C8D", -"/- c #003382", -"(- c #003587", -"_- c #002069", -":- c #00033A", -"<- c #000136", -"[- c #00002F", -"}- c #000C6E", -"|- c #001171", -"1- c #001574", -"2- c #001E7A", -"3- c #00196A", -"4- c #00053E", -"5- c #000640", -"6- c #000742", -"7- c #00185B", -"8- c #003787", -"9- c #00398C", -"0- c #00378B", -"a- c #003388", -"b- c #002779", -"c- c #00063F", -"d- c #00002D", -"e- c #00096C", -"f- c #000D6F", -"g- c #001271", -"h- c #001675", -"i- c #001872", -"j- c #000338", -"k- c #00043A", -"l- c #00043B", -"m- c #00053D", -"n- c #000844", -"o- c #000944", -"p- c #002573", -"q- c #002E85", -"r- c #002C83", -"s- c #001E71", -"t- c #00002E", -"u- c #00002C", -"v- c #000266", -"w- c #00066A", -"x- c #000A6D", -"y- c #000E70", -"z- c #000C58", -"A- c #000643", -"B- c #000337", -"C- c #000236", -"D- c #000339", -"E- c #00053C", -"F- c #00063E", -"G- c #00073F", -"H- c #00145A", -"I- c #001C78", -"J- c #000743", -"K- c #00002A", -"L- c #00005F", -"M- c #000267", -"N- c #000A6C", -"O- c #000952", -"P- c #000131", -"Q- c #000132", -"R- c #000133", -"S- c #000134", -"T- c #000235", -"U- c #00196E", -"V- c #001D7A", -"W- c #001B78", -"X- c #001977", -"Y- c #001775", -"Z- c #001473", -"`- c #000E66", -" ; c #00002B", -".; c #000029", -"+; c #000053", -"@; c #00005E", -"#; c #000265", -"$; c #000464", -"%; c #000130", -"&; c #001160", -"*; c #001164", -"=; c #001674", -"-; c #001272", -";; c #001071", -">; c #000E6F", -",; c #000B6E", -"'; c #00086C", -"); c #00045F", -"!; c #000152", -"~; c #000046", -"{; c #000051", -"]; c #00005A", -"^; c #00012F", -"/; c #000542", -"(; c #00106E", -"_; c #001070", -":; c #000F70", -"<; c #00086B", -"[; c #000367", -"}; c #000163", -"|; c #00005B", -"1; c #000052", -"2; c #000047", -"3; c #000041", -"4; c #000028", -"5; c #000021", -"6; c #000025", -"7; c #00003E", -"8; c #00003A", -"9; c #00075A", -"0; c #00076B", -"a; c #000569", -"b; c #000368", -"c; c #000162", -"d; c #00005C", -"e; c #000054", -"f; c #00004C", -"g; c #000042", -"h; c #000039", -"i; c #000026", -"j; c #000023", -"k; c #000017", -"l; c #00001C", -"m; c #00004D", -"n; c #000055", -"o; c #000027", -"p; c #00003D", -"q; c #000058", -"r; c #00004E", -"s; c #000048", -"t; c #000019", -"u; c #000012", -"v; c #00001D", -"w; c #00001F", -"x; c #000044", -"y; c #000008", -"z; c #000018", -"A; c #000024", -"B; c #000015", -"C; c #000022", -"D; c #00000F", -"E; c #000004", -"F; c #000007", -"G; c #000009", -"H; c #00000C", -"I; c #00000D", -"J; c #00000E", -"K; c #00000A", -"L; c #000003", -"M; c #000000", -"N; c #000001", -"O; c #000005", -"P; c #00000B", -" ", -" ", -" . + @ # $ % & * ", -" = - ; > , ' ) ! ~ { ] ^ / ( _ : ", -" < [ } | 1 2 3 4 5 6 7 8 9 0 a b c d e ", -" f g h i j k l m n o p q r s t u v w x y z A B ", -" C D E F G H I J K L M N O P Q R S T U V W X Y Z ` . ", -" ..+.@.#.$.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|. ", -" 1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s. ", -" t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y. ", -" Z.`. +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+ ", -" 3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+k+l+m+]+n+o+p+q+r+s+t+u+v+w+x+y+ ", -" z+A+B+C+D+E+F+G+H+I+J+K+L+M+f+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@ ", -" &@*@=@-@;@>@,@'@)@!@~@{@]@^@L+/@(@_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@b@c@d@ ", -" e@f@z+A+B+g@h@i@j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@L@M@ ", -" N@O@P@Q@R@S@T@U@V@W@X@Y@l@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#_# ", -" :#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y# ", -" z#A#B#M@C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$z# ", -" -$;$>$,$O@'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$2$3$4$5$3$6$7$8$ $9$0$a$b$c$d$e$f$g$h$i$ ", -" j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$F$G$G$H$8$I$J$K$L$M$N$O$P$Q$R$S$T$U$k$V$ ", -" W$X$Y$Z$`$ %.%+%p$q$@%#%$%%%&%*%=%-%;%>%,%'%)%p#p#J$!%K$~%{%]%^%/%(%_%:%<%[%}%|%1%2% ", -" 3%4%5%6%7%8%9% %0%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%0$q%r%]%s%t%u%v%w%x%y%z%A%B%C%D%3% ", -" E%F%G%H%I%J%K%8%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% &9+.&+&V.@&#&$&%&&&*&=&-&;&>&,&'&)& ", -" !&~&{&]&G%^&I%J%/&(&7%_& %:&<&[&}&|&1&2&3&4&5&6&7&8&9&0&a&$&b&c&d&e&f&g&h&i&j&k&l&m& ", -" n&o&p&q&r&s&G%t&u&v&w&K%(&x&y&z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z& ", -" `& *.*+*p&q&@*#*$*%*^&u&v&J%&***=*-*;*>*,*'*)*!*~*{*]*^*/*(*_*:*<*[*}*|*V&1*l&Y&Z&2* ", -" 3*4*5*6*7*8*p&9*0*a*s&b*c*d*v&e*f*g*h*i*j**$k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*Y&Z&A*z* ", -" B*C*D*E*F*G*H*I*+*p&9*J*r&{&x&K*L*M*N*O*P*Q*R*S*T*U*V*W*X*Y*Z*`* =.=+=@=#=$=%=&=*= ", -" ==-=;=>=,='=)=!=J*.*~=+*{=]=^=/=(=_=:=l$<=[=}=|=1=2=3=4=5=6=7=8=9=0=a=b=c=%=&=d=e= ", -" f=g=h=i=3*j=k=l=m=n=o=p=q=~=8*r=^=b*s=t=j$u=-$v=w=x=y=z=A=B=C=D=z*E=F=A*&=d=e=G= ", -" H===I=J=;=K=L=M=N=O=P=Q=l=n=R=6*S=.*T=D%D%D%U=2%V=V$3%W=J*L=X=Y=$=Z=&=*=e=`= - ", -" .-+-@-g=#-$-%-&-*-M==---O=P=;-Q=m=>-,-'-)-!-~-{-E%]-^-/-(-_-:-<-*=d=e=`=[-[- ", -" }-|-1-==2-3-4-4-5-%-6-&-*-X==-=-N=q&;-O=O=O=7-8-9-0-j=a-`&b-c-d=e=`= -[-d-$= ", -" e-f-g-h-i-4-j-k-l-m-4-c-5-%-6-6-&-&-n-o-o-*-M=p-q-r-3*h=s-X=`= -[-t-u-u- ", -" v-w-x-y-g-z-A-B-C-j-D-:-l-l-E-m-4-F-F-c-c-c-G-H-#-J=g=I=I-J-t-t-d-u-K- ", -" L-M-w-N-f-O-P-Q-R-S-T-C-C-B-j-D-D-:-k-l-k-D=U-V-W-X-Y-Z-`-[- ; ;.;u- ", -" +;@;#;$; ;u-d-t-[- -%;P-Q-R-R-S-B-z*&;*;Y-=;H=-;;;>;,;';);!;%=d- ", -" ~;{;];u-.;K- ; ;u-d-d-d-t-t-^;/;(;_;;;:;f-}-x-<;w-[;};|;1;2; ", -" A*%=3;4;5;6;u-7;8;u-K- ; ; ; ;^;9;<;0;w-a;b;v-c;d;e;f;g;h; ", -" i;j;k;l;d=m;1;n;d= ;i;o;o;o;o;p;@;d;q;+;r;s;3;h;`=K- ", -" t;u;k;o;e=Z&%=5;*=l;v;v;v;w; ;x;3;p;Z&d=d-i;w; ", -" y;u;z;v;5;A;A;B;u;u;u;j; ;.;i;C;v;z;u;D; ", -" E;E;F;G;H;I;I;I;H;D;J;H;K;F;E;K; ", -" y;L;M;M;N;N;M;N;O;P; ", -" ", -" ", -" ", -" "}; diff --git a/mozilla/xulrunner/app/document-os2.ico b/mozilla/xulrunner/app/document-os2.ico deleted file mode 100644 index 214e92cef45..00000000000 Binary files a/mozilla/xulrunner/app/document-os2.ico and /dev/null differ diff --git a/mozilla/xulrunner/app/document.ico b/mozilla/xulrunner/app/document.ico deleted file mode 100644 index 31111632477..00000000000 Binary files a/mozilla/xulrunner/app/document.ico and /dev/null differ diff --git a/mozilla/xulrunner/app/document.png b/mozilla/xulrunner/app/document.png deleted file mode 100644 index be4a022e668..00000000000 Binary files a/mozilla/xulrunner/app/document.png and /dev/null differ diff --git a/mozilla/xulrunner/app/macbuild/Info.plist.in b/mozilla/xulrunner/app/macbuild/Info.plist.in deleted file mode 100644 index 5feb8b359d8..00000000000 --- a/mozilla/xulrunner/app/macbuild/Info.plist.in +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - xulrunner-bin - CFBundleIdentifier - org.mozilla.xulrunner - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - XULRunner - CFBundlePackageType - FMWK - CFBundleSignature - MOZB - CFBundleVersion - APP_VERSION - - diff --git a/mozilla/xulrunner/app/macbuild/InfoPlist.strings b/mozilla/xulrunner/app/macbuild/InfoPlist.strings deleted file mode 100644 index 5d9eefd515c..00000000000 Binary files a/mozilla/xulrunner/app/macbuild/InfoPlist.strings and /dev/null differ diff --git a/mozilla/xulrunner/app/mozicon16.xpm b/mozilla/xulrunner/app/mozicon16.xpm deleted file mode 100644 index f3c8a433c28..00000000000 --- a/mozilla/xulrunner/app/mozicon16.xpm +++ /dev/null @@ -1,156 +0,0 @@ -/* XPM */ -static char * mozicon16_xpm[] = { -"16 16 137 2", -" c None", -". c #388BBF", -"+ c #59ADD6", -"@ c #68CEEF", -"# c #62CCEE", -"$ c #45AAD7", -"% c #3578AF", -"& c #4A93C3", -"* c #5EA9D2", -"= c #72D1EF", -"- c #6DCCEC", -"; c #4B9FCE", -"> c #3483BA", -", c #1E67A5", -"' c #1B6BA5", -") c #2F7AB0", -"! c #48B9E0", -"~ c #5CC2E5", -"{ c #6ED0EE", -"] c #6FC9E9", -"^ c #4994C5", -"/ c #3783B9", -"( c #1E5D9D", -"_ c #1463A1", -": c #028DC4", -"< c #128DC3", -"[ c #27ABD7", -"} c #3CB8E0", -"| c #4EC0E5", -"1 c #5BC3E6", -"2 c #50A2CE", -"3 c #3B7EB5", -"4 c #3C93C4", -"5 c #2164A1", -"6 c #145A9A", -"7 c #0E8FC4", -"8 c #007EBA", -"9 c #0694C8", -"0 c #1896C7", -"a c #2B99C9", -"b c #3CB7DE", -"c c #48B9DF", -"d c #3E95C5", -"e c #2E71AB", -"f c #399DCA", -"g c #34A9D4", -"h c #2387BE", -"i c #1388C0", -"j c #0059A1", -"k c #005C9E", -"l c #00498B", -"m c #095897", -"n c #1869A3", -"o c #289CCA", -"p c #34B1DA", -"q c #3BB3DB", -"r c #3BB3DA", -"s c #35AFD7", -"t c #2BA2CF", -"u c #1E6AA2", -"v c #106AA7", -"w c #0258A0", -"x c #00357F", -"y c #002D71", -"z c #003175", -"A c #013A7E", -"B c #084889", -"C c #1577AF", -"D c #1FA1CF", -"E c #26A3D1", -"F c #28A2CF", -"G c #269ACA", -"H c #2088BE", -"I c #174784", -"J c #0B1F5F", -"K c #012568", -"L c #00206A", -"M c #00185A", -"N c #001F62", -"O c #002569", -"P c #002C70", -"Q c #0567A7", -"R c #0D81BB", -"S c #1485BD", -"T c #1883BC", -"U c #177DB7", -"V c #144A88", -"W c #0C1D5C", -"X c #030B47", -"Y c #00023B", -"Z c #00207A", -"` c #002072", -" . c #00236B", -".. c #001556", -"+. c #001B5E", -"@. c #003D81", -"#. c #01599E", -"$. c #04559E", -"%. c #0761A6", -"&. c #085499", -"*. c #061958", -"=. c #020843", -"-. c #000137", -";. c #001C79", -">. c #00155D", -",. c #000945", -"'. c #000B49", -"). c #000E4C", -"!. c #002367", -"~. c #002A6F", -"{. c #003E8B", -"]. c #003787", -"^. c #00175C", -"/. c #000035", -"(. c #000030", -"_. c #000E67", -":. c #00043B", -"<. c #000339", -"[. c #00043C", -"}. c #00053E", -"|. c #00063F", -"1. c #000E4F", -"2. c #00247E", -"3. c #00166A", -"4. c #00002E", -"5. c #00014F", -"6. c #000029", -"7. c #00012F", -"8. c #000953", -"9. c #000E6E", -"0. c #000A6C", -"a. c #000563", -"b. c #00002F", -"c. c #00001D", -"d. c #000025", -"e. c #000040", -"f. c #000033", -" ", -" . + @ # $ ", -" % & * = - ; > , ", -" ' ) ! ~ { ] ^ / ( _ ", -" : < [ } | 1 2 3 4 5 6 7 ", -" 8 9 0 a b c d e f g h i ", -" j k l m n o p q r s t u v w ", -" x y z A B C D E F G H I J K ", -" L M N O P Q R S T U V W X Y ", -" Z ` ...+.@.#.$.%.&.*.=.-. ", -" ;.>.,.'.).!.~.{.].^./.(. ", -" _.:.<.[.}.|.1.2.3.4. ", -" 5.6.(.4.7.8.9.0.a. ", -" b.b.c.d.e.f. ", -" ", -" "}; diff --git a/mozilla/xulrunner/app/mozicon50.xpm b/mozilla/xulrunner/app/mozicon50.xpm deleted file mode 100644 index d240015018d..00000000000 --- a/mozilla/xulrunner/app/mozicon50.xpm +++ /dev/null @@ -1,1144 +0,0 @@ -/* XPM */ -static char * mozicon50_xpm[] = { -"48 48 1093 2", -" c None", -". c #2099CF", -"+ c #2CA7D9", -"@ c #33AEDD", -"# c #34B2E1", -"$ c #35B8E5", -"% c #2FBAE8", -"& c #26B5E4", -"* c #199FD6", -"= c #177DB8", -"- c #2C8FC4", -"; c #43A0CE", -"> c #55ADD6", -", c #5CB5DD", -"' c #61C4E8", -") c #63CBED", -"! c #64CFF1", -"~ c #63D1F2", -"{ c #5ECCEF", -"] c #57C3E9", -"^ c #4EB8E1", -"/ c #3CABD9", -"( c #2A9ED1", -"_ c #1991C9", -": c #0F7CBA", -"< c #166EAC", -"[ c #3387BC", -"} c #4797C6", -"| c #51A0CC", -"1 c #56A7D2", -"2 c #5BAED7", -"3 c #60B6DD", -"4 c #67CDEE", -"5 c #69D3F2", -"6 c #6BD4F4", -"7 c #69D3F4", -"8 c #63CDEF", -"9 c #5AC0E6", -"0 c #51B6DF", -"a c #49ACD8", -"b c #42A2D1", -"c c #3898CA", -"d c #298CC2", -"e c #167EB9", -"f c #0B5A9C", -"g c #2674AE", -"h c #3D87BA", -"i c #4590C0", -"j c #4B97C6", -"k c #519FCB", -"l c #58A6D1", -"m c #5DADD5", -"n c #62B3DA", -"o c #69C3E6", -"p c #6ED4F2", -"q c #6FD6F4", -"r c #6ED5F4", -"s c #6AD3F2", -"t c #5FC3E7", -"u c #53B2DC", -"v c #4BA8D5", -"w c #439FCE", -"x c #3B95C7", -"y c #338BC0", -"z c #2B82B9", -"A c #1D76B1", -"B c #0C69A9", -"C c #10599A", -"D c #2D71AA", -"E c #377CB2", -"F c #3D84B8", -"G c #458DBE", -"H c #4B95C4", -"I c #529CC9", -"J c #59A4CF", -"K c #5FABD4", -"L c #65B1D8", -"M c #6BC2E4", -"N c #71D5F3", -"O c #73D6F3", -"P c #72D5F3", -"Q c #6DD1F0", -"R c #5FBBE2", -"S c #54ADD8", -"T c #4CA4D2", -"U c #439ACB", -"V c #3B91C4", -"W c #3487BD", -"X c #2D7EB7", -"Y c #2675AF", -"Z c #1E6CA9", -"` c #0F5FA0", -" . c #055296", -".. c #115394", -"+. c #2767A2", -"@. c #2F70A9", -"#. c #3679AF", -"$. c #3C81B5", -"%. c #448ABC", -"&. c #4A92C2", -"*. c #519AC7", -"=. c #58A2CD", -"-. c #5FA9D2", -";. c #65B0D7", -">. c #6EC8E9", -",. c #74D4F2", -"'. c #76D6F3", -"). c #75D6F3", -"!. c #71D3F1", -"~. c #62BCE1", -"{. c #54A9D5", -"]. c #4C9FCE", -"^. c #4396C8", -"/. c #3B8CC1", -"(. c #3483BA", -"_. c #2C7AB3", -":. c #2670AC", -"<. c #1F68A6", -"[. c #195F9F", -"}. c #0D5497", -"|. c #04488D", -"1. c #0F4A8D", -"2. c #1F5A98", -"3. c #2663A0", -"4. c #2D6DA6", -"5. c #3475AD", -"6. c #3B7EB3", -"7. c #4287B9", -"8. c #4990C1", -"9. c #51A4CF", -"0. c #569FCA", -"a. c #5DA6CF", -"b. c #66B5DB", -"c. c #6FD1F0", -"d. c #75D4F1", -"e. c #79D5F2", -"f. c #75D3F1", -"g. c #63BBE0", -"h. c #54A4D1", -"i. c #4B9BCB", -"j. c #4391C4", -"k. c #3B88BD", -"l. c #337FB6", -"m. c #2C76B0", -"n. c #266CA9", -"o. c #1F64A3", -"p. c #1A5B9C", -"q. c #145396", -"r. c #0A498E", -"s. c #034C8F", -"t. c #085293", -"u. c #164D8E", -"v. c #1D5695", -"w. c #24609C", -"x. c #2A69A3", -"y. c #3271AA", -"z. c #387AAF", -"A. c #429FCC", -"B. c #4CBFE4", -"C. c #52C4E8", -"D. c #57AFD7", -"E. c #5DB3DA", -"F. c #65C5E7", -"G. c #6DD0EE", -"H. c #72D2EF", -"I. c #78D4F0", -"J. c #7BD5F1", -"K. c #76D2EF", -"L. c #6AC5E6", -"M. c #55A5D1", -"N. c #4A95C6", -"O. c #428CC0", -"P. c #3A83B9", -"Q. c #337AB3", -"R. c #2C71AD", -"S. c #2568A6", -"T. c #1F5F9F", -"U. c #1D65A3", -"V. c #269ACA", -"W. c #1C84BA", -"X. c #0D7DB5", -"Y. c #0298CC", -"Z. c #0296CA", -"`. c #0C5998", -" + c #14498A", -".+ c #1B609C", -"++ c #2498C8", -"@+ c #2977AF", -"#+ c #2F75AC", -"$+ c #3575AC", -"%+ c #40ABD5", -"&+ c #49BFE4", -"*+ c #50C3E7", -"=+ c #56C5E8", -"-+ c #5DC8EA", -";+ c #63CBEB", -">+ c #69CEED", -",+ c #6ED0EE", -"'+ c #73D2EF", -")+ c #77D3EF", -"!+ c #72CEEC", -"~+ c #5AA7D1", -"{+ c #4F99C9", -"]+ c #4891C3", -"^+ c #4087BC", -"/+ c #387EB5", -"(+ c #3277B1", -"_+ c #2B70AB", -":+ c #2463A2", -"<+ c #1E5B9C", -"[+ c #185395", -"}+ c #165496", -"|+ c #10498D", -"1+ c #105F9E", -"2+ c #0A9ECF", -"3+ c #0088C0", -"4+ c #038DC3", -"5+ c #0A4A8C", -"6+ c #114E8E", -"7+ c #1989BD", -"8+ c #22AAD7", -"9+ c #28A2D0", -"0+ c #2C71A9", -"a+ c #3380B5", -"b+ c #3EB9E1", -"c+ c #45BDE3", -"d+ c #4CC0E5", -"e+ c #53C3E7", -"f+ c #59C6E8", -"g+ c #5EC9EA", -"h+ c #64CBEB", -"i+ c #69CDEC", -"j+ c #6ECFED", -"k+ c #70D0ED", -"l+ c #64BDE1", -"m+ c #55A6D1", -"n+ c #3D82B8", -"o+ c #3D8BBE", -"p+ c #49AFD8", -"q+ c #378DBF", -"r+ c #225F9E", -"s+ c #1D5698", -"t+ c #174E92", -"u+ c #12468B", -"v+ c #0E3F85", -"w+ c #115F9D", -"x+ c #15A2D1", -"y+ c #0395C9", -"z+ c #0088C1", -"A+ c #0190C6", -"B+ c #079ACC", -"C+ c #0FA0D0", -"D+ c #169ECF", -"E+ c #1D99CC", -"F+ c #25AAD7", -"G+ c #2BA0CE", -"H+ c #32AED8", -"I+ c #3AB7DF", -"J+ c #41BBE1", -"K+ c #47BEE3", -"L+ c #4EC1E5", -"M+ c #53C4E7", -"N+ c #5FC8E9", -"O+ c #63CAEA", -"P+ c #67CBEB", -"Q+ c #69CBEA", -"R+ c #62BCE0", -"S+ c #5AAFD7", -"T+ c #478DBF", -"U+ c #4084B9", -"V+ c #3A7CB4", -"W+ c #3E8CBF", -"X+ c #4DBADF", -"Y+ c #3383B8", -"Z+ c #215B9B", -"`+ c #1B5295", -" @ c #164A8E", -".@ c #114288", -"+@ c #0D3A82", -"@@ c #0E4C8E", -"#@ c #1380B7", -"$@ c #0D96C9", -"%@ c #0089C1", -"&@ c #007BB8", -"*@ c #0085BE", -"=@ c #008CC4", -"-@ c #0496C9", -";@ c #0B9DCF", -">@ c #1168AB", -",@ c #174F99", -"'@ c #21AAD7", -")@ c #28AED9", -"!@ c #2FB1DB", -"~@ c #36B5DE", -"{@ c #3CB8E0", -"]@ c #42BBE2", -"^@ c #49BEE4", -"/@ c #54C3E6", -"(@ c #59C5E7", -"_@ c #5DC7E8", -":@ c #5FC5E7", -"<@ c #53A9D3", -"[@ c #4B96C6", -"}@ c #478FC2", -"|@ c #4186BB", -"1@ c #3C7FB5", -"2@ c #3676AF", -"3@ c #306EA9", -"4@ c #3889BD", -"5@ c #44AFD8", -"6@ c #2F84B9", -"7@ c #194D91", -"8@ c #15458A", -"9@ c #144D90", -"0@ c #0C367E", -"a@ c #0C4086", -"b@ c #1797C8", -"c@ c #1295C8", -"d@ c #0487C0", -"e@ c #0079B6", -"f@ c #0081BC", -"g@ c #0E9ACC", -"h@ c #1597CA", -"i@ c #1CA7D5", -"j@ c #23ABD8", -"k@ c #2AAFDA", -"l@ c #31B2DC", -"m@ c #37B5DE", -"n@ c #3DB8E0", -"o@ c #43BBE2", -"p@ c #49BEE3", -"q@ c #4EC0E4", -"r@ c #53C2E5", -"s@ c #57C4E6", -"t@ c #4EAAD4", -"u@ c #4696C5", -"v@ c #438FC0", -"w@ c #4088BC", -"x@ c #3C80B6", -"y@ c #3778B1", -"z@ c #3270AB", -"A@ c #2C68A5", -"B@ c #3D9AC8", -"C@ c #46BADF", -"D@ c #3DB0D8", -"E@ c #287CB2", -"F@ c #164D90", -"G@ c #299ECC", -"H@ c #1B79B0", -"I@ c #1A8CBF", -"J@ c #199BCC", -"K@ c #1392C6", -"L@ c #0A86BE", -"M@ c #0079B7", -"N@ c #006AAC", -"O@ c #0074B3", -"P@ c #007CB9", -"Q@ c #0083BE", -"R@ c #008BC2", -"S@ c #0393C8", -"T@ c #099CCD", -"U@ c #10A1D1", -"V@ c #17A4D3", -"W@ c #1EA8D6", -"X@ c #25ABD8", -"Y@ c #2BAFDA", -"Z@ c #37B5DD", -"`@ c #3DB8DF", -" # c #42BAE1", -".# c #48BCE2", -"+# c #4CBEE3", -"@# c #50C0E4", -"## c #48A8D3", -"$# c #3F8EC0", -"%# c #3C87BC", -"&# c #3A81B7", -"*# c #3679B1", -"=# c #3171AC", -"-# c #2D6AA6", -";# c #2862A0", -"># c #40A5D1", -",# c #43B8DE", -"'# c #3DB5DC", -")# c #38B1DA", -"!# c #2D9ECC", -"~# c #2B9FCE", -"{# c #246AAA", -"]# c #1F96C7", -"^# c #1996C9", -"/# c #138DC3", -"(# c #0E84BC", -"_# c #0175B4", -":# c #0068AC", -"<# c #0070B1", -"[# c #0077B5", -"}# c #007FBA", -"|# c #0086BF", -"1# c #018DC4", -"2# c #0596C9", -"3# c #0B9DCE", -"4# c #12A1D1", -"5# c #1897C8", -"6# c #1E96C7", -"7# c #25A0CE", -"8# c #2B90C2", -"9# c #31A4D0", -"0# c #37B4DD", -"a# c #3CB7DF", -"b# c #41B9E0", -"c# c #45BBE0", -"d# c #49BCE1", -"e# c #4BBBE0", -"f# c #419FCC", -"g# c #3C91C2", -"h# c #337AB1", -"i# c #3072AC", -"j# c #2C6BA7", -"k# c #2864A1", -"l# c #255F9E", -"m# c #3FAAD4", -"n# c #40B6DC", -"o# c #3AB3DB", -"p# c #35B0D8", -"q# c #2F86BD", -"r# c #29599F", -"s# c #237DB7", -"t# c #1E99CA", -"u# c #1892C5", -"v# c #1389C0", -"w# c #0E7FBA", -"x# c #0473B2", -"y# c #0065AA", -"z# c #0064A9", -"A# c #006BAD", -"B# c #0072B2", -"C# c #0080BC", -"D# c #0082BC", -"E# c #028DC4", -"F# c #0796C9", -"G# c #0D88BD", -"H# c #1372AB", -"I# c #1982B8", -"J# c #1F79B0", -"K# c #247BB1", -"L# c #2A86B9", -"M# c #31B1DA", -"N# c #36B3DC", -"O# c #3AB5DD", -"P# c #3FB7DE", -"Q# c #42B9DF", -"R# c #45BAE0", -"S# c #48BBE0", -"T# c #47B6DD", -"U# c #3689BC", -"V# c #2D72AB", -"W# c #2C73AC", -"X# c #2F7DB3", -"Y# c #399BC9", -"Z# c #3FB4DB", -"`# c #3CB3DA", -" $ c #37B0D9", -".$ c #32AED7", -"+$ c #2CA8D3", -"@$ c #277EB8", -"#$ c #229CCC", -"$$ c #1D95C8", -"%$ c #188DC2", -"&$ c #1384BD", -"*$ c #0D7AB6", -"=$ c #066FB0", -"-$ c #0057A0", -";$ c #005FA5", -">$ c #0066AA", -",$ c #006DAF", -"'$ c #006EAC", -")$ c #004C8E", -"!$ c #005595", -"~$ c #025999", -"{$ c #085D9B", -"]$ c #0D64A0", -"^$ c #1369A4", -"/$ c #196EA7", -"($ c #1E73AA", -"_$ c #2376AD", -":$ c #2AA0CE", -"<$ c #2FAFD9", -"[$ c #34B1DB", -"}$ c #38B3DC", -"|$ c #3BB5DC", -"1$ c #3EB6DD", -"2$ c #40B7DD", -"3$ c #42B7DD", -"4$ c #43B7DE", -"5$ c #43B7DD", -"6$ c #40B5DC", -"7$ c #3DB4DB", -"8$ c #3AB2DA", -"9$ c #33AED6", -"0$ c #2EABD5", -"a$ c #29A5D2", -"b$ c #259ECD", -"c$ c #2094C6", -"d$ c #1C8DC2", -"e$ c #1787BE", -"f$ c #127EB9", -"g$ c #0D75B3", -"h$ c #076AAC", -"i$ c #005FA6", -"j$ c #00539D", -"k$ c #005AA2", -"l$ c #0060A6", -"m$ c #0068AB", -"n$ c #0063A5", -"o$ c #004487", -"p$ c #004386", -"q$ c #004789", -"r$ c #004B8D", -"s$ c #045192", -"t$ c #095997", -"u$ c #0E5F9C", -"v$ c #1365A0", -"w$ c #1869A4", -"x$ c #1D6EA7", -"y$ c #2274AB", -"z$ c #28A6D2", -"A$ c #2DAED8", -"B$ c #31AFD9", -"C$ c #34B1DA", -"D$ c #37B2DB", -"E$ c #39B3DB", -"F$ c #3BB4DB", -"G$ c #3CB4DB", -"H$ c #3BB3DA", -"I$ c #38B1D9", -"J$ c #35AFD8", -"K$ c #32ADD6", -"L$ c #2EAAD4", -"M$ c #2BA5D1", -"N$ c #2795C5", -"O$ c #2374AA", -"P$ c #1E5691", -"Q$ c #1A4C89", -"R$ c #156AA5", -"S$ c #1078B5", -"T$ c #0B6FAF", -"U$ c #0665A9", -"V$ c #004A97", -"W$ c #004D9A", -"X$ c #00509A", -"Y$ c #00579F", -"Z$ c #0062A7", -"`$ c #00468A", -" % c #00387C", -".% c #003C7F", -"+% c #004083", -"@% c #044D8E", -"#% c #095493", -"$% c #0E5A98", -"%% c #13609C", -"&% c #18659F", -"*% c #1C6BA4", -"=% c #219FCD", -"-% c #25AAD5", -";% c #29ABD6", -">% c #2DADD7", -",% c #30AED8", -"'% c #32AFD8", -")% c #34B0D8", -"!% c #34AED7", -"~% c #30ABD4", -"{% c #2DA8D2", -"]% c #2BA3CF", -"^% c #289DCC", -"/% c #2494C5", -"(% c #20659E", -"_% c #1C4684", -":% c #183D7C", -"<% c #133B7A", -"[% c #0F5695", -"}% c #0A5FA1", -"|% c #055FA5", -"1% c #00559F", -"2% c #004D99", -"3% c #004896", -"4% c #002E74", -"5% c #003C82", -"6% c #004E94", -"7% c #003377", -"8% c #003175", -"9% c #003578", -"0% c #003B7F", -"a% c #003F82", -"b% c #014285", -"c% c #044889", -"d% c #094E8E", -"e% c #0D5493", -"f% c #125997", -"g% c #167FB4", -"h% c #1A96C7", -"i% c #1EA5D2", -"j% c #22A7D3", -"k% c #25A9D4", -"l% c #28AAD5", -"m% c #2AAAD5", -"n% c #2CABD6", -"o% c #2DACD6", -"p% c #2EACD5", -"q% c #2DA9D3", -"r% c #2CA6D1", -"s% c #299FCD", -"t% c #279ACA", -"u% c #2495C7", -"v% c #218FC3", -"w% c #1D86BC", -"x% c #1A4683", -"y% c #163574", -"z% c #112C6C", -"A% c #0D2464", -"B% c #082D6F", -"C% c #044E94", -"D% c #004F9A", -"E% c #004292", -"F% c #00347D", -"G% c #002266", -"H% c #002669", -"I% c #00286C", -"J% c #002B6F", -"K% c #002E72", -"L% c #003478", -"M% c #00377B", -"N% c #003A7E", -"O% c #013D80", -"P% c #044285", -"Q% c #084889", -"R% c #0D4D8D", -"S% c #115492", -"T% c #15609B", -"U% c #189ACB", -"V% c #1CA0CF", -"W% c #1FA2CF", -"X% c #21A3D1", -"Y% c #24A4D1", -"Z% c #25A5D1", -"`% c #27A4D1", -" & c #28A4D1", -".& c #28A0CE", -"+& c #289ECC", -"@& c #2596C8", -"#& c #2392C5", -"$& c #208DC2", -"%& c #1D87BD", -"&& c #1A75AE", -"*& c #173978", -"=& c #132E6D", -"-& c #0F2565", -";& c #0B1D5D", -">& c #071555", -",& c #021151", -"'& c #001F61", -")& c #00276D", -"!& c #003D8E", -"~& c #003B89", -"{& c #001E62", -"]& c #002063", -"^& c #002569", -"/& c #002D72", -"(& c #003074", -"_& c #003579", -":& c #033C7F", -"<& c #074183", -"[& c #0B4787", -"}& c #0F5392", -"|& c #1391C5", -"1& c #1695C8", -"2& c #1998CA", -"3& c #1C99CA", -"4& c #1E9ACB", -"5& c #209BCB", -"6& c #219BCB", -"7& c #229ACA", -"8& c #2399C9", -"9& c #2397C8", -"0& c #2394C6", -"a& c #2291C4", -"b& c #1E89C0", -"c& c #1C84BC", -"d& c #1A5B97", -"e& c #174C89", -"f& c #142D6C", -"g& c #102665", -"h& c #0C1E5D", -"i& c #081756", -"j& c #040F4F", -"k& c #000847", -"l& c #000541", -"m& c #00033D", -"n& c #00368A", -"o& c #00256E", -"p& c #00185A", -"q& c #001A5D", -"r& c #001D60", -"s& c #001F63", -"t& c #002568", -"u& c #00276B", -"v& c #00296D", -"w& c #002B70", -"x& c #003276", -"y& c #023579", -"z& c #063A7D", -"A& c #0A5997", -"B& c #0D87BF", -"C& c #108AC1", -"D& c #138CC3", -"E& c #168EC4", -"F& c #188FC4", -"G& c #1A90C4", -"H& c #1C90C4", -"I& c #1D8FC4", -"J& c #1D8EC3", -"K& c #1D8CC2", -"L& c #1D8AC0", -"M& c #1C87BE", -"N& c #1B83BC", -"O& c #1A7FB9", -"P& c #1864A0", -"Q& c #164987", -"R& c #132C6A", -"S& c #102564", -"T& c #0D1E5D", -"U& c #091756", -"V& c #06104E", -"W& c #020947", -"X& c #000441", -"Y& c #00023C", -"Z& c #000038", -"`& c #003086", -" * c #001A5E", -".* c #001354", -"+* c #001658", -"@* c #001D5F", -"#* c #001F62", -"$* c #002164", -"%* c #002367", -"&* c #002D71", -"** c #014C8E", -"=* c #0474B2", -"-* c #077CB9", -";* c #0B80BA", -">* c #0E82BB", -",* c #1083BC", -"'* c #1285BD", -")* c #1485BE", -"!* c #1686BD", -"~* c #1785BD", -"{* c #1884BC", -"]* c #1882BB", -"^* c #1880B9", -"/* c #187DB7", -"(* c #177AB6", -"_* c #1571AF", -":* c #143676", -"<* c #122968", -"[* c #0F2362", -"}* c #0D1D5C", -"|* c #0A1755", -"1* c #030A47", -"2* c #000239", -"3* c #002A82", -"4* c #00175D", -"5* c #00104F", -"6* c #001252", -"7* c #001454", -"8* c #001657", -"9* c #00195C", -"0* c #001C5E", -"a* c #001D61", -"b* c #002165", -"c* c #002366", -"d* c #002468", -"e* c #006CAE", -"f* c #006FB0", -"g* c #0271B1", -"h* c #0574B3", -"i* c #0877B4", -"j* c #0B78B5", -"k* c #0F7AB6", -"l* c #107AB7", -"m* c #127AB6", -"n* c #1279B5", -"o* c #1377B4", -"p* c #1375B3", -"q* c #1372B1", -"r* c #126FAF", -"s* c #115797", -"t* c #0F2766", -"u* c #0D2160", -"v* c #0B1B5A", -"w* c #091554", -"x* c #06104D", -"y* c #030A46", -"z* c #000540", -"A* c #000036", -"B* c #00237E", -"C* c #002980", -"D* c #002372", -"E* c #001A60", -"F* c #001659", -"G* c #001358", -"H* c #001A5F", -"I* c #002064", -"J* c #001B5E", -"K* c #005397", -"L* c #0065A9", -"M* c #0067AB", -"N* c #0069AC", -"O* c #026AAD", -"P* c #046CAE", -"Q* c #0768AB", -"R* c #0965A9", -"S* c #0A6EAF", -"T* c #0C6EAE", -"U* c #0D6DAE", -"V* c #0D6CAD", -"W* c #0D6AAB", -"X* c #0D67AA", -"Y* c #0D64A7", -"Z* c #0C498C", -"`* c #0A1E5E", -" = c #091856", -".= c #071350", -"+= c #050D4B", -"@= c #020844", -"#= c #00043F", -"$= c #00023B", -"%= c #000037", -"&= c #000035", -"*= c #000034", -"== c #001A77", -"-= c #00237D", -";= c #002881", -">= c #002D84", -",= c #00287F", -"'= c #000B6C", -")= c #00388A", -"!= c #003785", -"~= c #001556", -"{= c #001759", -"]= c #00195B", -"^= c #001C5F", -"/= c #001C60", -"(= c #004B91", -"_= c #004287", -":= c #00569C", -"<= c #0061A7", -"[= c #023187", -"}= c #033388", -"|= c #0563A7", -"1= c #0662A7", -"2= c #0762A7", -"3= c #0860A6", -"4= c #085EA4", -"5= c #085CA3", -"6= c #084388", -"7= c #071B5B", -"8= c #061453", -"9= c #04104D", -"0= c #030B48", -"a= c #010742", -"b= c #00033E", -"c= c #00013A", -"d= c #000033", -"e= c #000032", -"f= c #001C79", -"g= c #00217C", -"h= c #002780", -"i= c #002B83", -"j= c #003589", -"k= c #001D63", -"l= c #000F4F", -"m= c #000F4E", -"n= c #001050", -"o= c #001152", -"p= c #001353", -"q= c #001455", -"r= c #002F74", -"s= c #00529A", -"t= c #0058A1", -"u= c #00529D", -"v= c #0156A0", -"w= c #02569F", -"x= c #02549E", -"y= c #03529D", -"z= c #034F9A", -"A= c #032062", -"B= c #020F4E", -"C= c #010C49", -"D= c #000845", -"E= c #00033C", -"F= c #000138", -"G= c #000135", -"H= c #001474", -"I= c #001F7B", -"J= c #00247E", -"K= c #002D83", -"L= c #001051", -"M= c #000A46", -"N= c #000B48", -"O= c #000C4A", -"P= c #000D4B", -"Q= c #000E4D", -"R= c #001151", -"S= c #001253", -"T= c #00377E", -"U= c #004E9A", -"V= c #004C98", -"W= c #00408C", -"X= c #000946", -"Y= c #00053F", -"Z= c #000137", -"`= c #000031", -" - c #000030", -".- c #001373", -"+- c #001876", -"@- c #001D79", -"#- c #00267F", -"$- c #000D4D", -"%- c #000741", -"&- c #000843", -"*- c #000945", -"=- c #000A47", -"-- c #000B49", -";- c #000D4C", -">- c #002F77", -",- c #00327A", -"'- c #002267", -")- c #002166", -"!- c #00256A", -"~- c #003D89", -"{- c #004393", -"]- c #003F90", -"^- c #003C8D", -"/- c #003382", -"(- c #003587", -"_- c #002069", -":- c #00033A", -"<- c #000136", -"[- c #00002F", -"}- c #000C6E", -"|- c #001171", -"1- c #001574", -"2- c #001E7A", -"3- c #00196A", -"4- c #00053E", -"5- c #000640", -"6- c #000742", -"7- c #00185B", -"8- c #003787", -"9- c #00398C", -"0- c #00378B", -"a- c #003388", -"b- c #002779", -"c- c #00063F", -"d- c #00002D", -"e- c #00096C", -"f- c #000D6F", -"g- c #001271", -"h- c #001675", -"i- c #001872", -"j- c #000338", -"k- c #00043A", -"l- c #00043B", -"m- c #00053D", -"n- c #000844", -"o- c #000944", -"p- c #002573", -"q- c #002E85", -"r- c #002C83", -"s- c #001E71", -"t- c #00002E", -"u- c #00002C", -"v- c #000266", -"w- c #00066A", -"x- c #000A6D", -"y- c #000E70", -"z- c #000C58", -"A- c #000643", -"B- c #000337", -"C- c #000236", -"D- c #000339", -"E- c #00053C", -"F- c #00063E", -"G- c #00073F", -"H- c #00145A", -"I- c #001C78", -"J- c #000743", -"K- c #00002A", -"L- c #00005F", -"M- c #000267", -"N- c #000A6C", -"O- c #000952", -"P- c #000131", -"Q- c #000132", -"R- c #000133", -"S- c #000134", -"T- c #000235", -"U- c #00196E", -"V- c #001D7A", -"W- c #001B78", -"X- c #001977", -"Y- c #001775", -"Z- c #001473", -"`- c #000E66", -" ; c #00002B", -".; c #000029", -"+; c #000053", -"@; c #00005E", -"#; c #000265", -"$; c #000464", -"%; c #000130", -"&; c #001160", -"*; c #001164", -"=; c #001674", -"-; c #001272", -";; c #001071", -">; c #000E6F", -",; c #000B6E", -"'; c #00086C", -"); c #00045F", -"!; c #000152", -"~; c #000046", -"{; c #000051", -"]; c #00005A", -"^; c #00012F", -"/; c #000542", -"(; c #00106E", -"_; c #001070", -":; c #000F70", -"<; c #00086B", -"[; c #000367", -"}; c #000163", -"|; c #00005B", -"1; c #000052", -"2; c #000047", -"3; c #000041", -"4; c #000028", -"5; c #000021", -"6; c #000025", -"7; c #00003E", -"8; c #00003A", -"9; c #00075A", -"0; c #00076B", -"a; c #000569", -"b; c #000368", -"c; c #000162", -"d; c #00005C", -"e; c #000054", -"f; c #00004C", -"g; c #000042", -"h; c #000039", -"i; c #000026", -"j; c #000023", -"k; c #000017", -"l; c #00001C", -"m; c #00004D", -"n; c #000055", -"o; c #000027", -"p; c #00003D", -"q; c #000058", -"r; c #00004E", -"s; c #000048", -"t; c #000019", -"u; c #000012", -"v; c #00001D", -"w; c #00001F", -"x; c #000044", -"y; c #000008", -"z; c #000018", -"A; c #000024", -"B; c #000015", -"C; c #000022", -"D; c #00000F", -"E; c #000004", -"F; c #000007", -"G; c #000009", -"H; c #00000C", -"I; c #00000D", -"J; c #00000E", -"K; c #00000A", -"L; c #000003", -"M; c #000000", -"N; c #000001", -"O; c #000005", -"P; c #00000B", -" ", -" ", -" . + @ # $ % & * ", -" = - ; > , ' ) ! ~ { ] ^ / ( _ : ", -" < [ } | 1 2 3 4 5 6 7 8 9 0 a b c d e ", -" f g h i j k l m n o p q r s t u v w x y z A B ", -" C D E F G H I J K L M N O P Q R S T U V W X Y Z ` . ", -" ..+.@.#.$.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|. ", -" 1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s. ", -" t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y. ", -" Z.`. +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+ ", -" 3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+k+l+m+]+n+o+p+q+r+s+t+u+v+w+x+y+ ", -" z+A+B+C+D+E+F+G+H+I+J+K+L+M+f+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@ ", -" &@*@=@-@;@>@,@'@)@!@~@{@]@^@L+/@(@_@:@<@[@}@|@1@2@3@4@5@6@7@8@9@0@a@b@c@d@ ", -" e@f@z+A+B+g@h@i@j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@C@D@E@F@G@H@I@J@K@L@M@ ", -" N@O@P@Q@R@S@T@U@V@W@X@Y@l@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#_# ", -" :#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y# ", -" z#A#B#M@C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$z# ", -" -$;$>$,$O@'$)$!$~${$]$^$/$($_$:$<$[$}$|$1$2$3$4$5$3$6$7$8$ $9$0$a$b$c$d$e$f$g$h$i$ ", -" j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$F$G$G$H$8$I$J$K$L$M$N$O$P$Q$R$S$T$U$k$V$ ", -" W$X$Y$Z$`$ %.%+%p$q$@%#%$%%%&%*%=%-%;%>%,%'%)%p#p#J$!%K$~%{%]%^%/%(%_%:%<%[%}%|%1%2% ", -" 3%4%5%6%7%8%9% %0%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%0$q%r%]%s%t%u%v%w%x%y%z%A%B%C%D%3% ", -" E%F%G%H%I%J%K%8%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% &9+.&+&V.@&#&$&%&&&*&=&-&;&>&,&'&)& ", -" !&~&{&]&G%^&I%J%/&(&7%_& %:&<&[&}&|&1&2&3&4&5&6&7&8&9&0&a&$&b&c&d&e&f&g&h&i&j&k&l&m& ", -" n&o&p&q&r&s&G%t&u&v&w&K%(&x&y&z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&Y&Z& ", -" `& *.*+*p&q&@*#*$*%*^&u&v&J%&***=*-*;*>*,*'*)*!*~*{*]*^*/*(*_*:*<*[*}*|*V&1*l&Y&Z&2* ", -" 3*4*5*6*7*8*p&9*0*a*s&b*c*d*v&e*f*g*h*i*j**$k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*Y&Z&A*z* ", -" B*C*D*E*F*G*H*I*+*p&9*J*r&{&x&K*L*M*N*O*P*Q*R*S*T*U*V*W*X*Y*Z*`* =.=+=@=#=$=%=&=*= ", -" ==-=;=>=,='=)=!=J*.*~=+*{=]=^=/=(=_=:=l$<=[=}=|=1=2=3=4=5=6=7=8=9=0=a=b=c=%=&=d=e= ", -" f=g=h=i=3*j=k=l=m=n=o=p=q=~=8*r=^=b*s=t=j$u=-$v=w=x=y=z=A=B=C=D=z*E=F=A*&=d=e=G= ", -" H===I=J=;=K=L=M=N=O=P=Q=l=n=R=6*S=.*T=D%D%D%U=2%V=V$3%W=J*L=X=Y=$=Z=&=*=e=`= - ", -" .-+-@-g=#-$-%-&-*-M==---O=P=;-Q=m=>-,-'-)-!-~-{-E%]-^-/-(-_-:-<-*=d=e=`=[-[- ", -" }-|-1-==2-3-4-4-5-%-6-&-*-X==-=-N=q&;-O=O=O=7-8-9-0-j=a-`&b-c-d=e=`= -[-d-$= ", -" e-f-g-h-i-4-j-k-l-m-4-c-5-%-6-6-&-&-n-o-o-*-M=p-q-r-3*h=s-X=`= -[-t-u-u- ", -" v-w-x-y-g-z-A-B-C-j-D-:-l-l-E-m-4-F-F-c-c-c-G-H-#-J=g=I=I-J-t-t-d-u-K- ", -" L-M-w-N-f-O-P-Q-R-S-T-C-C-B-j-D-D-:-k-l-k-D=U-V-W-X-Y-Z-`-[- ; ;.;u- ", -" +;@;#;$; ;u-d-t-[- -%;P-Q-R-R-S-B-z*&;*;Y-=;H=-;;;>;,;';);!;%=d- ", -" ~;{;];u-.;K- ; ;u-d-d-d-t-t-^;/;(;_;;;:;f-}-x-<;w-[;};|;1;2; ", -" A*%=3;4;5;6;u-7;8;u-K- ; ; ; ;^;9;<;0;w-a;b;v-c;d;e;f;g;h; ", -" i;j;k;l;d=m;1;n;d= ;i;o;o;o;o;p;@;d;q;+;r;s;3;h;`=K- ", -" t;u;k;o;e=Z&%=5;*=l;v;v;v;w; ;x;3;p;Z&d=d-i;w; ", -" y;u;z;v;5;A;A;B;u;u;u;j; ;.;i;C;v;z;u;D; ", -" E;E;F;G;H;I;I;I;H;D;J;H;K;F;E;K; ", -" y;L;M;M;N;N;M;N;O;P; ", -" ", -" ", -" ", -" "}; diff --git a/mozilla/xulrunner/app/mozilla.in b/mozilla/xulrunner/app/mozilla.in deleted file mode 100755 index 054145548c4..00000000000 --- a/mozilla/xulrunner/app/mozilla.in +++ /dev/null @@ -1,288 +0,0 @@ -#!/bin/sh -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -## $Id: mozilla.in,v 1.2.8.1 2005-09-20 21:13:06 dbaron%dbaron.org Exp $ -## -## Usage: -## -## $ mozilla [args] -## -## This script is meant to run the mozilla-bin binary from either -## mozilla/xpfe/bootstrap or mozilla/dist/bin. -## -## The script will setup all the environment voodoo needed to make -## the mozilla-bin binary to work. -## - -moz_pis_startstop_scripts() -{ - MOZ_USER_DIR="%MOZ_USER_DIR%" - # MOZ_PIS_ is the name space for "Mozilla Plugable Init Scripts" - # These variables and there meaning are specified in - # mozilla/xpfe/bootstrap/init.d/README - MOZ_PIS_API=2 - MOZ_PIS_MOZBINDIR="${dist_bin}" - MOZ_PIS_SESSION_PID="$$" - MOZ_PIS_USER_DIR="${MOZ_USER_DIR}" - export MOZ_PIS_API MOZ_PIS_MOZBINDIR MOZ_PIS_SESSION_PID MOZ_PIS_USER_DIR - - case "${1}" in - "start") - for curr_pis in "${dist_bin}/init.d"/S* "${HOME}/${MOZ_USER_DIR}/init.d"/S* ; do - if [ -x "${curr_pis}" ] ; then - case "${curr_pis}" in - *.sh) . "${curr_pis}" ;; - *) "${curr_pis}" "start" ;; - esac - fi - done - ;; - "stop") - for curr_pis in "${HOME}/${MOZ_USER_DIR}/init.d"/K* "${dist_bin}/init.d"/K* ; do - if [ -x "${curr_pis}" ] ; then - case "${curr_pis}" in - *.sh) . "${curr_pis}" ;; - *) "${curr_pis}" "stop" ;; - esac - fi - done - ;; - *) - echo 1>&2 "$0: Internal error in moz_pis_startstop_scripts." - exit 1 - ;; - esac -} - -#uncomment for debugging -#set -x - -moz_libdir=%MOZAPPDIR% -MRE_HOME=%MREDIR% - -# Use run-mozilla.sh in the current dir if it exists -# If not, then start resolving symlinks until we find run-mozilla.sh -found=0 -progname="$0" -curdir=`dirname "$progname"` -progbase=`basename "$progname"` -profile="" -run_moz="$curdir/run-mozilla.sh" -if test -x "$run_moz"; then - dist_bin="$curdir" - found=1 -else - here=`/bin/pwd` - while [ -h "$progname" ]; do - bn=`basename "$progname"` - cd `dirname "$progname"` - progname=`/bin/ls -l "$bn" | sed -e 's/^.* -> //' ` - if [ ! -x "$progname" ]; then - break - fi - curdir=`dirname "$progname"` - run_moz="$curdir/run-mozilla.sh" - if [ -x "$run_moz" ]; then - cd "$curdir" - dist_bin=`pwd` - found=1 - break - fi - done - cd "$here" -fi -if [ $found = 0 ]; then - # Check default compile-time libdir - if [ -x "$moz_libdir/run-mozilla.sh" ]; then - dist_bin="$moz_libdir" - else - echo "Cannot find mozilla runtime directory. Exiting." - exit 1 - fi -fi - -script_args="" -debugging=0 -MOZILLA_BIN="${progbase}-bin" -MOZ_CLIENT_PROGRAM="$dist_bin/mozilla-xremote-client" - -run_xremote_client() { - if [ -n "${profile}" ]; then - "${run_moz}" "$MOZ_CLIENT_PROGRAM" -a "${progbase}" -p "${profile}" "$1" - else - "${run_moz}" "$MOZ_CLIENT_PROGRAM" -a "${progbase}" "$1" - fi -} - -# The following is to check for a currently running instance. -# This is taken almost verbatim from the Mozilla RPM package's launch script. -check_running() { - run_xremote_client 'ping()' 2>/dev/null >/dev/null - RETURN_VAL=$? - if [ $RETURN_VAL -eq 0 ]; then - echo 1 - return 1 - else - echo 0 - return 0 - fi -} - -if [ "$OSTYPE" = "beos" ]; then - mimeset -F "$MOZILLA_BIN" -fi - -################################################################ Parse Arguments -# If there's a command line argument but it doesn't begin with a - -# it's probably a url. Try to send it to a running instance. -_USE_EXIST=0 -_NEW_WINDOW= -_optOne="$1" -case "${_optOne}" in - -*) - ;; - *) - _USE_EXIST=1 - ;; -esac - -_optOthers= -_optLast= -for i in "$@"; do - _optLast="${i}" -done #last arg - -for i in "$@"; do - [ "$i" = "${_optLast}" ] && break - _optOthers="${_optOthers} ${i}" -done #others arg - -#???: needs check if othersopt begin with -* ? -if [ `expr "${_optLast}" : '.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then - # Last argument seems to be a local file/directory - # Check, if it is absolutely specified (ie. /home/foo/file vs. ./file) - # If it is just "relatively" (./file) specified, make it absolutely - [ `expr "${_optLast}" : '/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}" -elif [ `expr "${_optLast}" : '.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before... - _NEW_WINDOW=1 -fi - -# check for -P argument used to select a user profile -_expectProfileName=0 -for i in "$@"; do - if [ "$i" = "-P" ]; then - _expectProfileName=1 - profile="" - elif [ ${_expectProfileName} = 1 ]; then - _expectProfileName=0 - profile="$i" - fi -done - -################################################################ Parse Arguments - -########################################################################### Main -ALREADY_RUNNING=`check_running` - -if [ $ALREADY_RUNNING -eq 1 ]; then - # There's an instance already running. Use it. - # Any command line args passed in? - if [ $# -gt 0 ]; then - # There were "some" command line args. - if [ ${_USE_EXIST} -eq 1 ]; then - # We should use an existing instance, as _USE_EXIST=$_USE_EXIST=-1 - _open_type="window" - #_open_type="tab" - _remote_cmd="openURL(${_optLast} , new-${_open_type})" - run_xremote_client "${_remote_cmd}" - unset _remote_cmd _open_type - exit $? - fi - else - # No command line args. Open new window/tab - run_xremote_client "xfeDoCommand(openBrowser)" - exit $? - fi -fi -# Default action - no running instance or _USE_EXIST (${_USE_EXIST}) ! -eq 1 -########################################################################### Main - -pass_arg_count=0 -while [ $# -gt $pass_arg_count ] -do - case "$1" in - -p | --pure | -pure) - MOZILLA_BIN="${MOZILLA_BIN}.pure" - shift - ;; - -g | --debug) - script_args="$script_args -g" - debugging=1 - shift - ;; - -d | --debugger) - script_args="$script_args -d $2" - shift 2 - ;; - *) - # Move the unrecognized argument to the end of the list. - arg="$1" - shift - set -- "$@" "$arg" - pass_arg_count=`expr $pass_arg_count + 1` - ;; - esac -done - -export MRE_HOME - -## Start addon scripts -moz_pis_startstop_scripts "start" - -if [ $debugging = 1 ] -then - echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@" -fi -"$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@" -exitcode=$? - -## Stop addon scripts -moz_pis_startstop_scripts "stop" - -exit $exitcode -# EOF. diff --git a/mozilla/xulrunner/app/nsRegisterGRE.h b/mozilla/xulrunner/app/nsRegisterGRE.h deleted file mode 100755 index 3a9576edf5c..00000000000 --- a/mozilla/xulrunner/app/nsRegisterGRE.h +++ /dev/null @@ -1,55 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla XULRunner. - * - * The Initial Developer of the Original Code is - * Benjamin Smedberg . - * - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nsRegisterGRE_h__ -#define nsRegisterGRE_h__ - -#include "nscore.h" -class nsIFile; -struct GREProperty; - -/** - * @return PR_TRUE on success - */ -NS_HIDDEN_(PRBool) -RegisterXULRunner(PRBool aRegisterGlobally, nsIFile* aLocation, - const GREProperty *aProperties, PRUint32 aPropertiesLen); - -NS_HIDDEN_(void) -UnregisterXULRunner(PRBool aUnregisterGlobally, nsIFile* aLocation); - -#endif // nsRegisterGRE_h__ diff --git a/mozilla/xulrunner/app/nsRegisterGREUnix.cpp b/mozilla/xulrunner/app/nsRegisterGREUnix.cpp deleted file mode 100755 index f13cde97881..00000000000 --- a/mozilla/xulrunner/app/nsRegisterGREUnix.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla XULRunner. - * - * The Initial Developer of the Original Code is - * Benjamin Smedberg . - * - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsRegisterGRE.h" -#include "nsXPCOMGlue.h" - -#include "nsIFile.h" -#include "nsILocalFile.h" - -#include "nsBuildID.h" -#include "nsAppRunner.h" // for MAXPATHLEN -#include "nsString.h" -#include "nsINIParser.h" - -#include "prio.h" -#include "prprf.h" -#include "prenv.h" - -#include -#include - -// If we can't register .conf, we try to create a unique filename -// by looping through _.conf, but if something is seriously wrong -// we stop at 1000 -#define UNIQ_LOOP_LIMIT 1000 - -static const char kRegFileGlobal[] = "global.reginfo"; -static const char kRegFileUser[] = "user.reginfo"; -static const char kGREBuildID[] = GRE_BUILD_ID; - -class AutoFDClose -{ -public: - AutoFDClose(PRFileDesc* fd = nsnull) : mFD(fd) { } - ~AutoFDClose() { if (mFD) PR_Close(mFD); } - - PRFileDesc* operator= (PRFileDesc *fd) { - if (mFD) PR_Close(mFD); - mFD = fd; - return fd; - } - - operator PRFileDesc* () { return mFD; } - PRFileDesc** operator &() { *this = nsnull; return &mFD; } - -private: - PRFileDesc *mFD; -}; - -static PRBool -MakeConfFile(const char *regfile, const nsCString &greHome, - const GREProperty *aProperties, PRUint32 aPropertiesLen) -{ - // If the file exists, don't create it again! - if (access(regfile, R_OK) == 0) - return PR_FALSE; - - PRBool ok = PR_TRUE; - - { // scope "fd" so that we can delete the file if something goes wrong - AutoFDClose fd = PR_Open(regfile, PR_CREATE_FILE | PR_WRONLY | PR_TRUNCATE, - 0664); - if (!fd) - return PR_FALSE; - - static const char kHeader[] = - "# Registration file generated by xulrunner. Do not edit.\n\n" - "[" GRE_BUILD_ID "]\n" - "GRE_PATH="; - - if (PR_Write(fd, kHeader, sizeof(kHeader) - 1) != sizeof(kHeader) - 1) - ok = PR_FALSE; - - if (PR_Write(fd, greHome.get(), greHome.Length()) != greHome.Length()) - ok = PR_FALSE; - - for (PRUint32 i = 0; i < aPropertiesLen; ++i) { - if (PR_fprintf(fd, "\n%s=%s", - aProperties[i].property, aProperties[i].value) <= 0) - ok = PR_FALSE; - } - - PR_Write(fd, "\n", 1); - } - - if (!ok) - PR_Delete(regfile); - - return ok; -} - - -PRBool -RegisterXULRunner(PRBool aRegisterGlobally, nsIFile* aLocation, - const GREProperty *aProperties, PRUint32 aPropertiesLen) -{ - // Register ourself in /etc/gre.d or ~/.gre.d/ and record what key we created - // for future unregistration. - - nsresult rv; - - char root[MAXPATHLEN] = "/etc/gre.d"; - - if (!aRegisterGlobally) { - char *home = PR_GetEnv("HOME"); - if (!home || !*home) - return PR_FALSE; - - PR_snprintf(root, MAXPATHLEN, "%s/.gre.d", home); - } - - nsCAutoString greHome; - rv = aLocation->GetNativePath(greHome); - if (NS_FAILED(rv)) - return rv; - - nsCOMPtr savedInfoFile; - aLocation->Clone(getter_AddRefs(savedInfoFile)); - nsCOMPtr localSaved(do_QueryInterface(savedInfoFile)); - if (!localSaved) - return PR_FALSE; - - const char *infoname = aRegisterGlobally ? kRegFileGlobal : kRegFileUser; - localSaved->AppendNative(nsDependentCString(infoname)); - - AutoFDClose fd; - rv = localSaved->OpenNSPRFileDesc(PR_CREATE_FILE | PR_RDWR, 0664, &fd); - // XXX report error? - if (NS_FAILED(rv)) - return PR_FALSE; - - char keyName[MAXPATHLEN]; - - PRInt32 r = PR_Read(fd, keyName, MAXPATHLEN); - if (r < 0) - return PR_FALSE; - - char regfile[MAXPATHLEN]; - - if (r > 0) { - keyName[r] = '\0'; - - PR_snprintf(regfile, MAXPATHLEN, "%s/%s.conf", root, keyName); - - // There was already a .reginfo file, let's see if we are already - // registered. - if (access(regfile, R_OK) == 0) { - fprintf(stderr, "Warning: Configuration file '%s' already exists.\n" - "No action was performed.\n", regfile); - return PR_FALSE; - } - - rv = localSaved->OpenNSPRFileDesc(PR_CREATE_FILE | PR_WRONLY | PR_TRUNCATE, 0664, &fd); - if (NS_FAILED(rv)) - return PR_FALSE; - } - - if (access(root, R_OK | X_OK) && - mkdir(root, 0775)) { - fprintf(stderr, "Error: could not create '%s'.\n", - root); - return PR_FALSE; - } - - PR_snprintf(regfile, MAXPATHLEN, "%s/%s.conf", root, kGREBuildID); - if (MakeConfFile(regfile, greHome, aProperties, aPropertiesLen)) { - PR_Write(fd, kGREBuildID, sizeof(kGREBuildID) - 1); - return PR_TRUE; - } - - for (int i = 0; i < UNIQ_LOOP_LIMIT; ++i) { - static char buildID[30]; - sprintf(buildID, "%s_%i", kGREBuildID, i); - - PR_snprintf(regfile, MAXPATHLEN, "%s/%s.conf", root, buildID); - - if (MakeConfFile(regfile, greHome, aProperties, aPropertiesLen)) { - PR_Write(fd, buildID, strlen(buildID)); - return PR_TRUE; - } - } - - return PR_FALSE; -} - -void -UnregisterXULRunner(PRBool aRegisterGlobally, nsIFile* aLocation) -{ - nsresult rv; - - char root[MAXPATHLEN] = "/etc/gre.d"; - - if (!aRegisterGlobally) { - char *home = PR_GetEnv("HOME"); - if (!home || !*home) - return; - - PR_snprintf(root, MAXPATHLEN, "%s/.gre.d", home); - } - - nsCOMPtr savedInfoFile; - aLocation->Clone(getter_AddRefs(savedInfoFile)); - nsCOMPtr localSaved (do_QueryInterface(savedInfoFile)); - if (!localSaved) - return; - - const char *infoname = aRegisterGlobally ? kRegFileGlobal : kRegFileUser; - localSaved->AppendNative(nsDependentCString(infoname)); - - PRFileDesc* fd = nsnull; - rv = localSaved->OpenNSPRFileDesc(PR_RDONLY, 0, &fd); - if (NS_FAILED(rv)) { - // XXX report error? - return; - } - - char keyName[MAXPATHLEN]; - PRInt32 r = PR_Read(fd, keyName, MAXPATHLEN); - PR_Close(fd); - - localSaved->Remove(PR_FALSE); - - if (r <= 0) - return; - - keyName[r] = '\0'; - - char regFile[MAXPATHLEN]; - PR_snprintf(regFile, MAXPATHLEN, "%s/%s.conf", root, keyName); - - nsCOMPtr lf; - rv = NS_NewNativeLocalFile(nsDependentCString(regFile), PR_FALSE, - getter_AddRefs(lf)); - if (NS_FAILED(rv)) - return; - - nsINIParser p; - rv = p.Init(lf); - if (NS_FAILED(rv)) - return; - - rv = p.GetString(kGREBuildID, "GRE_PATH", root, MAXPATHLEN); - if (NS_FAILED(rv)) - return; - - rv = NS_NewNativeLocalFile(nsDependentCString(root), PR_TRUE, - getter_AddRefs(lf)); - if (NS_FAILED(rv)) - return; - - PRBool eq; - if (NS_SUCCEEDED(aLocation->Equals(lf, &eq)) && eq) - PR_Delete(regFile); -} diff --git a/mozilla/xulrunner/app/nsRegisterGREVoid.cpp b/mozilla/xulrunner/app/nsRegisterGREVoid.cpp deleted file mode 100755 index 4ac07c7688d..00000000000 --- a/mozilla/xulrunner/app/nsRegisterGREVoid.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla XULRunner. - * - * The Initial Developer of the Original Code is - * Benjamin Smedberg . - * - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsRegisterGRE.h" - -#include -#include - -int -RegisterXULRunner(PRBool aRegisterGlobally, nsIFile* aLocation, - const GREProperty *aProperties, PRUint32 aPropertiesLen) -{ - fprintf(stderr, "Registration not implemented on this platform!\n"); - return 1; -} - -void -UnregisterXULRunner(PRBool aUnregisterGlobally, nsIFile* aLocation) -{ - fprintf(stderr, "Registration not implemented on this platform!\n"); -} diff --git a/mozilla/xulrunner/app/nsRegisterGREWin.cpp b/mozilla/xulrunner/app/nsRegisterGREWin.cpp deleted file mode 100755 index 9b7c222acc6..00000000000 --- a/mozilla/xulrunner/app/nsRegisterGREWin.cpp +++ /dev/null @@ -1,272 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla XULRunner. - * - * The Initial Developer of the Original Code is - * Benjamin Smedberg . - * - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsRegisterGRE.h" - -#include "nsIFile.h" -#include "nsILocalFile.h" - -#include "nsBuildID.h" -#include "nsAppRunner.h" // for MAXPATHLEN -#include "nsString.h" -#include "nsXPCOMGlue.h" - -#include "prio.h" - -#include - -static const char kRegKeyRoot[] = "Software\\mozilla.org\\GRE"; -static const char kRegFileGlobal[] = "global.reginfo"; -static const char kRegFileUser[] = "user.reginfo"; - -static nsresult -MakeVersionKey(HKEY root, const char* keyname, const nsCAutoString &grehome, - const GREProperty *aProperties, PRUint32 aPropertiesLen) -{ - HKEY subkey; - DWORD disp; - if (::RegCreateKeyEx(root, keyname, NULL, NULL, 0, KEY_WRITE, NULL, - &subkey, &disp) != ERROR_SUCCESS) - return NS_ERROR_FAILURE; - - if (disp != REG_CREATED_NEW_KEY) { - ::RegCloseKey(subkey); - return NS_ERROR_FAILURE; - } - - PRBool failed = PR_FALSE; - failed |= ::RegSetValueEx(subkey, "Version", NULL, REG_SZ, - (BYTE*) GRE_BUILD_ID, - sizeof(GRE_BUILD_ID) - 1) != ERROR_SUCCESS; - failed |= ::RegSetValueEx(subkey, "GreHome", NULL, REG_SZ, - (BYTE*) grehome.get(), - grehome.Length()) != ERROR_SUCCESS; - - for (PRUint32 i = 0; i < aPropertiesLen; ++i) { - failed |= ::RegSetValueEx(subkey, aProperties[i].property, NULL, REG_SZ, - (BYTE*) aProperties[i].value, - strlen(aProperties[i].value)) != ERROR_SUCCESS; - } - - ::RegCloseKey(subkey); - - if (failed) { - // we created a key but couldn't fill it properly: delete it - ::RegDeleteKey(root, keyname); - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - -int -RegisterXULRunner(PRBool aRegisterGlobally, nsIFile* aLocation, - const GREProperty *aProperties, PRUint32 aPropertiesLen) -{ - // Register ourself in the windows registry, and record what key we created - // for future unregistration. - - nsresult rv; - PRBool irv; - int i; - - nsCAutoString greHome; - rv = aLocation->GetNativePath(greHome); - if (NS_FAILED(rv)) - return rv; - - nsCOMPtr savedInfoFile; - aLocation->Clone(getter_AddRefs(savedInfoFile)); - nsCOMPtr localSaved(do_QueryInterface(savedInfoFile)); - if (!localSaved) - return PR_FALSE; - - const char *infoname = aRegisterGlobally ? kRegFileGlobal : kRegFileUser; - localSaved->AppendNative(nsDependentCString(infoname)); - - PRFileDesc* fd = nsnull; - rv = localSaved->OpenNSPRFileDesc(PR_CREATE_FILE | PR_RDWR, 0664, &fd); - if (NS_FAILED(rv)) { - // XXX report error? - return PR_FALSE; - } - - HKEY rootKey = NULL; - char keyName[MAXPATHLEN]; - PRInt32 r; - - if (::RegCreateKeyEx(aRegisterGlobally ? HKEY_LOCAL_MACHINE : - HKEY_CURRENT_USER, - kRegKeyRoot, NULL, NULL, 0, KEY_WRITE, - NULL, &rootKey, NULL) != ERROR_SUCCESS) { - irv = PR_FALSE; - goto reg_end; - } - - r = PR_Read(fd, keyName, MAXPATHLEN); - if (r < 0) { - irv = PR_FALSE; - goto reg_end; - } - - if (r > 0) { - keyName[r] = '\0'; - - // There was already a .reginfo file, let's see if we are already - // registered. - HKEY existing = NULL; - if (::RegOpenKeyEx(rootKey, keyName, NULL, KEY_QUERY_VALUE, &existing) == - ERROR_SUCCESS) { - fprintf(stderr, "Warning: Registry key Software\\mozilla.org\\GRE\\%s already exists.\n" - "No action was performed.\n", - keyName); - irv = PR_FALSE; - goto reg_end; - } - - PR_Close(fd); - fd = nsnull; - - rv = localSaved->OpenNSPRFileDesc(PR_CREATE_FILE | PR_WRONLY | PR_TRUNCATE, 0664, &fd); - if (NS_FAILED(rv)) { - // XXX report error? - irv = PR_FALSE; - goto reg_end; - } - } - - strcpy(keyName, GRE_BUILD_ID); - rv = MakeVersionKey(rootKey, keyName, greHome, aProperties, aPropertiesLen); - if (NS_SUCCEEDED(rv)) { - PR_Write(fd, keyName, strlen(keyName)); - irv = PR_TRUE; - goto reg_end; - } - - for (i = 0; i < 1000; ++i) { - sprintf(keyName, GRE_BUILD_ID "_%i", i); - rv = MakeVersionKey(rootKey, keyName, greHome, - aProperties, aPropertiesLen); - if (NS_SUCCEEDED(rv)) { - PR_Write(fd, keyName, strlen(keyName)); - irv = PR_TRUE; - goto reg_end; - } - } - - irv = PR_FALSE; - -reg_end: - if (fd) - PR_Close(fd); - - if (rootKey) - ::RegCloseKey(rootKey); - - return irv; -} - -void -UnregisterXULRunner(PRBool aGlobal, nsIFile* aLocation) -{ - nsCOMPtr savedInfoFile; - aLocation->Clone(getter_AddRefs(savedInfoFile)); - nsCOMPtr localSaved (do_QueryInterface(savedInfoFile)); - if (!localSaved) - return; - - const char *infoname = aGlobal ? kRegFileGlobal : kRegFileUser; - localSaved->AppendNative(nsDependentCString(infoname)); - - PRFileDesc* fd = nsnull; - nsresult rv = localSaved->OpenNSPRFileDesc(PR_RDONLY, 0, &fd); - if (NS_FAILED(rv)) { - // XXX report error? - return; - } - - char keyName[MAXPATHLEN]; - PRInt32 r = PR_Read(fd, keyName, MAXPATHLEN); - PR_Close(fd); - - localSaved->Remove(PR_FALSE); - - if (r <= 0) - return; - - keyName[r] = '\0'; - - HKEY rootKey = NULL; - if (::RegOpenKeyEx(aGlobal ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, - kRegKeyRoot, 0, KEY_READ, &rootKey) != ERROR_SUCCESS) - return; - - HKEY subKey = NULL; - if (::RegOpenKeyEx(rootKey, keyName, 0, KEY_READ, &subKey) == ERROR_SUCCESS) { - - char regpath[MAXPATHLEN]; - DWORD reglen = MAXPATHLEN; - - if (::RegQueryValueEx(subKey, "GreHome", NULL, NULL, - (BYTE*) regpath, ®len) == ERROR_SUCCESS) { - - nsCOMPtr regpathfile; - rv = NS_NewNativeLocalFile(nsDependentCString(regpath), PR_FALSE, - getter_AddRefs(regpathfile)); - - PRBool eq; - if (NS_SUCCEEDED(rv) && - NS_SUCCEEDED(aLocation->Equals(regpathfile, &eq)) && !eq) { - // We think we registered for this key, but it doesn't point to - // us any more! - fprintf(stderr, "Warning: Registry key Software\\mozilla.org\\GRE\\%s points to\n" - "alternate path '%s'; unregistration was not successful.\n", - keyName, regpath); - - ::RegCloseKey(subKey); - ::RegCloseKey(rootKey); - - return; - } - } - - ::RegCloseKey(subKey); - } - - ::RegDeleteKey(rootKey, keyName); - ::RegCloseKey(rootKey); -} diff --git a/mozilla/xulrunner/app/nsXULRunnerApp.cpp b/mozilla/xulrunner/app/nsXULRunnerApp.cpp deleted file mode 100644 index a3c8b650734..00000000000 --- a/mozilla/xulrunner/app/nsXULRunnerApp.cpp +++ /dev/null @@ -1,528 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla. - * - * The Initial Developer of the Original Code is IBM Corporation. - * Portions created by IBM Corporation are Copyright (C) 2003 - * IBM Corporation. All Rights Reserved. - * - * Contributor(s): - * Darin Fisher - * Benjamin Smedberg - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include -#include -#ifdef XP_WIN -#include -#endif - -#include "nsXULAppAPI.h" -#include "nsXPCOMGlue.h" -#include "nsRegisterGRE.h" -#include "nsAppRunner.h" -#include "nsINIParser.h" -#include "nsILocalFile.h" -#include "nsIXULAppInstall.h" -#include "nsCOMPtr.h" -#include "nsMemory.h" -#include "nsNativeCharsetUtils.h" -#include "nsBuildID.h" -#include "plstr.h" -#include "prprf.h" -#include "prenv.h" - -/** - * Output a string to the user. This method is really only meant to be used to - * output last-ditch error messages designed for developers NOT END USERS. - * - * @param isError - * Pass true to indicate severe errors. - * @param fmt - * printf-style format string followed by arguments. - */ -static void Output(PRBool isError, const char *fmt, ... ) -{ - va_list ap; - va_start(ap, fmt); - -#if defined(XP_WIN) && !MOZ_WINCONSOLE - char *msg = PR_vsmprintf(fmt, ap); - if (msg) - { - UINT flags = MB_OK; - if (isError) - flags |= MB_ICONERROR; - else - flags |= MB_ICONINFORMATION; - MessageBox(NULL, msg, "XULRunner", flags); - PR_smprintf_free(msg); - } -#else - vfprintf(stderr, fmt, ap); -#endif - - va_end(ap); -} - -/** - * Return true if |arg| matches the given argument name. - */ -static PRBool IsArg(const char* arg, const char* s) -{ - if (*arg == '-') - { - if (*++arg == '-') - ++arg; - return !PL_strcasecmp(arg, s); - } - -#if defined(XP_WIN) || defined(XP_OS2) - if (*arg == '/') - return !PL_strcasecmp(++arg, s); -#endif - - return PR_FALSE; -} - -/** - * Version checking. - */ - -static PRUint32 geckoVersion = 0; - -static PRUint32 ParseVersion(const char *versionStr) -{ - PRUint16 major, minor; - if (PR_sscanf(versionStr, "%hu.%hu", &major, &minor) != 2) { - NS_WARNING("invalid version string"); - return 0; - } - - return PRUint32(major) << 16 | PRUint32(minor); -} - -static PRBool CheckMinVersion(const char *versionStr) -{ - PRUint32 v = ParseVersion(versionStr); - return geckoVersion >= v; -} - -static PRBool CheckMaxVersion(const char *versionStr) -{ - PRUint32 v = ParseVersion(versionStr); - return geckoVersion <= v; -} - -/** - * Parse application data. - */ -static int LoadAppData(const char* appDataFile, nsXREAppData* aResult, - nsCString& vendor, nsCString& name, nsCString& version, - nsCString& buildID, nsCString& appID, - nsCString& copyright) -{ - nsresult rv; - - nsCOMPtr lf; - XRE_GetFileFromPath(appDataFile, getter_AddRefs(lf)); - if (!lf) - return 2; - - nsCOMPtr appDir; - rv = lf->GetParent(getter_AddRefs(appDir)); - if (NS_FAILED(rv)) - return 2; - - rv = CallQueryInterface(appDir, &aResult->directory); - if (NS_FAILED(rv)) - return 2; - - nsINIParser parser; - rv = parser.Init(lf); - if (NS_FAILED(rv)) - return 2; - - // Gecko version checking - // - // TODO: If these version checks fail, then look for a compatible XULRunner - // version on the system, and launch it instead. - - nsCAutoString gkVersion; - rv = parser.GetString("Gecko", "MinVersion", gkVersion); - - if (NS_FAILED(rv) || !CheckMinVersion(gkVersion.get())) { - Output(PR_TRUE, "Error: Gecko MinVersion requirement not met.\n"); - return 1; - } - - rv = parser.GetString("Gecko", "MaxVersion", gkVersion); - if (NS_SUCCEEDED(rv) && !CheckMaxVersion(gkVersion.get())) { - Output(PR_TRUE, "Error: Gecko MaxVersion requirement not met.\n"); - return 1; - } - - PRUint32 i; - - // Read string-valued fields - const struct - { - const char *key; - const char **fill; - nsCString *buf; - PRBool required; - } string_fields[] = { - { "Vendor", &aResult->vendor, &vendor, PR_FALSE }, - { "Name", &aResult->name, &name, PR_TRUE }, - { "Version", &aResult->version, &version, PR_FALSE }, - { "BuildID", &aResult->buildID, &buildID, PR_TRUE }, - { "ID", &aResult->ID, &appID, PR_FALSE }, - { "Copyright", &aResult->copyright, ©right, PR_FALSE } - }; - for (i = 0; i < NS_ARRAY_LENGTH(string_fields); ++i) { - rv = parser.GetString("App", string_fields[i].key, - *string_fields[i].buf); - if (NS_SUCCEEDED(rv)) { - *string_fields[i].fill = string_fields[i].buf->get(); - } - else if (string_fields[i].required) { - Output(PR_TRUE, "Error: %x: No \"%s\" field.\n", - rv, string_fields[i].key); - return 1; - } - } - - // Read boolean-valued fields - const struct { - const char* key; - PRUint32 flag; - } boolean_fields[] = { - { "EnableProfileMigrator", NS_XRE_ENABLE_PROFILE_MIGRATOR }, - { "EnableExtensionManager", NS_XRE_ENABLE_EXTENSION_MANAGER } - }; - char buf[6]; // large enough to hold "false" - aResult->flags = 0; - for (i = 0; i < NS_ARRAY_LENGTH(boolean_fields); ++i) { - rv = parser.GetString("XRE", boolean_fields[i].key, buf, sizeof(buf)); - // accept a truncated result since we are only interested in the - // first character. this is designed to allow the possibility of - // expanding these boolean attributes to express additional options. - if ((NS_SUCCEEDED(rv) || rv == NS_ERROR_LOSS_OF_SIGNIFICANT_DATA) && - (buf[0] == '1' || buf[0] == 't' || buf[0] == 'T')) { - aResult->flags |= boolean_fields[i].flag; - } - } - -#ifdef DEBUG - printf("---------------------------------------------------------\n"); - printf(" Vendor %s\n", aResult->vendor); - printf(" Name %s\n", aResult->name); - printf(" Version %s\n", aResult->version); - printf(" BuildID %s\n", aResult->buildID); - printf(" Copyright %s\n", aResult->copyright); - printf(" Flags %08x\n", aResult->flags); - printf("---------------------------------------------------------\n"); -#endif - - return 0; -} - -static void Usage() -{ - // display additional information (XXX make localizable?) - Output(PR_FALSE, - "Mozilla XULRunner %s\n\n" - "Usage: " XULRUNNER_PROGNAME " [OPTIONS]\n" - " " XULRUNNER_PROGNAME " APP-FILE [APP-OPTIONS...]\n" - "\n" - "OPTIONS\n" - " --app specify APP-FILE (optional)\n" - " -h, --help show this message\n" - " -v, --version show version\n" - " --gre-version print the GRE version string on stdout\n" - " --register-global register this GRE in the machine registry\n" - " --register-user register this GRE in the user registry\n" - " --unregister-global unregister this GRE formerly registered with\n" - " --register-global\n" - " --unregister-user unregister this GRE formely registered with\n" - " --register-user\n" - " --find-gre Find a GRE with version and print\n" - " the path on stdout\n" - " --install-app [ []]\n" - " Install a XUL application.\n" - "\n" - "APP-FILE\n" - " Application initialization file.\n" - "\n" - "APP-OPTIONS\n" - " Application specific options.\n", - GRE_BUILD_ID); -} - -static nsresult -GetXULRunnerDir(const char *argv0, nsIFile* *aResult) -{ - nsresult rv; - - nsCOMPtr appFile; - rv = XRE_GetBinaryPath(argv0, getter_AddRefs(appFile)); - if (NS_FAILED(rv)) { - Output(PR_TRUE, "Could not find XULRunner application path.\n"); - return rv; - } - - rv = appFile->GetParent(aResult); - if (NS_FAILED(rv)) { - Output(PR_TRUE, "Could not find XULRunner installation dir.\n"); - } - return rv; -} - -static int -InstallXULApp(nsIFile* aXULRunnerDir, - const char *aAppLocation, - const char *aInstallTo, - const char *aLeafName) -{ - nsCOMPtr appLocation; - nsCOMPtr installTo; - nsAutoString leafName; - - nsresult rv = XRE_GetFileFromPath(aAppLocation, getter_AddRefs(appLocation)); - if (NS_FAILED(rv)) - return 2; - - if (aInstallTo) { - rv = XRE_GetFileFromPath(aInstallTo, getter_AddRefs(installTo)); - if (NS_FAILED(rv)) - return 2; - } - - if (aLeafName) - NS_CopyNativeToUnicode(nsDependentCString(aLeafName), leafName); - - rv = NS_InitXPCOM2(nsnull, aXULRunnerDir, nsnull); - if (NS_FAILED(rv)) - return 3; - - { - // Scope our COMPtr to avoid holding XPCOM refs beyond xpcom shutdown - nsCOMPtr install - (do_GetService("@mozilla.org/xulrunner/app-install-service;1")); - if (!install) { - rv = NS_ERROR_FAILURE; - } - else { - rv = install->InstallApplication(appLocation, installTo, leafName); - } - } - - NS_ShutdownXPCOM(nsnull); - - if (NS_FAILED(rv)) - return 3; - - return 0; -} - -static const GREProperty kGREProperties[] = { - { "xulrunner", "true" } -#ifdef MOZ_JAVAXPCOM - , { "javaxpcom", "1" } -#endif -}; - -int main(int argc, char* argv[]) -{ - if (argc > 1 && (IsArg(argv[1], "h") || - IsArg(argv[1], "help") || - IsArg(argv[1], "?"))) - { - Usage(); - return 0; - } - - if (argc == 2 && (IsArg(argv[1], "v") || IsArg(argv[1], "version"))) - { - Output(PR_FALSE, "Mozilla XULRunner %s\n", GRE_BUILD_ID); - return 0; - } - - if (argc > 1) { - PRBool registerGlobal = IsArg(argv[1], "register-global"); - PRBool registerUser = IsArg(argv[1], "register-user"); - if (registerGlobal || registerUser) { - if (argc != 2) { - Usage(); - return 1; - } - - nsCOMPtr regDir; - nsresult rv = GetXULRunnerDir(argv[0], getter_AddRefs(regDir)); - if (NS_FAILED(rv)) - return 2; - - return RegisterXULRunner(registerGlobal, regDir, - kGREProperties, - NS_ARRAY_LENGTH(kGREProperties)) ? 0 : 2; - } - - registerGlobal = IsArg(argv[1], "unregister-global"); - registerUser = IsArg(argv[1], "unregister-user"); - if (registerGlobal || registerUser) { - if (argc != 2) { - Usage(); - return 1; - } - - nsCOMPtr regDir; - nsresult rv = GetXULRunnerDir(argv[0], getter_AddRefs(regDir)); - if (NS_FAILED(rv)) - return 2; - UnregisterXULRunner(registerGlobal, regDir); - return 0; - } - - if (IsArg(argv[1], "find-gre")) { - if (argc != 3) { - Usage(); - return 1; - } - - char path[MAXPATHLEN]; - static const GREVersionRange vr = { - argv[2], PR_TRUE, - argv[2], PR_TRUE - }; - static const GREProperty kProperties[] = { - { "xulrunner", "true" } - }; - - nsresult rv = GRE_GetGREPathWithProperties(&vr, 1, kProperties, - NS_ARRAY_LENGTH(kProperties), - path, sizeof(path)); - if (NS_FAILED(rv)) - return 1; - - printf("%s\n", path); - return 0; - } - - if (IsArg(argv[1], "gre-version")) { - if (argc != 2) { - Usage(); - return 1; - } - - printf("%s\n", GRE_BUILD_ID); - return 0; - } - - if (IsArg(argv[1], "install-app")) { - if (argc < 3 || argc > 5) { - Usage(); - return 1; - } - - char *appLocation = argv[2]; - - char *installTo = nsnull; - if (argc > 3) { - installTo = argv[3]; - if (!*installTo) // left blank? - installTo = nsnull; - } - - char *leafName = nsnull; - if (argc > 4) { - leafName = argv[4]; - if (!*leafName) - leafName = nsnull; - } - - nsCOMPtr regDir; - nsresult rv = GetXULRunnerDir(argv[0], getter_AddRefs(regDir)); - if (NS_FAILED(rv)) - return 2; - - return InstallXULApp(regDir, appLocation, installTo, leafName); - } - } - - geckoVersion = ParseVersion(GRE_BUILD_ID); - - const char *appDataFile = PR_GetEnv("XUL_APP_FILE"); - - if (!(appDataFile && *appDataFile)) { - if (argc < 2) { - Usage(); - return 1; - } - - if (IsArg(argv[1], "app")) { - if (argc == 2) { - Usage(); - return 1; - } - argv[1] = argv[0]; - ++argv; - --argc; - } - - appDataFile = argv[1]; - argv[1] = argv[0]; - ++argv; - --argc; - - static char kAppEnv[MAXPATHLEN]; - PR_snprintf(kAppEnv, MAXPATHLEN, "XUL_APP_FILE=%s", appDataFile); - PR_SetEnv(kAppEnv); - } - - nsCAutoString vendor, name, version, buildID, appID, copyright; - - nsXREAppData appData = { sizeof(nsXREAppData), 0 }; - - int rv = LoadAppData(appDataFile, &appData, - vendor, name, version, buildID, appID, copyright); - if (!rv) - rv = XRE_main(argc, argv, &appData); - - NS_IF_RELEASE(appData.directory); - - return rv; -} - -#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__) -// We need WinMain in order to not be a console app. This function is -// unused if we are a console application. -int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR args, int ) -{ - // Do the real work. - return main( __argc, __argv ); -} -#endif diff --git a/mozilla/xulrunner/app/profile/Makefile.in b/mozilla/xulrunner/app/profile/Makefile.in deleted file mode 100644 index 9d6ede6865a..00000000000 --- a/mozilla/xulrunner/app/profile/Makefile.in +++ /dev/null @@ -1,59 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1998 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -DIRS = chrome extensions - -include $(topsrcdir)/config/rules.mk - -FILES := \ - localstore.rdf \ - $(NULL) - -libs:: $(FILES) - $(INSTALL) $^ $(DIST)/bin/defaults/profile - $(INSTALL) $^ $(DIST)/bin/defaults/profile/US - -install:: $(FILES) - $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/defaults/profile - $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/defaults/profile/US diff --git a/mozilla/xulrunner/app/profile/chrome/Makefile.in b/mozilla/xulrunner/app/profile/chrome/Makefile.in deleted file mode 100644 index df06bb4d5f3..00000000000 --- a/mozilla/xulrunner/app/profile/chrome/Makefile.in +++ /dev/null @@ -1,60 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# a mozilla.org contributor. -# Portions created by the Initial Developer are Copyright (C) 2004 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk -include $(topsrcdir)/config/rules.mk - -FILES := \ - userContent-example.css \ - userChrome-example.css \ - $(NULL) - -FILES := $(addprefix $(srcdir)/, $(FILES)) - -libs:: - $(INSTALL) $(FILES) $(DIST)/bin/defaults/profile/chrome - $(INSTALL) $(FILES) $(DIST)/bin/defaults/profile/US/chrome - -install:: - $(SYSINSTALL) $(IFLAGS1) $(FILES) $(DESTDIR)$(mozappdir)/defaults/profile/chrome - $(NSINSTALL) -t $(IFLAGS1) $(FILES) $(DESTDIR)$(mozappdir)/defaults/profile/US/chrome - diff --git a/mozilla/xulrunner/app/profile/chrome/userChrome-example.css b/mozilla/xulrunner/app/profile/chrome/userChrome-example.css deleted file mode 100644 index 5a07a62520e..00000000000 --- a/mozilla/xulrunner/app/profile/chrome/userChrome-example.css +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Edit this file and copy it as userChrome.css into your - * profile-directory/chrome/ - */ - -/* - * This file can be used to customize the look of Mozilla's user interface - * You should consider using !important on rules which you want to - * override default settings. - */ - -/* - * Do not remove the @namespace line -- it's required for correct functioning - */ -@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */ - - -/* - * Some possible accessibility enhancements: - */ -/* - * Make all the default font sizes 20 pt: - * - * * { - * font-size: 20pt !important - * } - */ -/* - * Make menu items in particular 15 pt instead of the default size: - * - * menupopup > * { - * font-size: 15pt !important - * } - */ -/* - * Give the Location (URL) Bar a fixed-width font - * - * #urlbar { - * font-family: monospace !important; - * } - */ - -/* - * Eliminate the throbber and its annoying movement: - * - * #throbber-box { - * display: none !important; - * } - */ - -/* - * For more examples see http://www.mozilla.org/unix/customizing.html - */ - diff --git a/mozilla/xulrunner/app/profile/chrome/userContent-example.css b/mozilla/xulrunner/app/profile/chrome/userContent-example.css deleted file mode 100644 index bd796919f9e..00000000000 --- a/mozilla/xulrunner/app/profile/chrome/userContent-example.css +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Edit this file and copy it as userContent.css into your - * profile-directory/chrome/ - */ - -/* - * This file can be used to apply a style to all web pages you view - * Rules without !important are overruled by author rules if the - * author sets any. Rules with !important overrule author rules. - */ - -/* - * example: turn off "blink" element blinking - * - * blink { text-decoration: none ! important; } - * - */ - -/* - * example: give all tables a 2px border - * - * table { border: 2px solid; } - */ - -/* - * example: turn off "marquee" element - * - * marquee { -moz-binding: none; } - * - */ - -/* - * For more examples see http://www.mozilla.org/unix/customizing.html - */ - diff --git a/mozilla/xulrunner/app/profile/extensions/Extensions.rdf b/mozilla/xulrunner/app/profile/extensions/Extensions.rdf deleted file mode 100644 index a2a8d97c507..00000000000 --- a/mozilla/xulrunner/app/profile/extensions/Extensions.rdf +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - diff --git a/mozilla/xulrunner/app/profile/extensions/Makefile.in b/mozilla/xulrunner/app/profile/extensions/Makefile.in deleted file mode 100644 index e1cd75f23ea..00000000000 --- a/mozilla/xulrunner/app/profile/extensions/Makefile.in +++ /dev/null @@ -1,59 +0,0 @@ -# -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is -# a mozilla.org contributor. -# Portions created by the Initial Developer are Copyright (C) 2004 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -include $(topsrcdir)/config/rules.mk - -FILES := \ - Extensions.rdf \ - $(NULL) - -FILES := $(addprefix $(srcdir)/, $(FILES)) - -libs:: - $(INSTALL) $(FILES) $(DIST)/bin/defaults/profile/extensions - $(INSTALL) $(srcdir)/"installed-extensions.txt" $(DIST)/bin/defaults/profile/extensions - -install:: - $(SYSINSTALL) $(IFLAGS1) $(FILES) $(DESTDIR)$(mozappdir)/defaults/profile/extensions - $(SYSINSTALL) $(IFLAGS1) $(srcdir)/"installed-extensions.txt" $(DESTDIR)$(mozappdir)/defaults/profile/extensions diff --git a/mozilla/xulrunner/app/profile/extensions/installed-extensions.txt b/mozilla/xulrunner/app/profile/extensions/installed-extensions.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mozilla/xulrunner/app/profile/localstore.rdf b/mozilla/xulrunner/app/profile/localstore.rdf deleted file mode 100644 index aa5d4d94f3a..00000000000 --- a/mozilla/xulrunner/app/profile/localstore.rdf +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/mozilla/xulrunner/app/splash.rc b/mozilla/xulrunner/app/splash.rc deleted file mode 100644 index cd2eb07187f..00000000000 --- a/mozilla/xulrunner/app/splash.rc +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Bill Law law@netscape.com - * Jonathan Wilson - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include -#include "nsNativeAppSupportWin.h" - -1 24 "xulrunner.exe.manifest" - -IDI_APPICON ICON XULRUNNER_ICO -IDI_DOCUMENT ICON DOCUMENT_ICO -IDI_APPLICATION ICON XULRUNNER_ICO - -STRINGTABLE DISCARDABLE -BEGIN -#ifdef DEBUG - IDS_STARTMENU_APPNAME, "Firefox Debug" -#else - IDS_STARTMENU_APPNAME, "Firefox" -#endif -END - -#ifdef MOZ_STATIC_BUILD - -// XXX This code is copied from resource.h and widget.rc. It's a work-around -// for the limitation that only one resource file can be used in an .exe. We -// should develop a method, for static builds only, to combine multiple .rc -// files into a single .rc file, and then use that to build the single .res -// file for the .exe. - -// We need this cursor for versions of Windows that don't support IDC_HAND, -// namely Win95 and NT4. -#define IDC_SELECTANCHOR 4100 -#define IDC_GRAB 4101 -#define IDC_GRABBING 4102 -#define IDC_CELL 4103 -#define IDC_COPY 4104 -#define IDC_ALIAS 4105 -#define IDC_ZOOMIN 4106 -#define IDC_ZOOMOUT 4107 -#define IDC_COLRESIZE 4108 -#define IDC_ROWRESIZE 4109 -#define IDC_VERTICALTEXT 4110 - -IDC_SELECTANCHOR CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\select.cur" -IDC_GRAB CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\grab.cur" -IDC_GRABBING CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\grabbing.cur" -IDC_CELL CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\cell.cur" -IDC_COPY CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\copy.cur" -IDC_ALIAS CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\aliasb.cur" -IDC_ZOOMIN CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\zoom_in.cur" -IDC_ZOOMOUT CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\zoom_out.cur" -IDC_COLRESIZE CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\col_resize.cur" -IDC_ROWRESIZE CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\row_resize.cur" -IDC_VERTICALTEXT CURSOR DISCARDABLE "..\\..\\widget\\src\\build\\res\\vertical_text.cur" - -#endif diff --git a/mozilla/xulrunner/app/splashos2.rc b/mozilla/xulrunner/app/splashos2.rc deleted file mode 100644 index 6aa82fc21d4..00000000000 --- a/mozilla/xulrunner/app/splashos2.rc +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Bill Law law@netscape.com - * IBM Corp. - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include - -// Splash screen dialog ID. -#define IDD_SPLASH 100 - -// Splash screen bitmap ID. -#define IDB_SPLASH 101 - -ICON 1 XULRUNNER_ICO - -DLGTEMPLATE IDD_SPLASH DISCARDABLE -BEGIN - DIALOG "", IDD_SPLASH, 0, 0, 390, 261, , FCF_BORDER - BEGIN - END -END - -//BITMAP IDB_SPLASH "splash.bmp" - -#ifdef MOZ_STATIC_BUILD -#include "wdgtos2rc.h" - -POINTER IDC_SELECTANCHOR "..\\..\\widget\\src\\os2\\res\\select.ptr" -POINTER IDC_GRAB "..\\..\\widget\\src\\os2\\res\\grab.ptr" -POINTER IDC_GRABBING "..\\..\\widget\\src\\os2\\res\\grabbing.ptr" -POINTER IDC_CELL "..\\..\\widget\\src\\os2\\res\\cell.ptr" -POINTER IDC_COPY "..\\..\\widget\\src\\os2\\res\\copy.ptr" -POINTER IDC_ALIAS "..\\..\\widget\\src\\os2\\res\\aliasb.ptr" -POINTER IDC_ZOOMIN "..\\..\\widget\\src\\os2\\res\\zoom_in.ptr" -POINTER IDC_ZOOMOUT "..\\..\\widget\\src\\os2\\res\\zoom_out.ptr" - -POINTER IDC_ARROWWAIT "..\\..\\widget\\src\\os2\\res\\arrow_wait.ptr" -POINTER IDC_CROSS "..\\..\\widget\\src\\os2\\res\\crosshair.ptr" -POINTER IDC_HELP "..\\..\\widget\\src\\os2\\res\\help.ptr" - -ICON IDC_DNDURL "..\\..\\widget\\src\\os2\\res\\dndurl.ico" -ICON IDC_DNDTEXT "..\\..\\widget\\src\\os2\\res\\dndtext.ico" -#endif diff --git a/mozilla/xulrunner/app/xulrunner-os2.ico b/mozilla/xulrunner/app/xulrunner-os2.ico deleted file mode 100644 index 560d198b326..00000000000 Binary files a/mozilla/xulrunner/app/xulrunner-os2.ico and /dev/null differ diff --git a/mozilla/xulrunner/app/xulrunner.exe.manifest b/mozilla/xulrunner/app/xulrunner.exe.manifest deleted file mode 100644 index 09c28623738..00000000000 --- a/mozilla/xulrunner/app/xulrunner.exe.manifest +++ /dev/null @@ -1,22 +0,0 @@ - - - -Mozilla Thunderbird - - - - - - diff --git a/mozilla/xulrunner/app/xulrunner.ico b/mozilla/xulrunner/app/xulrunner.ico deleted file mode 100644 index 0518438a040..00000000000 Binary files a/mozilla/xulrunner/app/xulrunner.ico and /dev/null differ diff --git a/mozilla/xulrunner/app/xulrunner.js b/mozilla/xulrunner/app/xulrunner.js deleted file mode 100644 index e89e6bde410..00000000000 --- a/mozilla/xulrunner/app/xulrunner.js +++ /dev/null @@ -1,56 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Google Inc. - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Darin Fisher - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#filter substitution - -// We need to override the default values of these preferences since all.js -// assumes these are in the navigator package, which for us is non-existant. -// XXX(darin): perhaps all.js should not be seamonkey specific -pref("general.useragent.locale", "@AB_CD@"); -pref("font.language.group", "chrome://global/locale/intl.properties"); -pref("intl.accept_languages", "chrome://global/locale/intl.properties"); -pref("intl.collationOption", "chrome://global-platform/locale/intl.properties"); -pref("intl.charsetmenu.browser.static", "chrome://global/locale/intl.properties"); -pref("intl.charsetmenu.browser.more1", "chrome://global/locale/intl.properties"); -pref("intl.charsetmenu.browser.more2", "chrome://global/locale/intl.properties"); -pref("intl.charsetmenu.browser.more3", "chrome://global/locale/intl.properties"); -pref("intl.charsetmenu.browser.more4", "chrome://global/locale/intl.properties"); -pref("intl.charsetmenu.browser.more5", "chrome://global/locale/intl.properties"); -pref("intl.charsetmenu.browser.unicode", "chrome://global/locale/intl.properties"); -pref("intl.charset.detector", "chrome://global/locale/intl.properties"); -pref("intl.charset.default", "chrome://global-platform/locale/intl.properties"); -pref("intl.menuitems.alwaysappendaccesskeys","chrome://global/locale/intl.properties"); -pref("intl.menuitems.insertseparatorbeforeaccesskeys","chrome://global/locale/intl.properties"); diff --git a/mozilla/xulrunner/config/mozconfig b/mozilla/xulrunner/config/mozconfig deleted file mode 100644 index 0ec33a80aaa..00000000000 --- a/mozilla/xulrunner/config/mozconfig +++ /dev/null @@ -1,7 +0,0 @@ - -# This file specifies the build flags for XULRunner. You can use it by adding: -# . $topsrcdir/xulrunner/config/mozconfig -# to the top of your mozconfig file. - -mk_add_options MOZ_CO_PROJECT=xulrunner -ac_add_options --enable-application=xulrunner diff --git a/mozilla/xulrunner/examples/Makefile.in b/mozilla/xulrunner/examples/Makefile.in deleted file mode 100644 index aedf89b88b8..00000000000 --- a/mozilla/xulrunner/examples/Makefile.in +++ /dev/null @@ -1,47 +0,0 @@ -# vim:set ts=8 sw=8 sts=8 et: -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the Mozilla Browser code. -# -# The Initial Developer of the Original Code is IBM Corporation. -# Portions created by IBM Corporation are Copyright (C) 2004 -# IBM Corporation. All Rights Reserved. -# -# Contributor(s): -# Darin Fisher -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -DIRS = simple - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xulrunner/examples/simple/Makefile.in b/mozilla/xulrunner/examples/simple/Makefile.in deleted file mode 100644 index afd6d6236f5..00000000000 --- a/mozilla/xulrunner/examples/simple/Makefile.in +++ /dev/null @@ -1,66 +0,0 @@ -# vim:set ts=8 sw=8 sts=8 noet: -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the Mozilla Browser code. -# -# The Initial Developer of the Original Code is Google Inc. -# Portions created by the Initial Developer are Copyright (C) 2005 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Darin Fisher -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = simple -XPI_NAME = simple - -DIRS = components - -PREF_JS_EXPORTS = $(srcdir)/simple-prefs.js -DIST_FILES = application.ini -DIST_CHROME_FILES = chrome.manifest - -ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT))) -ICONS = icons/simple.ico -endif -ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT))) -ICONS = icons/simple.xpm icons/simple16.xpm -endif - -include $(topsrcdir)/config/rules.mk - -ifneq (,$(ICONS)) -libs:: $(ICONS) - $(INSTALL) $^ $(FINAL_TARGET)/chrome/icons/default -endif diff --git a/mozilla/xulrunner/examples/simple/application.ini b/mozilla/xulrunner/examples/simple/application.ini deleted file mode 100644 index dcb631af5d4..00000000000 --- a/mozilla/xulrunner/examples/simple/application.ini +++ /dev/null @@ -1,43 +0,0 @@ -#filter substitution -[App] -; -; This field specifies your organization's name. This field is recommended, -; but optional. -Vendor=MozillaTest -; -; This field specifies your application's name. This field is required. -Name=Simple -; -; This field specifies your application's version. This field is required. -Version=0.1 -; -; This field specifies your application's build ID (timestamp). This field is -; required. -BuildID=@BUILD_ID@ -; -; This field specifies a compact copyright notice for your application. This -; field is optional. -Copyright=Copyright (c) 2004 Mozilla.org -; -; This ID is just an example. Every XUL app ought to have it's own unique ID. -; You can use the microsoft "guidgen" or "uuidgen" tools, or go on -; irc.mozilla.org and /msg botbot uuid. This field is optional. -ID={3aea3f07-ffe3-4060-bb03-bff3a5365e90} - -[Gecko] -; -; This field is required. It specifies the minimum Gecko version that this -; application requires. -MinVersion=@MOZILLA_VERSION_U@ -; -; This field is optional. It specifies the maximum Gecko version that this -; application requires. It should be specified if your application uses -; unfrozen interfaces. -MaxVersion=@MOZILLA_VERSION_U@ - -[Shell] -; -; This field specifies the location of your application's main icon with file -; extension excluded. NOTE: Unix style file separators are required. This -; field is optional. -Icon=chrome/icons/default/simple diff --git a/mozilla/xulrunner/examples/simple/chrome.manifest b/mozilla/xulrunner/examples/simple/chrome.manifest deleted file mode 100644 index 4892cea0f19..00000000000 --- a/mozilla/xulrunner/examples/simple/chrome.manifest +++ /dev/null @@ -1,2 +0,0 @@ -content simple jar:simple.jar!/content/simple/ -locale simple en-US jar:en-US.jar!/locale/en-US/simple/ diff --git a/mozilla/xulrunner/examples/simple/components/Makefile.in b/mozilla/xulrunner/examples/simple/components/Makefile.in deleted file mode 100644 index 9f67c0554e1..00000000000 --- a/mozilla/xulrunner/examples/simple/components/Makefile.in +++ /dev/null @@ -1,47 +0,0 @@ -# vim:set ts=8 sw=8 sts=8 noet: -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the Mozilla Browser code. -# -# The Initial Developer of the Original Code is Google Inc. -# Portions created by the Initial Developer are Copyright (C) 2005 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Darin Fisher -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -DIRS = public src - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xulrunner/examples/simple/components/public/Makefile.in b/mozilla/xulrunner/examples/simple/components/public/Makefile.in deleted file mode 100644 index 0aaf7e9e6d4..00000000000 --- a/mozilla/xulrunner/examples/simple/components/public/Makefile.in +++ /dev/null @@ -1,50 +0,0 @@ -# vim:set ts=8 sw=8 sts=8 noet: -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the Mozilla Browser code. -# -# The Initial Developer of the Original Code is Google Inc. -# Portions created by the Initial Developer are Copyright (C) 2005 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Darin Fisher -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = simple -XPI_NAME = simple - -XPIDLSRCS = nsISimpleTest.idl - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xulrunner/examples/simple/components/public/nsISimpleTest.idl b/mozilla/xulrunner/examples/simple/components/public/nsISimpleTest.idl deleted file mode 100644 index f2d530c956b..00000000000 --- a/mozilla/xulrunner/examples/simple/components/public/nsISimpleTest.idl +++ /dev/null @@ -1,47 +0,0 @@ -/* vim:set ts=2 sw=2 sts=2 et cin: */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Google Inc. - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Darin Fisher - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsISupports.idl" - -[scriptable, uuid(f2f71d91-0451-47ec-aaa0-166663a7711a)] -interface nsISimpleTest : nsISupports -{ - /** - * This interface adds two numbers together and returns the result. - */ - long add(in long a, in long b); -}; diff --git a/mozilla/xulrunner/examples/simple/components/src/Makefile.in b/mozilla/xulrunner/examples/simple/components/src/Makefile.in deleted file mode 100644 index 4e38db8a0c8..00000000000 --- a/mozilla/xulrunner/examples/simple/components/src/Makefile.in +++ /dev/null @@ -1,62 +0,0 @@ -# vim:set ts=8 sw=8 sts=8 noet: -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the Mozilla Browser code. -# -# The Initial Developer of the Original Code is Google Inc. -# Portions created by the Initial Developer are Copyright (C) 2005 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Darin Fisher -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -DEPTH = ../../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = simple -XPI_NAME = simple -LIBRARY_NAME = simpletest -ifneq ($(OS_ARCH),WINNT) -SHORT_LIBNAME = simpltst -endif -IS_COMPONENT = 1 - -CPPSRCS = SimpleTest.cpp - -EXTRA_DSO_LDOPTS = \ - $(XPCOM_GLUE_LDOPTS) \ - $(NSPR_LIBS) \ - $(NULL) - -EXTRA_COMPONENTS = $(srcdir)/SimpleTest.js - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xulrunner/examples/simple/components/src/SimpleTest.cpp b/mozilla/xulrunner/examples/simple/components/src/SimpleTest.cpp deleted file mode 100644 index f360d2cdc8d..00000000000 --- a/mozilla/xulrunner/examples/simple/components/src/SimpleTest.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* vim:set ts=2 sw=2 sts=2 et cin: */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Google Inc. - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Darin Fisher - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include -#include "nsISimpleTest.h" -#include "nsIGenericFactory.h" - -class SimpleTest : public nsISimpleTest -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSISIMPLETEST -}; - -NS_IMPL_ISUPPORTS1(SimpleTest, nsISimpleTest) - -NS_IMETHODIMP -SimpleTest::Add(PRInt32 a, PRInt32 b, PRInt32 *r) -{ - printf("add(%d,%d) from C++\n", a, b); - - *r = a + b; - return NS_OK; -} - -NS_GENERIC_FACTORY_CONSTRUCTOR(SimpleTest) - -// 5e14b432-37b6-4377-923b-c987418d8429 -#define SIMPLETEST_CID \ - { 0x5e14b432, 0x37b6, 0x4377, \ - { 0x92, 0x3b, 0xc9, 0x87, 0x41, 0x8d, 0x84, 0x29 } } - -static const nsModuleComponentInfo components[] = -{ - { "SimpleTest in C++", - SIMPLETEST_CID, - "@test.mozilla.org/simple-test;1?impl=c++", - SimpleTestConstructor - } -}; - -NS_IMPL_NSGETMODULE(SimpleTestModule, components) diff --git a/mozilla/xulrunner/examples/simple/components/src/SimpleTest.js b/mozilla/xulrunner/examples/simple/components/src/SimpleTest.js deleted file mode 100644 index c7de686c51c..00000000000 --- a/mozilla/xulrunner/examples/simple/components/src/SimpleTest.js +++ /dev/null @@ -1,108 +0,0 @@ -/* vim:set ts=2 sw=2 sts=2 et cin: */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Google Inc. - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Darin Fisher - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -const SIMPLETEST_CONTRACTID = "@test.mozilla.org/simple-test;1?impl=js"; -const SIMPLETEST_CLASSID = Components.ID("{4177e257-a0dc-49b9-a774-522a000a49fa}"); - -function SimpleTest() { -} - -SimpleTest.prototype = { - QueryInterface: function(iid) { - if (iid.equals(Components.interfaces.nsISimpleTest) || - iid.equals(Components.interfaces.nsISupports)) - return this; - throw Components.results.NS_ERROR_NO_INTERFACE; - }, - - add: function(a, b) { - dump("add(" + a + "," + b + ") from JS\n"); - return a + b; - } -}; - -var Module = { - _classes: { - simpletest: { - classID : SIMPLETEST_CLASSID, - contractID : SIMPLETEST_CONTRACTID, - className : "SimpleTest", - factory : { - createInstance: function(delegate, iid) { - if (delegate) - throw Components.results.NS_ERROR_NO_AGGREGATION; - return new SimpleTest().QueryInterface(iid); - } - } - } - }, - - registerSelf: function(compMgr, fileSpec, location, type) - { - var reg = compMgr.QueryInterface( - Components.interfaces.nsIComponentRegistrar); - - for (var key in this._classes) { - var c = this._classes[key]; - reg.registerFactoryLocation(c.classID, c.className, c.contractID, - fileSpec, location, type); - } - }, - - getClassObject: function(compMgr, cid, iid) - { - if (!iid.equals(Components.interfaces.nsIFactory)) - throw Components.results.NS_ERROR_NO_INTERFACE; - - for (var key in this._classes) { - var c = this._classes[key]; - if (cid.equals(c.classID)) - return c.factory; - } - - throw Components.results.NS_ERROR_NOT_IMPLEMENTED; - }, - - canUnload: function (aComponentManager) - { - return true; - } -}; - -function NSGetModule(compMgr, fileSpec) { - return Module; -} diff --git a/mozilla/xulrunner/examples/simple/content/contents.rdf b/mozilla/xulrunner/examples/simple/content/contents.rdf deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/mozilla/xulrunner/examples/simple/content/simple.js b/mozilla/xulrunner/examples/simple/content/simple.js deleted file mode 100644 index 6ca4adadfa0..00000000000 --- a/mozilla/xulrunner/examples/simple/content/simple.js +++ /dev/null @@ -1,49 +0,0 @@ -/* vim:set ts=2 sw=2 sts=2 et cin: */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Google Inc. - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Darin Fisher - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -function onButtonClick() { - var textbox = document.getElementById("textbox"); - - var contractid = (textbox.value % 2 == 0) ? - "@test.mozilla.org/simple-test;1?impl=js" : - "@test.mozilla.org/simple-test;1?impl=c++"; - - var test = Components.classes[contractid]. - createInstance(Components.interfaces.nsISimpleTest); - - textbox.value = test.add(textbox.value, 1); -} diff --git a/mozilla/xulrunner/examples/simple/content/simple.xul b/mozilla/xulrunner/examples/simple/content/simple.xul deleted file mode 100644 index 1707c877a6d..00000000000 --- a/mozilla/xulrunner/examples/simple/content/simple.xul +++ /dev/null @@ -1,52 +0,0 @@ - -# vim:set ts=8 sw=8 sts=8 noet: -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the Mozilla Browser code. -# -# The Initial Developer of the Original Code is Google Inc. -# Portions created by the Initial Developer are Copyright (C) 2005 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Darin Fisher -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - - - - - - -