| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 # based on an almost identical script by: jyrki@google.com (Jyrki Alakuijala) | 5 # based on an almost identical script by: jyrki@google.com (Jyrki Alakuijala) |
| 6 | 6 |
| 7 """Prints out include dependencies in chrome. | 7 """Prints out include dependencies in chrome. |
| 8 | 8 |
| 9 Since it ignores defines, it gives just a rough estimation of file size. | 9 Since it ignores defines, it gives just a rough estimation of file size. |
| 10 | 10 |
| 11 Usage: | 11 Usage: |
| 12 tools/include_tracer.py chrome/browser/ui/browser.h | 12 tools/include_tracer.py chrome/browser/ui/browser.h |
| 13 """ | 13 """ |
| 14 | 14 |
| 15 import os | 15 import os |
| 16 import sys | 16 import sys |
| 17 | 17 |
| 18 # Created by copying the command line for prerender_browsertest.cc, replacing | 18 # Created by copying the command line for prerender_browsertest.cc, replacing |
| 19 # spaces with newlines, and dropping everything except -F and -I switches. | 19 # spaces with newlines, and dropping everything except -F and -I switches. |
| 20 # TODO(port): Add windows, linux directories. | 20 # TODO(port): Add windows, linux directories. |
| 21 INCLUDE_PATHS = [ | 21 INCLUDE_PATHS = [ |
| 22 '', | 22 '', |
| 23 'gpu', | 23 'gpu', |
| 24 'skia/config', | 24 'skia/config', |
| 25 'skia/ext', | 25 'skia/ext', |
| 26 'testing/gmock/include', | 26 'testing/gmock/include', |
| 27 'testing/gtest/include', | 27 'testing/gtest/include', |
| 28 'third_party/GTM', | 28 'third_party/GTM', |
| 29 'third_party/WebKit/Source', | 29 'third_party/WebKit/Source', |
| 30 'third_party/WebKit/Source/JavaScriptCore', | 30 'third_party/WebKit/Source/wtf', |
| 31 'third_party/WebKit/Source/JavaScriptCore/wtf', | 31 'third_party/WebKit/Source/core', |
| 32 'third_party/WebKit/Source/ThirdParty/glu', | 32 'third_party/WebKit/Source/core/accessibility', |
| 33 'third_party/WebKit/Source/WebCore', | 33 'third_party/WebKit/Source/core/accessibility/chromium', |
| 34 'third_party/WebKit/Source/WebCore/accessibility', | 34 'third_party/WebKit/Source/core/bindings', |
| 35 'third_party/WebKit/Source/WebCore/accessibility/chromium', | 35 'third_party/WebKit/Source/core/bindings/generic', |
| 36 'third_party/WebKit/Source/WebCore/bindings', | 36 'third_party/WebKit/Source/core/bindings/v8', |
| 37 'third_party/WebKit/Source/WebCore/bindings/generic', | 37 'third_party/WebKit/Source/core/bindings/v8/custom', |
| 38 'third_party/WebKit/Source/WebCore/bindings/v8', | 38 'third_party/WebKit/Source/core/bindings/v8/specialization', |
| 39 'third_party/WebKit/Source/WebCore/bindings/v8/custom', | 39 'third_party/WebKit/Source/core/bridge', |
| 40 'third_party/WebKit/Source/WebCore/bindings/v8/specialization', | 40 'third_party/WebKit/Source/core/bridge/jni', |
| 41 'third_party/WebKit/Source/WebCore/bridge', | 41 'third_party/WebKit/Source/core/bridge/jni/v8', |
| 42 'third_party/WebKit/Source/WebCore/bridge/jni', | 42 'third_party/WebKit/Source/core/css', |
| 43 'third_party/WebKit/Source/WebCore/bridge/jni/v8', | 43 'third_party/WebKit/Source/core/dom', |
| 44 'third_party/WebKit/Source/WebCore/css', | 44 'third_party/WebKit/Source/core/dom/default', |
| 45 'third_party/WebKit/Source/WebCore/dom', | 45 'third_party/WebKit/Source/core/editing', |
| 46 'third_party/WebKit/Source/WebCore/dom/default', | 46 'third_party/WebKit/Source/core/fileapi', |
| 47 'third_party/WebKit/Source/WebCore/editing', | 47 'third_party/WebKit/Source/core/history', |
| 48 'third_party/WebKit/Source/WebCore/fileapi', | 48 'third_party/WebKit/Source/core/html', |
| 49 'third_party/WebKit/Source/WebCore/history', | 49 'third_party/WebKit/Source/core/html/canvas', |
| 50 'third_party/WebKit/Source/WebCore/html', | 50 'third_party/WebKit/Source/core/html/parser', |
| 51 'third_party/WebKit/Source/WebCore/html/canvas', | 51 'third_party/WebKit/Source/core/html/shadow', |
| 52 'third_party/WebKit/Source/WebCore/html/parser', | 52 'third_party/WebKit/Source/core/inspector', |
| 53 'third_party/WebKit/Source/WebCore/html/shadow', | 53 'third_party/WebKit/Source/core/loader', |
| 54 'third_party/WebKit/Source/WebCore/inspector', | 54 'third_party/WebKit/Source/core/loader/appcache', |
| 55 'third_party/WebKit/Source/WebCore/loader', | 55 'third_party/WebKit/Source/core/loader/archive', |
| 56 'third_party/WebKit/Source/WebCore/loader/appcache', | 56 'third_party/WebKit/Source/core/loader/cache', |
| 57 'third_party/WebKit/Source/WebCore/loader/archive', | 57 'third_party/WebKit/Source/core/loader/icon', |
| 58 'third_party/WebKit/Source/WebCore/loader/cache', | 58 'third_party/WebKit/Source/core/mathml', |
| 59 'third_party/WebKit/Source/WebCore/loader/icon', | 59 'third_party/WebKit/Source/core/notifications', |
| 60 'third_party/WebKit/Source/WebCore/mathml', | 60 'third_party/WebKit/Source/core/page', |
| 61 'third_party/WebKit/Source/WebCore/notifications', | 61 'third_party/WebKit/Source/core/page/animation', |
| 62 'third_party/WebKit/Source/WebCore/page', | 62 'third_party/WebKit/Source/core/page/chromium', |
| 63 'third_party/WebKit/Source/WebCore/page/animation', | 63 'third_party/WebKit/Source/core/platform', |
| 64 'third_party/WebKit/Source/WebCore/page/chromium', | 64 'third_party/WebKit/Source/core/platform/animation', |
| 65 'third_party/WebKit/Source/WebCore/platform', | 65 'third_party/WebKit/Source/core/platform/audio', |
| 66 'third_party/WebKit/Source/WebCore/platform/animation', | 66 'third_party/WebKit/Source/core/platform/audio/chromium', |
| 67 'third_party/WebKit/Source/WebCore/platform/audio', | 67 'third_party/WebKit/Source/core/platform/audio/mac', |
| 68 'third_party/WebKit/Source/WebCore/platform/audio/chromium', | 68 'third_party/WebKit/Source/core/platform/chromium', |
| 69 'third_party/WebKit/Source/WebCore/platform/audio/mac', | 69 'third_party/WebKit/Source/core/platform/cocoa', |
| 70 'third_party/WebKit/Source/WebCore/platform/chromium', | 70 'third_party/WebKit/Source/core/platform/graphics', |
| 71 'third_party/WebKit/Source/WebCore/platform/cocoa', | 71 'third_party/WebKit/Source/core/platform/graphics/cg', |
| 72 'third_party/WebKit/Source/WebCore/platform/graphics', | 72 'third_party/WebKit/Source/core/platform/graphics/chromium', |
| 73 'third_party/WebKit/Source/WebCore/platform/graphics/cg', | 73 'third_party/WebKit/Source/core/platform/graphics/cocoa', |
| 74 'third_party/WebKit/Source/WebCore/platform/graphics/chromium', | 74 'third_party/WebKit/Source/core/platform/graphics/filters', |
| 75 'third_party/WebKit/Source/WebCore/platform/graphics/cocoa', | 75 'third_party/WebKit/Source/core/platform/graphics/gpu', |
| 76 'third_party/WebKit/Source/WebCore/platform/graphics/filters', | 76 'third_party/WebKit/Source/core/platform/graphics/mac', |
| 77 'third_party/WebKit/Source/WebCore/platform/graphics/gpu', | 77 'third_party/WebKit/Source/core/platform/graphics/opentype', |
| 78 'third_party/WebKit/Source/WebCore/platform/graphics/mac', | 78 'third_party/WebKit/Source/core/platform/graphics/skia', |
| 79 'third_party/WebKit/Source/WebCore/platform/graphics/opentype', | 79 'third_party/WebKit/Source/core/platform/graphics/transforms', |
| 80 'third_party/WebKit/Source/WebCore/platform/graphics/skia', | 80 'third_party/WebKit/Source/core/platform/image-decoders', |
| 81 'third_party/WebKit/Source/WebCore/platform/graphics/transforms', | 81 'third_party/WebKit/Source/core/platform/image-decoders/bmp', |
| 82 'third_party/WebKit/Source/WebCore/platform/image-decoders', | 82 'third_party/WebKit/Source/core/platform/image-decoders/gif', |
| 83 'third_party/WebKit/Source/WebCore/platform/image-decoders/bmp', | 83 'third_party/WebKit/Source/core/platform/image-decoders/ico', |
| 84 'third_party/WebKit/Source/WebCore/platform/image-decoders/gif', | 84 'third_party/WebKit/Source/core/platform/image-decoders/jpeg', |
| 85 'third_party/WebKit/Source/WebCore/platform/image-decoders/ico', | 85 'third_party/WebKit/Source/core/platform/image-decoders/png', |
| 86 'third_party/WebKit/Source/WebCore/platform/image-decoders/jpeg', | 86 'third_party/WebKit/Source/core/platform/image-decoders/skia', |
| 87 'third_party/WebKit/Source/WebCore/platform/image-decoders/png', | 87 'third_party/WebKit/Source/core/platform/image-decoders/webp', |
| 88 'third_party/WebKit/Source/WebCore/platform/image-decoders/skia', | 88 'third_party/WebKit/Source/core/platform/image-decoders/xbm', |
| 89 'third_party/WebKit/Source/WebCore/platform/image-decoders/webp', | 89 'third_party/WebKit/Source/core/platform/image-encoders/skia', |
| 90 'third_party/WebKit/Source/WebCore/platform/image-decoders/xbm', | 90 'third_party/WebKit/Source/core/platform/mac', |
| 91 'third_party/WebKit/Source/WebCore/platform/image-encoders/skia', | 91 'third_party/WebKit/Source/core/platform/mock', |
| 92 'third_party/WebKit/Source/WebCore/platform/mac', | 92 'third_party/WebKit/Source/core/platform/network', |
| 93 'third_party/WebKit/Source/WebCore/platform/mock', | 93 'third_party/WebKit/Source/core/platform/network/chromium', |
| 94 'third_party/WebKit/Source/WebCore/platform/network', | 94 'third_party/WebKit/Source/core/platform/sql', |
| 95 'third_party/WebKit/Source/WebCore/platform/network/chromium', | 95 'third_party/WebKit/Source/core/platform/text', |
| 96 'third_party/WebKit/Source/WebCore/platform/sql', | 96 'third_party/WebKit/Source/core/platform/text/mac', |
| 97 'third_party/WebKit/Source/WebCore/platform/text', | 97 'third_party/WebKit/Source/core/platform/text/transcoder', |
| 98 'third_party/WebKit/Source/WebCore/platform/text/mac', | 98 'third_party/WebKit/Source/core/plugins', |
| 99 'third_party/WebKit/Source/WebCore/platform/text/transcoder', | 99 'third_party/WebKit/Source/core/plugins/chromium', |
| 100 'third_party/WebKit/Source/WebCore/plugins', | 100 'third_party/WebKit/Source/core/rendering', |
| 101 'third_party/WebKit/Source/WebCore/plugins/chromium', | 101 'third_party/WebKit/Source/core/rendering/style', |
| 102 'third_party/WebKit/Source/WebCore/rendering', | 102 'third_party/WebKit/Source/core/rendering/svg', |
| 103 'third_party/WebKit/Source/WebCore/rendering/style', | 103 'third_party/WebKit/Source/core/storage', |
| 104 'third_party/WebKit/Source/WebCore/rendering/svg', | 104 'third_party/WebKit/Source/core/storage/chromium', |
| 105 'third_party/WebKit/Source/WebCore/storage', | 105 'third_party/WebKit/Source/core/svg', |
| 106 'third_party/WebKit/Source/WebCore/storage/chromium', | 106 'third_party/WebKit/Source/core/svg/animation', |
| 107 'third_party/WebKit/Source/WebCore/svg', | 107 'third_party/WebKit/Source/core/svg/graphics', |
| 108 'third_party/WebKit/Source/WebCore/svg/animation', | 108 'third_party/WebKit/Source/core/svg/graphics/filters', |
| 109 'third_party/WebKit/Source/WebCore/svg/graphics', | 109 'third_party/WebKit/Source/core/svg/properties', |
| 110 'third_party/WebKit/Source/WebCore/svg/graphics/filters', | 110 'third_party/WebKit/Source/core/webaudio', |
| 111 'third_party/WebKit/Source/WebCore/svg/properties', | 111 'third_party/WebKit/Source/core/websockets', |
| 112 'third_party/WebKit/Source/WebCore/webaudio', | 112 'third_party/WebKit/Source/core/workers', |
| 113 'third_party/WebKit/Source/WebCore/websockets', | 113 'third_party/WebKit/Source/core/xml', |
| 114 'third_party/WebKit/Source/WebCore/workers', | 114 'third_party/WebKit/Source/public', |
| 115 'third_party/WebKit/Source/WebCore/xml', | 115 'third_party/WebKit/Source/web', |
| 116 'third_party/WebKit/Source/WebKit/chromium/public', | |
| 117 'third_party/WebKit/Source/WebKit/chromium/src', | |
| 118 'third_party/WebKit/Source/WebKit/mac/WebCoreSupport', | |
| 119 'third_party/WebKit/WebKitLibraries', | |
| 120 'third_party/cld', | 116 'third_party/cld', |
| 121 'third_party/icu/public/common', | 117 'third_party/icu/public/common', |
| 122 'third_party/icu/public/i18n', | 118 'third_party/icu/public/i18n', |
| 123 'third_party/npapi', | 119 'third_party/npapi', |
| 124 'third_party/npapi/bindings', | 120 'third_party/npapi/bindings', |
| 125 'third_party/protobuf', | 121 'third_party/protobuf', |
| 126 'third_party/protobuf/src', | 122 'third_party/protobuf/src', |
| 127 'third_party/skia/gpu/include', | 123 'third_party/skia/gpu/include', |
| 128 'third_party/skia/include/config', | 124 'third_party/skia/include/config', |
| 129 'third_party/skia/include/core', | 125 'third_party/skia/include/core', |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 193 |
| 198 | 194 |
| 199 def main(): | 195 def main(): |
| 200 bytes = Walk(set(), sys.argv[1], '', 0) | 196 bytes = Walk(set(), sys.argv[1], '', 0) |
| 201 print | 197 print |
| 202 print float(bytes) / (1 << 20), "megabytes of chrome source" | 198 print float(bytes) / (1 << 20), "megabytes of chrome source" |
| 203 | 199 |
| 204 | 200 |
| 205 if __name__ == '__main__': | 201 if __name__ == '__main__': |
| 206 sys.exit(main()) | 202 sys.exit(main()) |
| OLD | NEW |