diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 21:57:48 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 21:57:48 +0000 |
commit | b360895e1e4ba2db735f82d85563a631e1cc0c5b (patch) | |
tree | 1752bbb98415a9e661ac04592be5c63b9d51f699 /chrome/browser/cocoa | |
parent | 43f0899d89c0ca4697ea51439d1541af16749ff8 (diff) | |
download | chromium_src-b360895e1e4ba2db735f82d85563a631e1cc0c5b.zip chromium_src-b360895e1e4ba2db735f82d85563a631e1cc0c5b.tar.gz chromium_src-b360895e1e4ba2db735f82d85563a631e1cc0c5b.tar.bz2 |
Put back in code that installs ThrobberView, but comment out timer. Add a big comment about why this is so slow. BUG=none TEST=none.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 13 | ||||
-rw-r--r-- | chrome/browser/cocoa/throbber_view.mm | 18 |
2 files changed, 12 insertions, 19 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index ab5d82d..30f7768 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -379,9 +379,6 @@ if (!loading) [self setTabTitle:[tabArray_ objectAtIndex:index] withContents:contents]; -#if 1 -// TODO(pinkerton): Enabling this slowed down the tab_cold startup test by -// close to 5 seconds. Turning it off to see if the bot returns to normal. // Update the current loading state, replacing the icon with a throbber, or // vice versa. This will get called repeatedly with the same state during a // load, so we need to make sure we're not creating the throbber view over and @@ -402,18 +399,9 @@ } if (image) { NSRect frame = NSMakeRect(0, 0, 16, 16); -#if 0 - NSProgressIndicator* p = - [[[NSProgressIndicator alloc] initWithFrame:frame] autorelease]; - [p setIndeterminate:YES]; - [p setStyle:NSProgressIndicatorSpinningStyle]; - [p startAnimation:self]; - [tabController setIconView:p]; -#else ThrobberView* throbber = [[[ThrobberView alloc] initWithFrame:frame image:image] autorelease]; [tabController setIconView:throbber]; -#endif } else if (!contents->is_loading()) { // Set everything back to normal, we're done loading. @@ -422,7 +410,6 @@ [tabController setLoading:NO]; } } -#endif TabContentsController* updatedController = [tabContentsArray_ objectAtIndex:index]; diff --git a/chrome/browser/cocoa/throbber_view.mm b/chrome/browser/cocoa/throbber_view.mm index b93f45d..26f8ec5 100644 --- a/chrome/browser/cocoa/throbber_view.mm +++ b/chrome/browser/cocoa/throbber_view.mm @@ -61,6 +61,17 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows } image_.reset([[CIImage alloc] initWithBitmapImageRep:rep]); +#if 0 +// TODO(pinkerton): The invalidation of the view to trigger re-draw causes +// the entire title-bar to redraw (you can see it with QuartzDebug). For some +// reason, setting isOpaque on this view, or any of its parent views, doesn't +// help. As a result, enabling this timer causes new tab to take a very long +// time on a loaded machine, crushing our perf bot when it's under load. For +// now, I'm disabling the timer so we draw the first frame of the animation, +// but nothing more. There are a couple of ways we can fix this: +// 1) Try to figure out why the invalidate is invalidating the entire title bar +// 2) Find some way to draw only the pixels we want and nothing else, but I +// don't know how we'd do that. // Start a timer for the animation frames. target_.reset([[TimerTarget alloc] initWithThrobber:self]); timer_ = @@ -69,6 +80,7 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows selector:@selector(animate:) userInfo:nil repeats:YES]; +#endif } return self; } @@ -78,10 +90,6 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows [super dealloc]; } -- (BOOL)isOpaque { - return YES; -} - - (void)removeFromSuperview { [timer_ invalidate]; timer_ = nil; @@ -98,7 +106,6 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows // Overridden to draw the appropriate frame in the image strip. - (void)drawRect:(NSRect)rect { -#if 0 float imageDimension = [image_ extent].size.height; float xOffset = animationFrame_ * imageDimension; NSRect sourceImageRect = @@ -107,7 +114,6 @@ const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows fromRect:sourceImageRect operation:NSCompositeSourceOver fraction:1.0]; -#endif } @end |