Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5226)

Unified Diff: chrome/browser/cocoa/status_bubble_mac.mm

Issue 385043: "Am I on the right thread?" DCHECKs for StatusBubbleMac.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/status_bubble_mac.mm
===================================================================
--- chrome/browser/cocoa/status_bubble_mac.mm (revision 31667)
+++ chrome/browser/cocoa/status_bubble_mac.mm (working copy)
@@ -343,6 +343,7 @@
}
void StatusBubbleMac::AnimationDidStop(CAAnimation* animation, bool finished) {
+ DCHECK([NSThread isMainThread]);
DCHECK(state_ == kBubbleShowingFadeIn || state_ == kBubbleHidingFadeOut);
if (finished) {
@@ -352,10 +353,10 @@
// properly synchronized.
if (state_ == kBubbleShowingFadeIn) {
DCHECK_EQ([[window_ animator] alphaValue], kBubbleOpacity);
- state_ = kBubbleShown;
+ SetState(kBubbleShown);
} else {
DCHECK_EQ([[window_ animator] alphaValue], 0.0);
- state_ = kBubbleHidden;
+ SetState(kBubbleHidden);
}
}
}
@@ -371,6 +372,8 @@
}
void StatusBubbleMac::Fade(bool show) {
+ DCHECK([NSThread isMainThread]);
+
StatusBubbleState fade_state = kBubbleShowingFadeIn;
StatusBubbleState target_state = kBubbleShown;
NSTimeInterval full_duration = kShowFadeInDurationSeconds;
@@ -414,6 +417,7 @@
}
void StatusBubbleMac::StartTimer(int64 delay_ms) {
+ DCHECK([NSThread isMainThread]);
DCHECK(state_ == kBubbleShowingTimer || state_ == kBubbleHidingTimer);
if (immediate_) {
@@ -431,12 +435,15 @@
}
void StatusBubbleMac::CancelTimer() {
+ DCHECK([NSThread isMainThread]);
+
if (!timer_factory_.empty())
timer_factory_.RevokeAll();
}
void StatusBubbleMac::TimerFired() {
DCHECK(state_ == kBubbleShowingTimer || state_ == kBubbleHidingTimer);
+ DCHECK([NSThread isMainThread]);
if (state_ == kBubbleShowingTimer) {
SetState(kBubbleShowingFadeIn);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698