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

Side by Side Diff: chrome/browser/extensions/script_badge_controller.cc

Issue 10823142: Fix a race condition when an IconAnimation is still running at browser shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 8 years, 4 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/script_badge_controller.h" 5 #include "chrome/browser/extensions/script_badge_controller.h"
6 6
7 #include "chrome/browser/extensions/browser_event_router.h" 7 #include "chrome/browser/extensions/browser_event_router.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_system.h" 9 #include "chrome/browser/extensions/extension_system.h"
10 #include "chrome/browser/extensions/tab_helper.h" 10 #include "chrome/browser/extensions/tab_helper.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 current_actions_.push_back(script_badge); 179 current_actions_.push_back(script_badge);
180 return script_badge; 180 return script_badge;
181 } 181 }
182 182
183 bool ScriptBadgeController::MarkExtensionExecuting( 183 bool ScriptBadgeController::MarkExtensionExecuting(
184 const std::string& extension_id) { 184 const std::string& extension_id) {
185 ExtensionAction* script_badge = AddExtensionToCurrentActions(extension_id); 185 ExtensionAction* script_badge = AddExtensionToCurrentActions(extension_id);
186 if (!script_badge) 186 if (!script_badge)
187 return false; 187 return false;
188 188
189 script_badge->SetIsVisible(SessionID::IdForTab(tab_contents_), true);
189 script_badge->RunIconAnimation(SessionID::IdForTab(tab_contents_)); 190 script_badge->RunIconAnimation(SessionID::IdForTab(tab_contents_));
190 191
191 return true; 192 return true;
192 } 193 }
193 194
194 bool ScriptBadgeController::EraseExtension(const Extension* extension) { 195 bool ScriptBadgeController::EraseExtension(const Extension* extension) {
195 if (extensions_in_current_actions_.erase(extension->id()) == 0) 196 if (extensions_in_current_actions_.erase(extension->id()) == 0)
196 return false; 197 return false;
197 198
198 size_t size_before = current_actions_.size(); 199 size_t size_before = current_actions_.size();
(...skipping 10 matching lines...) Expand all
209 current_actions_.erase(it); 210 current_actions_.erase(it);
210 break; 211 break;
211 } 212 }
212 } 213 }
213 214
214 CHECK_EQ(size_before, current_actions_.size() + 1); 215 CHECK_EQ(size_before, current_actions_.size() + 1);
215 return true; 216 return true;
216 } 217 }
217 218
218 } // namespace extensions 219 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/extension_action/script_badge_apitest.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698