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

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

Issue 8769013: Remove BrowserThread::UnsafeGetBrowserThread, add UnsafeGetMessageLoopForThread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to lkgr (pure merge). Created 9 years 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
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 92d3fe2231e9f711d0d872ecc61fdea286c7c673..7f43d43672313e93fa0de2e2a6e9a06544380680 100644
--- a/chrome/browser/sessions/base_session_service.h
+++ b/chrome/browser/sessions/base_session_service.h
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
+#include "base/location.h"
#include "base/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
@@ -22,10 +23,6 @@ class SessionBackend;
class SessionCommand;
class TabNavigation;
-namespace base {
-class Thread;
-}
-
// BaseSessionService is the super class of both tab restore service and
// session service. It contains commonality needed by both, in particular
// it manages a set of SessionCommands that are periodically sent to a
@@ -85,9 +82,6 @@ class BaseSessionService : public CancelableRequestProvider,
// Returns the backend.
SessionBackend* backend() const { return backend_; }
- // Returns the thread the backend runs on. This returns NULL during testing.
- base::Thread* backend_thread() const { return backend_thread_; }
-
// Returns the set of commands that needed to be scheduled. The commands
// in the vector are owned by BaseSessionService, until they are scheduled
// on the backend at which point the backend owns the commands.
@@ -157,6 +151,12 @@ class BaseSessionService : public CancelableRequestProvider,
InternalGetCommandsRequest* request,
CancelableRequestConsumerBase* consumer);
+ // In production, this posts the task to the FILE thread. For
+ // tests, it immediately runs the specified task on the current
+ // thread.
+ bool RunTaskOnBackendThread(const tracked_objects::Location& from_here,
+ const base::Closure& task);
+
// Max number of navigation entries in each direction we'll persist.
static const int max_persist_navigation_count;
@@ -170,9 +170,6 @@ class BaseSessionService : public CancelableRequestProvider,
// The backend.
scoped_refptr<SessionBackend> backend_;
- // Thread backend tasks are run on, is NULL during testing.
- base::Thread* backend_thread_;
-
// Used to invoke Save.
base::WeakPtrFactory<BaseSessionService> weak_factory_;
« no previous file with comments | « chrome/browser/printing/printer_manager_dialog_win.cc ('k') | chrome/browser/sessions/base_session_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698