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

Unified Diff: chrome/browser/sessions/base_session_service.h

Issue 22363005: Switch BaseSessionService to use SequencedWorkerPool instead of FILE thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/sessions/base_session_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/base_session_service.h
diff --git a/chrome/browser/sessions/base_session_service.h b/chrome/browser/sessions/base_session_service.h
index be2c258dc3d3ed81ea4648165c3e375a7538a6bb..db948379d1812b3401d246052c2731d43f35577f 100644
--- a/chrome/browser/sessions/base_session_service.h
+++ b/chrome/browser/sessions/base_session_service.h
@@ -13,6 +13,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
+#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/common/cancelable_request.h"
#include "chrome/browser/sessions/session_id.h"
#include "chrome/common/cancelable_task_tracker.h"
@@ -154,16 +155,11 @@ class BaseSessionService : public CancelableRequestProvider {
const InternalGetCommandsCallback& callback,
CancelableTaskTracker* tracker);
- // In production, this posts the task to the FILE thread. For
- // tests, it immediately runs the specified task on the current
- // thread.
+ // This posts the task to the SequencedWorkerPool, or run immediately
+ // if the SequencedWorkerPool has been shutdown.
bool RunTaskOnBackendThread(const tracked_objects::Location& from_here,
const base::Closure& task);
- // Returns true if we appear to be running in production, false if we appear
- // to be running as part of a unit test or if the FILE thread has gone away.
- bool RunningInProduction() const;
-
// Max number of navigation entries in each direction we'll persist.
static const int max_persist_navigation_count;
@@ -189,6 +185,9 @@ class BaseSessionService : public CancelableRequestProvider {
// The number of commands sent to the backend before doing a reset.
int commands_since_reset_;
+ // A token to make sure that all tasks will be serialized.
+ base::SequencedWorkerPool::SequenceToken sequence_token_;
+
DISALLOW_COPY_AND_ASSIGN(BaseSessionService);
};
« no previous file with comments | « no previous file | chrome/browser/sessions/base_session_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698