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

Unified Diff: chrome/browser/component_updater/component_updater_service.cc

Issue 318143003: Make CUS interface more resilient by returning a copy of the data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/component_updater/component_updater_service.cc
diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc
index f2518ea19991b784b87826dff2da6c76c82d919b..b72912148e5bac7cf021da7cf98f97477ce0a7b4 100644
--- a/chrome/browser/component_updater/component_updater_service.cc
+++ b/chrome/browser/component_updater/component_updater_service.cc
@@ -15,7 +15,6 @@
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/sequenced_task_runner.h"
#include "base/stl_util.h"
@@ -155,7 +154,7 @@ class CrxUpdateService : public ComponentUpdateService, public OnDemandUpdater {
virtual Status Stop() OVERRIDE;
virtual Status RegisterComponent(const CrxComponent& component) OVERRIDE;
virtual std::vector<std::string> GetComponentIDs() const OVERRIDE;
- virtual CrxUpdateItem* GetComponentDetails(
+ virtual base::WeakPtr<CrxUpdateItem> GetComponentDetails(
const std::string& component_id) const OVERRIDE;
virtual OnDemandUpdater& GetOnDemandUpdater() OVERRIDE;
@@ -510,10 +509,10 @@ std::vector<std::string> CrxUpdateService::GetComponentIDs() const {
return component_ids;
}
-CrxUpdateItem* CrxUpdateService::GetComponentDetails(
+base::WeakPtr<CrxUpdateItem> CrxUpdateService::GetComponentDetails(
const std::string& component_id) const {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- return FindUpdateItemById(component_id);
+ return FindUpdateItemById(component_id)->AsWeakPtr();
}
OnDemandUpdater& CrxUpdateService::GetOnDemandUpdater() {

Powered by Google App Engine
This is Rietveld 408576698