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

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

Issue 11411227: Garbage collect extensions only if there are no pending extension installs that could still be usin… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/pending_extension_manager.h" 5 #include "chrome/browser/extensions/pending_extension_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 for (iter = pending_extension_list_.begin(); 66 for (iter = pending_extension_list_.begin();
67 iter != pending_extension_list_.end(); 67 iter != pending_extension_list_.end();
68 ++iter) { 68 ++iter) {
69 if (id == iter->id()) 69 if (id == iter->id())
70 return true; 70 return true;
71 } 71 }
72 72
73 return false; 73 return false;
74 } 74 }
75 75
76 bool PendingExtensionManager::HasPendingExtensions() const {
77 return !pending_extension_list_.empty();
78 }
79
76 bool PendingExtensionManager::HasPendingExtensionFromSync() const { 80 bool PendingExtensionManager::HasPendingExtensionFromSync() const {
77 PendingExtensionList::const_iterator iter; 81 PendingExtensionList::const_iterator iter;
78 for (iter = pending_extension_list_.begin(); 82 for (iter = pending_extension_list_.begin();
79 iter != pending_extension_list_.end(); 83 iter != pending_extension_list_.end();
80 ++iter) { 84 ++iter) {
81 if (iter->is_from_sync()) 85 if (iter->is_from_sync())
82 return true; 86 return true;
83 } 87 }
84 88
85 return false; 89 return false;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 255
252 return true; 256 return true;
253 } 257 }
254 258
255 void PendingExtensionManager::AddForTesting( 259 void PendingExtensionManager::AddForTesting(
256 const PendingExtensionInfo& pending_extension_info) { 260 const PendingExtensionInfo& pending_extension_info) {
257 pending_extension_list_.push_back(pending_extension_info); 261 pending_extension_list_.push_back(pending_extension_info);
258 } 262 }
259 263
260 } // namespace extensions 264 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698