| Index: components/update_client/ping_manager.cc
|
| diff --git a/components/update_client/ping_manager.cc b/components/update_client/ping_manager.cc
|
| index 191881457b5596271de9231e6449a8f37b3dd060..2d665933db06dcb631ffc311d95f61a1adadb595 100644
|
| --- a/components/update_client/ping_manager.cc
|
| +++ b/components/update_client/ping_manager.cc
|
| @@ -179,7 +179,9 @@ class PingSender {
|
| bool SendPing(const CrxUpdateItem* item);
|
|
|
| private:
|
| - void OnRequestSenderComplete(int error, const std::string& response);
|
| + void OnRequestSenderComplete(int error,
|
| + const std::string& response,
|
| + int retry_after_sec);
|
|
|
| const scoped_refptr<Configurator> config_;
|
| scoped_ptr<RequestSender> request_sender_;
|
| @@ -196,7 +198,8 @@ PingSender::~PingSender() {
|
| }
|
|
|
| void PingSender::OnRequestSenderComplete(int error,
|
| - const std::string& response) {
|
| + const std::string& response,
|
| + int retry_after_sec) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| delete this;
|
| }
|
| @@ -205,7 +208,9 @@ bool PingSender::SendPing(const CrxUpdateItem* item) {
|
| DCHECK(item);
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
|
|
| - std::vector<GURL> urls(config_->PingUrl());
|
| + auto urls(config_->PingUrl());
|
| + if (item->component.requires_network_encryption)
|
| + RemoveUnsecureUrls(&urls);
|
|
|
| if (urls.empty())
|
| return false;
|
| @@ -225,12 +230,14 @@ PingManager::PingManager(const scoped_refptr<Configurator>& config)
|
| PingManager::~PingManager() {
|
| }
|
|
|
| -// Sends a fire and forget ping when the updates are complete. The ping
|
| -// sender object self-deletes after sending the ping has completed asynchrously.
|
| -void PingManager::SendPing(const CrxUpdateItem* item) {
|
| - PingSender* ping_sender(new PingSender(config_));
|
| +bool PingManager::SendPing(const CrxUpdateItem* item) {
|
| + scoped_ptr<PingSender> ping_sender(new PingSender(config_));
|
| if (!ping_sender->SendPing(item))
|
| - delete ping_sender;
|
| + return false;
|
| +
|
| + // The ping sender object self-deletes after sending the ping asynchrously.
|
| + ping_sender.release();
|
| + return true;
|
| }
|
|
|
| } // namespace update_client
|
|
|