| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_DELEGATE_H_ | 6 #define CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 | 9 |
| 10 namespace base { | 10 namespace base { |
| 11 class SequencedWorkerPool; | 11 class SequencedWorkerPool; |
| 12 } | 12 } |
| 13 | 13 |
| 14 class GURL; | 14 class GURL; |
| 15 | 15 |
| 16 // The BaseSessionServiceDelegate decouples the BaseSessionService from | 16 // The BaseSessionServiceDelegate decouples the BaseSessionService from |
| 17 // chrome/content dependencies. | 17 // chrome/content dependencies. |
| 18 class BaseSessionServiceDelegate { | 18 class BaseSessionServiceDelegate { |
| 19 public: | 19 public: |
| 20 BaseSessionServiceDelegate() {} | 20 BaseSessionServiceDelegate() {} |
| 21 virtual ~BaseSessionServiceDelegate() {} | |
| 22 | 21 |
| 23 // Get the sequenced worker pool for running tasks on the backend thread as | 22 // Get the sequenced worker pool for running tasks on the backend thread as |
| 24 // long as the system is not shutting down. | 23 // long as the system is not shutting down. |
| 25 virtual base::SequencedWorkerPool* GetBlockingPool() = 0; | 24 virtual base::SequencedWorkerPool* GetBlockingPool() = 0; |
| 26 | 25 |
| 27 // Tests if a given URL should be tracked. | 26 // Tests if a given URL should be tracked. |
| 28 virtual bool ShouldTrackEntry(const GURL& url) = 0; | 27 virtual bool ShouldTrackEntry(const GURL& url) = 0; |
| 29 | 28 |
| 30 // Returns true if save operations can be performed as a delayed task - which | 29 // Returns true if save operations can be performed as a delayed task - which |
| 31 // is usually only used by unit tests. | 30 // is usually only used by unit tests. |
| 32 virtual bool ShouldUseDelayedSave() = 0; | 31 virtual bool ShouldUseDelayedSave() = 0; |
| 32 |
| 33 // Called when commands are about to be written to disc. |
| 34 virtual void OnWillSaveCommands() = 0; |
| 35 |
| 36 // Called when commands were saved to disc. |
| 37 virtual void OnSavedCommands() = 0; |
| 38 |
| 39 protected: |
| 40 virtual ~BaseSessionServiceDelegate() {} |
| 33 }; | 41 }; |
| 34 | 42 |
| 35 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_DELEGATE_H_ | 43 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_DELEGATE_H_ |
| OLD | NEW |