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

Side by Side Diff: components/update_client/update_engine.cc

Issue 1899043002: Implement ping_freshness for update_client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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
« no previous file with comments | « components/update_client/update_client_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/update_client/update_engine.h" 5 #include "components/update_client/update_engine.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return; 93 return;
94 } 94 }
95 95
96 scoped_ptr<UpdateContext> update_context(new UpdateContext( 96 scoped_ptr<UpdateContext> update_context(new UpdateContext(
97 config_, is_foreground, ids, crx_data_callback, 97 config_, is_foreground, ids, crx_data_callback,
98 notify_observers_callback_, callback, update_checker_factory_, 98 notify_observers_callback_, callback, update_checker_factory_,
99 crx_downloader_factory_, ping_manager_)); 99 crx_downloader_factory_, ping_manager_));
100 100
101 CrxUpdateItem update_item; 101 CrxUpdateItem update_item;
102 scoped_ptr<ActionUpdateCheck> update_check_action(new ActionUpdateCheck( 102 scoped_ptr<ActionUpdateCheck> update_check_action(new ActionUpdateCheck(
103 (*update_context->update_checker_factory)(config_, *metadata_), 103 (*update_context->update_checker_factory)(config_, metadata_.get()),
104 config_->GetBrowserVersion(), config_->ExtraRequestParams())); 104 config_->GetBrowserVersion(), config_->ExtraRequestParams()));
105 105
106 update_context->current_action.reset(update_check_action.release()); 106 update_context->current_action.reset(update_check_action.release());
107 update_contexts_.insert(update_context.get()); 107 update_contexts_.insert(update_context.get());
108 108
109 update_context->current_action->Run( 109 update_context->current_action->Run(
110 update_context.get(), 110 update_context.get(),
111 base::Bind(&UpdateEngine::UpdateComplete, base::Unretained(this), 111 base::Bind(&UpdateEngine::UpdateComplete, base::Unretained(this),
112 update_context.get())); 112 update_context.get()));
113 113
(...skipping 30 matching lines...) Expand all
144 144
145 const auto now(base::Time::Now()); 145 const auto now(base::Time::Now());
146 146
147 // Throttle the calls in the interval (t - 1 day, t) to limit the effect of 147 // Throttle the calls in the interval (t - 1 day, t) to limit the effect of
148 // unset clocks or clock drift. 148 // unset clocks or clock drift.
149 return throttle_updates_until_ - base::TimeDelta::FromDays(1) < now && 149 return throttle_updates_until_ - base::TimeDelta::FromDays(1) < now &&
150 now < throttle_updates_until_; 150 now < throttle_updates_until_;
151 } 151 }
152 152
153 } // namespace update_client 153 } // namespace update_client
OLDNEW
« no previous file with comments | « components/update_client/update_client_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698