Commit 78efe2e9 authored by tommycli@chromium.org's avatar tommycli@chromium.org

Componentize component_updater: Split content::ResourceThrottle from CUS.

BUG=371463

Review URL: https://codereview.chromium.org/421393002

Cr-Commit-Position: refs/heads/master@{#288367}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288367 0039d316-1c4b-4281-b951-d872f2087c98
parent a397ec0f
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/component_updater/component_updater_resource_throttle.h"
#include "base/location.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/component_updater/component_updater_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/resource_controller.h"
#include "content/public/browser/resource_throttle.h"
using content::BrowserThread;
namespace component_updater {
namespace {
///////////////////////////////////////////////////////////////////////////////
// In charge of blocking url requests until the |crx_id| component has been
// updated. This class is touched solely from the IO thread. The UI thread
// can post tasks to it via weak pointers. By default the request is blocked
// unless the CrxUpdateService calls Unblock().
// The lifetime is controlled by Chrome's resource loader so the component
// updater cannot touch objects from this class except via weak pointers.
class CUResourceThrottle : public content::ResourceThrottle,
public base::SupportsWeakPtr<CUResourceThrottle> {
public:
CUResourceThrottle();
virtual ~CUResourceThrottle();
// Overriden from ResourceThrottle.
virtual void WillStartRequest(bool* defer) OVERRIDE;
virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE;
virtual const char* GetNameForLogging() const OVERRIDE;
// Component updater calls this function via PostTask to unblock the request.
void Unblock();
typedef std::vector<base::WeakPtr<CUResourceThrottle> > WeakPtrVector;
private:
enum State { NEW, BLOCKED, UNBLOCKED };
State state_;
};
CUResourceThrottle::CUResourceThrottle() : state_(NEW) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
CUResourceThrottle::~CUResourceThrottle() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
void CUResourceThrottle::WillStartRequest(bool* defer) {
if (state_ != UNBLOCKED) {
state_ = BLOCKED;
*defer = true;
} else {
*defer = false;
}
}
void CUResourceThrottle::WillRedirectRequest(const GURL& new_url, bool* defer) {
WillStartRequest(defer);
}
const char* CUResourceThrottle::GetNameForLogging() const {
return "ComponentUpdateResourceThrottle";
}
void CUResourceThrottle::Unblock() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (state_ == BLOCKED)
controller()->Resume();
state_ = UNBLOCKED;
}
void UnblockThrottleOnUIThread(base::WeakPtr<CUResourceThrottle> rt) {
BrowserThread::PostTask(BrowserThread::IO,
FROM_HERE,
base::Bind(&CUResourceThrottle::Unblock, rt));
}
} // namespace
content::ResourceThrottle* GetOnDemandResourceThrottle(
ComponentUpdateService* cus,
const std::string& crx_id) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
// We give the raw pointer to the caller, who will delete it at will
// and we keep for ourselves a weak pointer to it so we can post tasks
// from the UI thread without having to track lifetime directly.
CUResourceThrottle* rt = new CUResourceThrottle;
BrowserThread::PostTask(
BrowserThread::UI,
FROM_HERE,
base::Bind(&ComponentUpdateService::MaybeThrottle,
base::Unretained(cus),
crx_id,
base::Bind(&UnblockThrottleOnUIThread, rt->AsWeakPtr())));
return rt;
}
} // namespace component_updater
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_RESOURCE_THROTTLE_H_
#define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_RESOURCE_THROTTLE_H_
#include <string>
namespace content {
class ResourceThrottle;
}
namespace component_updater {
class ComponentUpdateService;
// Returns a network resource throttle. It means that a component will be
// downloaded and installed before the resource is unthrottled. This function
// can be called from the IO thread.
content::ResourceThrottle* GetOnDemandResourceThrottle(
ComponentUpdateService* cus,
const std::string& crx_id);
} // namespace component_updater
#endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_RESOURCE_THROTTLE_H_
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/at_exit.h" #include "base/at_exit.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/file_util.h" #include "base/file_util.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
...@@ -22,7 +23,6 @@ ...@@ -22,7 +23,6 @@
#include "base/threading/sequenced_worker_pool.h" #include "base/threading/sequenced_worker_pool.h"
#include "base/threading/thread_checker.h" #include "base/threading/thread_checker.h"
#include "base/timer/timer.h" #include "base/timer/timer.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/component_updater/component_patcher_operation.h" #include "chrome/browser/component_updater/component_patcher_operation.h"
#include "chrome/browser/component_updater/component_unpacker.h" #include "chrome/browser/component_updater/component_unpacker.h"
#include "chrome/browser/component_updater/component_updater_configurator.h" #include "chrome/browser/component_updater/component_updater_configurator.h"
...@@ -32,13 +32,8 @@ ...@@ -32,13 +32,8 @@
#include "chrome/browser/component_updater/crx_update_item.h" #include "chrome/browser/component_updater/crx_update_item.h"
#include "chrome/browser/component_updater/update_checker.h" #include "chrome/browser/component_updater/update_checker.h"
#include "chrome/browser/component_updater/update_response.h" #include "chrome/browser/component_updater/update_response.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/resource_controller.h"
#include "content/public/browser/resource_throttle.h"
#include "url/gurl.h" #include "url/gurl.h"
using content::BrowserThread;
namespace component_updater { namespace component_updater {
// The component updater is designed to live until process shutdown, so // The component updater is designed to live until process shutdown, so
...@@ -90,48 +85,6 @@ CrxComponent::CrxComponent() ...@@ -90,48 +85,6 @@ CrxComponent::CrxComponent()
CrxComponent::~CrxComponent() { CrxComponent::~CrxComponent() {
} }
///////////////////////////////////////////////////////////////////////////////
// In charge of blocking url requests until the |crx_id| component has been
// updated. This class is touched solely from the IO thread. The UI thread
// can post tasks to it via weak pointers. By default the request is blocked
// unless the CrxUpdateService calls Unblock().
// The lifetime is controlled by Chrome's resource loader so the component
// updater cannot touch objects from this class except via weak pointers.
class CUResourceThrottle : public content::ResourceThrottle,
public base::SupportsWeakPtr<CUResourceThrottle> {
public:
explicit CUResourceThrottle(const net::URLRequest* request);
virtual ~CUResourceThrottle();
// Overriden from ResourceThrottle.
virtual void WillStartRequest(bool* defer) OVERRIDE;
virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE;
virtual const char* GetNameForLogging() const OVERRIDE;
// Component updater calls this function via PostTask to unblock the request.
void Unblock();
typedef std::vector<base::WeakPtr<CUResourceThrottle> > WeakPtrVector;
private:
enum State { NEW, BLOCKED, UNBLOCKED };
State state_;
};
void UnblockResourceThrottle(base::WeakPtr<CUResourceThrottle> rt) {
BrowserThread::PostTask(BrowserThread::IO,
FROM_HERE,
base::Bind(&CUResourceThrottle::Unblock, rt));
}
void UnblockandReapAllThrottles(CUResourceThrottle::WeakPtrVector* throttles) {
CUResourceThrottle::WeakPtrVector::iterator it;
for (it = throttles->begin(); it != throttles->end(); ++it)
UnblockResourceThrottle(*it);
throttles->clear();
}
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// The one and only implementation of the ComponentUpdateService interface. In // The one and only implementation of the ComponentUpdateService interface. In
// charge of running the show. The main method is ProcessPendingItems() which // charge of running the show. The main method is ProcessPendingItems() which
...@@ -157,18 +110,12 @@ class CrxUpdateService : public ComponentUpdateService, public OnDemandUpdater { ...@@ -157,18 +110,12 @@ class CrxUpdateService : public ComponentUpdateService, public OnDemandUpdater {
virtual Status Stop() OVERRIDE; virtual Status Stop() OVERRIDE;
virtual Status RegisterComponent(const CrxComponent& component) OVERRIDE; virtual Status RegisterComponent(const CrxComponent& component) OVERRIDE;
virtual std::vector<std::string> GetComponentIDs() const OVERRIDE; virtual std::vector<std::string> GetComponentIDs() const OVERRIDE;
virtual bool GetComponentDetails(const std::string& component_id,
CrxUpdateItem* item) const OVERRIDE;
virtual OnDemandUpdater& GetOnDemandUpdater() OVERRIDE; virtual OnDemandUpdater& GetOnDemandUpdater() OVERRIDE;
virtual void MaybeThrottle(const std::string& crx_id,
const base::Closure& callback) OVERRIDE;
virtual scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() virtual scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner()
OVERRIDE; OVERRIDE;
// Overrides for OnDemandUpdater.
virtual content::ResourceThrottle* GetOnDemandResourceThrottle(
net::URLRequest* request,
const std::string& crx_id) OVERRIDE;
virtual Status OnDemandUpdate(const std::string& component_id) OVERRIDE;
// Context for a crx download url request. // Context for a crx download url request.
struct CRXContext { struct CRXContext {
ComponentInstaller* installer; ComponentInstaller* installer;
...@@ -192,6 +139,13 @@ class CrxUpdateService : public ComponentUpdateService, public OnDemandUpdater { ...@@ -192,6 +139,13 @@ class CrxUpdateService : public ComponentUpdateService, public OnDemandUpdater {
kStepDelayLong, kStepDelayLong,
}; };
// Overrides for ComponentUpdateService.
virtual bool GetComponentDetails(const std::string& component_id,
CrxUpdateItem* item) const OVERRIDE;
// Overrides for OnDemandUpdater.
virtual Status OnDemandUpdate(const std::string& component_id) OVERRIDE;
void UpdateCheckComplete(int error, void UpdateCheckComplete(int error,
const std::string& error_message, const std::string& error_message,
const UpdateResponse::Results& results); const UpdateResponse::Results& results);
...@@ -244,9 +198,6 @@ class CrxUpdateService : public ComponentUpdateService, public OnDemandUpdater { ...@@ -244,9 +198,6 @@ class CrxUpdateService : public ComponentUpdateService, public OnDemandUpdater {
bool HasOnDemandItems() const; bool HasOnDemandItems() const;
void OnNewResourceThrottle(base::WeakPtr<CUResourceThrottle> rt,
const std::string& crx_id);
Status GetServiceStatus(const CrxUpdateItem::Status status); Status GetServiceStatus(const CrxUpdateItem::Status status);
scoped_ptr<Configurator> config_; scoped_ptr<Configurator> config_;
...@@ -449,7 +400,13 @@ void CrxUpdateService::ChangeItemState(CrxUpdateItem* item, ...@@ -449,7 +400,13 @@ void CrxUpdateService::ChangeItemState(CrxUpdateItem* item,
// Free possible pending network requests. // Free possible pending network requests.
if ((to == CrxUpdateItem::kUpdated) || (to == CrxUpdateItem::kUpToDate) || if ((to == CrxUpdateItem::kUpdated) || (to == CrxUpdateItem::kUpToDate) ||
(to == CrxUpdateItem::kNoUpdate)) { (to == CrxUpdateItem::kNoUpdate)) {
UnblockandReapAllThrottles(&item->throttles); for (std::vector<base::Closure>::iterator it =
item->ready_callbacks.begin();
it != item->ready_callbacks.end();
++it) {
it->Run();
}
item->ready_callbacks.clear();
} }
} }
...@@ -525,6 +482,28 @@ std::vector<std::string> CrxUpdateService::GetComponentIDs() const { ...@@ -525,6 +482,28 @@ std::vector<std::string> CrxUpdateService::GetComponentIDs() const {
return component_ids; return component_ids;
} }
OnDemandUpdater& CrxUpdateService::GetOnDemandUpdater() {
return *this;
}
void CrxUpdateService::MaybeThrottle(const std::string& crx_id,
const base::Closure& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
// Check if we can on-demand update, else unblock the request anyway.
CrxUpdateItem* item = FindUpdateItemById(crx_id);
Status status = OnDemandUpdateWithCooldown(item);
if (status == kOk || status == kInProgress) {
item->ready_callbacks.push_back(callback);
return;
}
callback.Run();
}
scoped_refptr<base::SequencedTaskRunner>
CrxUpdateService::GetSequencedTaskRunner() {
return config_->GetSequencedTaskRunner();
}
bool CrxUpdateService::GetComponentDetails(const std::string& component_id, bool CrxUpdateService::GetComponentDetails(const std::string& component_id,
CrxUpdateItem* item) const { CrxUpdateItem* item) const {
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
...@@ -534,13 +513,12 @@ bool CrxUpdateService::GetComponentDetails(const std::string& component_id, ...@@ -534,13 +513,12 @@ bool CrxUpdateService::GetComponentDetails(const std::string& component_id,
return crx_update_item != NULL; return crx_update_item != NULL;
} }
OnDemandUpdater& CrxUpdateService::GetOnDemandUpdater() { // Start the process of checking for an update, for a particular component
return *this; // that was previously registered.
} // |component_id| is a value returned from GetCrxComponentID().
ComponentUpdateService::Status CrxUpdateService::OnDemandUpdate(
scoped_refptr<base::SequencedTaskRunner> const std::string& component_id) {
CrxUpdateService::GetSequencedTaskRunner() { return OnDemandUpdateInternal(FindUpdateItemById(component_id));
return config_->GetSequencedTaskRunner();
} }
// This is the main loop of the component updater. It updates one component // This is the main loop of the component updater. It updates one component
...@@ -959,42 +937,6 @@ void CrxUpdateService::NotifyObservers(Observer::Events event, ...@@ -959,42 +937,6 @@ void CrxUpdateService::NotifyObservers(Observer::Events event,
FOR_EACH_OBSERVER(Observer, observer_list_, OnEvent(event, id)); FOR_EACH_OBSERVER(Observer, observer_list_, OnEvent(event, id));
} }
content::ResourceThrottle* CrxUpdateService::GetOnDemandResourceThrottle(
net::URLRequest* request,
const std::string& crx_id) {
// We give the raw pointer to the caller, who will delete it at will
// and we keep for ourselves a weak pointer to it so we can post tasks
// from the UI thread without having to track lifetime directly.
CUResourceThrottle* rt = new CUResourceThrottle(request);
main_task_runner_->PostTask(
FROM_HERE,
base::Bind(&CrxUpdateService::OnNewResourceThrottle,
base::Unretained(this), rt->AsWeakPtr(), crx_id));
return rt;
}
void CrxUpdateService::OnNewResourceThrottle(
base::WeakPtr<CUResourceThrottle> rt,
const std::string& crx_id) {
DCHECK(thread_checker_.CalledOnValidThread());
// Check if we can on-demand update, else unblock the request anyway.
CrxUpdateItem* item = FindUpdateItemById(crx_id);
Status status = OnDemandUpdateWithCooldown(item);
if (status == kOk || status == kInProgress) {
item->throttles.push_back(rt);
return;
}
UnblockResourceThrottle(rt);
}
// Start the process of checking for an update, for a particular component
// that was previously registered.
// |component_id| is a value returned from GetCrxComponentID().
ComponentUpdateService::Status CrxUpdateService::OnDemandUpdate(
const std::string& component_id) {
return OnDemandUpdateInternal(FindUpdateItemById(component_id));
}
ComponentUpdateService::Status CrxUpdateService::OnDemandUpdateWithCooldown( ComponentUpdateService::Status CrxUpdateService::OnDemandUpdateWithCooldown(
CrxUpdateItem* uit) { CrxUpdateItem* uit) {
if (!uit) if (!uit)
...@@ -1066,39 +1008,6 @@ ComponentUpdateService::Status CrxUpdateService::GetServiceStatus( ...@@ -1066,39 +1008,6 @@ ComponentUpdateService::Status CrxUpdateService::GetServiceStatus(
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
CUResourceThrottle::CUResourceThrottle(const net::URLRequest* request)
: state_(NEW) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
CUResourceThrottle::~CUResourceThrottle() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
void CUResourceThrottle::WillStartRequest(bool* defer) {
if (state_ != UNBLOCKED) {
state_ = BLOCKED;
*defer = true;
} else {
*defer = false;
}
}
void CUResourceThrottle::WillRedirectRequest(const GURL& new_url, bool* defer) {
WillStartRequest(defer);
}
const char* CUResourceThrottle::GetNameForLogging() const {
return "ComponentUpdateResourceThrottle";
}
void CUResourceThrottle::Unblock() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (state_ == BLOCKED)
controller()->Resume();
state_ = UNBLOCKED;
}
// The component update factory. Using the component updater as a singleton // The component update factory. Using the component updater as a singleton
// is the job of the browser process. // is the job of the browser process.
ComponentUpdateService* ComponentUpdateServiceFactory(Configurator* config) { ComponentUpdateService* ComponentUpdateServiceFactory(Configurator* config) {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/callback_forward.h"
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/version.h" #include "base/version.h"
...@@ -171,6 +172,21 @@ class ComponentUpdateService { ...@@ -171,6 +172,21 @@ class ComponentUpdateService {
// proactively triggered outside the normal component update service schedule. // proactively triggered outside the normal component update service schedule.
virtual OnDemandUpdater& GetOnDemandUpdater() = 0; virtual OnDemandUpdater& GetOnDemandUpdater() = 0;
// This method is used to trigger an on-demand update for component |crx_id|.
// This can be used when loading a resource that depends on this component.
//
// |callback| is called on the main thread once the on-demand update is
// complete, regardless of success. |callback| may be called immediately
// within the method body.
//
// Additionally, this function implements an embedder-defined cooldown
// interval between on demand update attempts. This behavior is intended
// to be defensive against programming bugs, usually triggered by web fetches,
// where the on-demand functionality is invoked too often. If this function
// is called while still on cooldown, |callback| will be called immediately.
virtual void MaybeThrottle(const std::string& crx_id,
const base::Closure& callback) = 0;
// Returns a task runner suitable for use by component installers. // Returns a task runner suitable for use by component installers.
virtual scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() = 0; virtual scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() = 0;
...@@ -183,7 +199,6 @@ class ComponentUpdateService { ...@@ -183,7 +199,6 @@ class ComponentUpdateService {
CrxUpdateItem* item) const = 0; CrxUpdateItem* item) const = 0;
friend class ::ComponentsUI; friend class ::ComponentsUI;
FRIEND_TEST_ALL_PREFIXES(ComponentUpdaterTest, ResourceThrottleLiveNoUpdate);
}; };
typedef ComponentUpdateService::Observer ServiceObserver; typedef ComponentUpdateService::Observer ServiceObserver;
...@@ -192,17 +207,6 @@ class OnDemandUpdater { ...@@ -192,17 +207,6 @@ class OnDemandUpdater {
public: public:
virtual ~OnDemandUpdater() {} virtual ~OnDemandUpdater() {}
// Returns a network resource throttle. It means that a component will be
// downloaded and installed before the resource is unthrottled. This function
// can be called from the IO thread. The function implements a cooldown
// interval of 30 minutes. That means it will ineffective to call the
// function before the cooldown interval has passed. This behavior is intended
// to be defensive against programming bugs, usually triggered by web fetches,
// where the on-demand functionality is invoked too often.
virtual content::ResourceThrottle* GetOnDemandResourceThrottle(
net::URLRequest* request,
const std::string& crx_id) = 0;
private: private:
friend class OnDemandTester; friend class OnDemandTester;
friend class ::ComponentsUI; friend class ::ComponentsUI;
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
namespace component_updater { namespace component_updater {
class CUResourceThrottle;
// This is the one and only per-item state structure. Designed to be hosted // This is the one and only per-item state structure. Designed to be hosted
// in a std::vector or a std::list. The two main members are |component| // in a std::vector or a std::list. The two main members are |component|
// which is supplied by the the component updater client and |status| which // which is supplied by the the component updater client and |status| which
...@@ -110,7 +108,7 @@ struct CrxUpdateItem { ...@@ -110,7 +108,7 @@ struct CrxUpdateItem {
std::vector<CrxDownloader::DownloadMetrics> download_metrics; std::vector<CrxDownloader::DownloadMetrics> download_metrics;
std::vector<base::WeakPtr<CUResourceThrottle> > throttles; std::vector<base::Closure> ready_callbacks;
CrxUpdateItem(); CrxUpdateItem();
~CrxUpdateItem(); ~CrxUpdateItem();
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/component_updater/component_updater_resource_throttle.h"
#include "chrome/browser/component_updater/component_updater_utils.h" #include "chrome/browser/component_updater/component_updater_utils.h"
#include "chrome/browser/component_updater/test/test_configurator.h" #include "chrome/browser/component_updater/test/test_configurator.h"
#include "chrome/browser/component_updater/test/test_installer.h" #include "chrome/browser/component_updater/test/test_installer.h"
...@@ -1190,9 +1191,7 @@ content::ResourceThrottle* RequestTestResourceThrottle( ...@@ -1190,9 +1191,7 @@ content::ResourceThrottle* RequestTestResourceThrottle(
NULL, NULL,
&context); &context);
content::ResourceThrottle* rt = content::ResourceThrottle* rt = GetOnDemandResourceThrottle(cus, crx_id);
cus->GetOnDemandUpdater().GetOnDemandResourceThrottle(&url_request,
crx_id);
rt->set_controller_for_testing(controller); rt->set_controller_for_testing(controller);
controller->SetThrottle(rt); controller->SetThrottle(rt);
return rt; return rt;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/component_updater/component_updater_service.h" #include "chrome/browser/component_updater/component_updater_resource_throttle.h"
#include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h" #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h"
#include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/download/download_request_limiter.h" #include "chrome/browser/download/download_request_limiter.h"
...@@ -248,7 +248,7 @@ void AppendComponentUpdaterThrottles( ...@@ -248,7 +248,7 @@ void AppendComponentUpdaterThrottles(
// We got a component we need to install, so throttle the resource // We got a component we need to install, so throttle the resource
// until the component is installed. // until the component is installed.
throttles->push_back( throttles->push_back(
cus->GetOnDemandUpdater().GetOnDemandResourceThrottle(request, crx_id)); component_updater::GetOnDemandResourceThrottle(cus, crx_id));
} }
} }
......
...@@ -279,6 +279,8 @@ ...@@ -279,6 +279,8 @@
'browser/component_updater/component_unpacker.h', 'browser/component_updater/component_unpacker.h',
'browser/component_updater/component_updater_ping_manager.cc', 'browser/component_updater/component_updater_ping_manager.cc',
'browser/component_updater/component_updater_ping_manager.h', 'browser/component_updater/component_updater_ping_manager.h',
'browser/component_updater/component_updater_resource_throttle.cc',
'browser/component_updater/component_updater_resource_throttle.h',
'browser/component_updater/component_updater_service.cc', 'browser/component_updater/component_updater_service.cc',
'browser/component_updater/component_updater_service.h', 'browser/component_updater/component_updater_service.h',
'browser/component_updater/component_updater_utils.cc', 'browser/component_updater/component_updater_utils.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment