Extension syncing: Introduce a NeedsSync pref
[chromium-blink-merge.git] / components / update_client / action_wait.h
blobd54062b609d1ab985ca9444bcac08094d7358157
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_UPDATE_CLIENT_ACTION_WAIT_H_
6 #define COMPONENTS_UPDATE_CLIENT_ACTION_WAIT_H_
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "base/time/time.h"
12 #include "components/update_client/action.h"
14 namespace update_client {
16 // Implements a wait between handling updates for the CRXs in this context.
17 // To avoid thrashing of local computing resources, updates are applied one
18 // at a time, with a delay between them.
19 class ActionWait : public Action, protected ActionImpl {
20 public:
21 explicit ActionWait(const base::TimeDelta& time_delta);
22 ~ActionWait() override;
24 void Run(UpdateContext* update_context, Callback callback) override;
26 private:
27 void WaitComplete();
29 const base::TimeDelta time_delta_;
31 DISALLOW_COPY_AND_ASSIGN(ActionWait);
34 } // namespace update_client
36 #endif // COMPONENTS_UPDATE_CLIENT_ACTION_WAIT_H_