Port Android relocation packer to chromium build
[chromium-blink-merge.git] / components / sessions / base_session_service_delegate.h
blob45e0020cbc84bb1ac159605c1221e28ea09e6ee9
1 // Copyright 2014 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_SESSIONS_BASE_SESSION_SERVICE_DELEGATE_H_
6 #define COMPONENTS_SESSIONS_BASE_SESSION_SERVICE_DELEGATE_H_
8 #include "base/memory/scoped_ptr.h"
10 namespace base {
11 class SequencedWorkerPool;
14 class GURL;
16 namespace sessions {
18 // The BaseSessionServiceDelegate decouples the BaseSessionService from
19 // chrome/content dependencies.
20 class BaseSessionServiceDelegate {
21 public:
22 BaseSessionServiceDelegate() {}
24 // Get the sequenced worker pool for running tasks on the backend thread as
25 // long as the system is not shutting down.
26 virtual base::SequencedWorkerPool* GetBlockingPool() = 0;
28 // Tests if a given URL should be tracked.
29 virtual bool ShouldTrackEntry(const GURL& url) = 0;
31 // Returns true if save operations can be performed as a delayed task - which
32 // is usually only used by unit tests.
33 virtual bool ShouldUseDelayedSave() = 0;
35 // Called when commands are about to be written to disc.
36 virtual void OnWillSaveCommands() = 0;
38 // Called when commands were saved to disc.
39 virtual void OnSavedCommands() = 0;
41 protected:
42 virtual ~BaseSessionServiceDelegate() {}
45 } // namespace sessions
47 #endif // COMPONENTS_SESSIONS_BASE_SESSION_SERVICE_DELEGATE_H_