diff options
author | tapted <tapted@chromium.org> | 2015-05-04 00:20:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-04 07:20:35 +0000 |
commit | 05d4a5b475777ebbf2cbab9f76a4e2fbe40773f2 (patch) | |
tree | 0e2e8277a0d0630a05e2191bd4d59d0f73202dbc /printing | |
parent | 314f1bd27665f7207dc1b04e387650cbdaf5f026 (diff) | |
download | chromium_src-05d4a5b475777ebbf2cbab9f76a4e2fbe40773f2.zip chromium_src-05d4a5b475777ebbf2cbab9f76a4e2fbe40773f2.tar.gz chromium_src-05d4a5b475777ebbf2cbab9f76a4e2fbe40773f2.tar.bz2 |
[Mac/Cleanup] Trim down Foundation.h and ApplicationServices.h includes
Foundation.h is about 100k lines of preprocessed source.
ApplicationServices is one of the many things it includes, and it is
also large (80k lines) and appears in ui/gfx/geometry headers that are
used in many places that don't care specifically about mac.
This CL avoids including Foundation.h or ApplicationServices.h from
commonly-used header files. The particular focus is on header files
typically included from other header files (versus headers most commonly
included only from .cc or .mm files).
The geometry headers get a forward-declare and fewer inline functions.
rect.h on Mac was already de-inlined, so this makes size and point
consistent with that. It also makes Mac more consistent with the
approach on Windows for native geometry types.
The main Foundation.h contributor was scoped_nsobject.h. It switches
from <Foundation/Foundation.h> (100k lines) to <Foundation/NSObject.h>
(1.5k lines). Note that even NSObject.h is not strictly needed:
<objc/objc.h> for the declaration of "nil" is sufficient, but forces
users of scoped_nsobject to make their own decision of the header to
include.
This results in a 36m20s [+/- 1s] CPU time improvement to compile times
on Mac (or a measured 1m33s [+/- 2s] real/wall time improvement on a
recent macpro). Error range gives the interval wherein lies the true
mean with a 90% confidence (6 measurements each).
There's a also a reduction in name collisions. E.g. kSmallIconSize which
is a global symbol in both Chrome and CoreServices, and is what actually
set me down this path in the first place.
BUG=None
TBR=sdefresne@chromium.org,stuartmorgan@chromium.org,thestig@chromium.org
Review URL: https://codereview.chromium.org/1092033006
Cr-Commit-Position: refs/heads/master@{#328102}
Diffstat (limited to 'printing')
-rw-r--r-- | printing/printing_context_mac.h | 5 | ||||
-rw-r--r-- | printing/printing_context_mac.mm | 1 |
2 files changed, 1 insertions, 5 deletions
diff --git a/printing/printing_context_mac.h b/printing/printing_context_mac.h index 51a1a1c..c9474b6 100644 --- a/printing/printing_context_mac.h +++ b/printing/printing_context_mac.h @@ -5,17 +5,14 @@ #ifndef PRINTING_PRINTING_CONTEXT_MAC_H_ #define PRINTING_PRINTING_CONTEXT_MAC_H_ +#include <ApplicationServices/ApplicationServices.h> #include <string> #include "base/mac/scoped_nsobject.h" #include "printing/print_job_constants.h" #include "printing/printing_context.h" -#ifdef __OBJC__ @class NSPrintInfo; -#else -class NSPrintInfo; -#endif // __OBJC__ namespace printing { diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm index be3df6d..d0e900f 100644 --- a/printing/printing_context_mac.mm +++ b/printing/printing_context_mac.mm @@ -4,7 +4,6 @@ #include "printing/printing_context_mac.h" -#import <ApplicationServices/ApplicationServices.h> #import <AppKit/AppKit.h> #import <iomanip> |