summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/user_script_master.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-30 01:49:06 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-30 01:49:06 +0000
commit95d291980d768c38e1f70bc041957870913e07f6 (patch)
tree383ea24e44f58696c3cf2871f44846f5a973f473 /chrome/browser/extensions/user_script_master.h
parentbb3bb6d013ca8b7b9fde9b985950f181cc32577a (diff)
downloadchromium_src-95d291980d768c38e1f70bc041957870913e07f6.zip
chromium_src-95d291980d768c38e1f70bc041957870913e07f6.tar.gz
chromium_src-95d291980d768c38e1f70bc041957870913e07f6.tar.bz2
Get rid of MessageLoop* caching in extensions code.
BUG=25354 Review URL: http://codereview.chromium.org/345023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/user_script_master.h')
-rw-r--r--chrome/browser/extensions/user_script_master.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/chrome/browser/extensions/user_script_master.h b/chrome/browser/extensions/user_script_master.h
index c5a8803..a062448 100644
--- a/chrome/browser/extensions/user_script_master.h
+++ b/chrome/browser/extensions/user_script_master.h
@@ -11,11 +11,11 @@
#include "base/file_path.h"
#include "base/scoped_ptr.h"
#include "base/shared_memory.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/common/extensions/user_script.h"
#include "chrome/common/notification_registrar.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
-class MessageLoop;
namespace base {
class StringPiece;
}
@@ -26,10 +26,9 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>,
public DirectoryWatcher::Delegate,
public NotificationObserver {
public:
- // For testability, the constructor takes the MessageLoop to run the
- // script-reloading worker on as well as the path the scripts live in.
- // These are normally the file thread and a directory inside the profile.
- UserScriptMaster(MessageLoop* worker, const FilePath& script_dir);
+ // For testability, the constructor takes the path the scripts live in.
+ // This is normally a directory inside the profile.
+ UserScriptMaster(const FilePath& script_dir);
virtual ~UserScriptMaster();
// Add a watched directory. All scripts will be reloaded when any file in
@@ -82,7 +81,7 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>,
// Start a scan for scripts.
// Will always send a message to the master upon completion.
- void StartScan(MessageLoop* work_loop, const FilePath& script_dir,
+ void StartScan(const FilePath& script_dir,
const UserScriptList& external_scripts);
// The master is going away; don't call it back.
@@ -114,7 +113,7 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>,
// The message loop to call our master back on.
// Expected to always outlive us.
- MessageLoop* master_message_loop_;
+ ChromeThread::ID master_thread_id_;
DISALLOW_COPY_AND_ASSIGN(ScriptReloader);
};
@@ -136,10 +135,6 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>,
// The watcher watches the profile's user scripts directory for new scripts.
std::vector<DirectoryWatcher*> dir_watchers_;
- // The MessageLoop that the scanner worker runs on.
- // Typically the file thread; configurable for testing.
- MessageLoop* worker_loop_;
-
// ScriptReloader (in another thread) reloads script off disk.
// We hang on to our pointer to know if we've already got one running.
scoped_refptr<ScriptReloader> script_reloader_;