Adds a bit of Greasemonkey support hidden behind the --enable-greasemonkey flag. Implementation follows the pattern of the visited links system.

Things still to be done:
- stop using a hardcoded script directory
- watch script directory and update shared memory when necessary
- move file io to background thread
- support for @include patterns -- now, all scripts are applied to all pages
Review URL: http://codereview.chromium.org/7254

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3496 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h
index 2d1c198..38fd144 100644
--- a/chrome/renderer/render_thread.h
+++ b/chrome/renderer/render_thread.h
@@ -18,6 +18,7 @@
 struct WebPreferences;
 class RenderDnsMaster;
 class NotificationService;
+class GreasemonkeySlave;
 
 // The RenderThreadBase is the minimal interface that a RenderWidget expects
 // from a render thread. The interface basically abstracts a way to send and
@@ -64,8 +65,12 @@
   // The RenderThread instance for the current thread.
   static RenderThread* current();
 
+  // Gets the VisitedLinkSlave instance for this thread
   VisitedLinkSlave* visited_link_slave() const { return visited_link_slave_; }
 
+  // Gets the GreasemonkeySlave instance for this thread
+  GreasemonkeySlave* greasemonkey_slave() const { return greasemonkey_slave_; }
+
   // Do DNS prefetch resolution of a hostname.
   void Resolve(const char* name, size_t length);
 
@@ -89,6 +94,7 @@
 
  private:
   void OnUpdateVisitedLinks(SharedMemoryHandle table);
+  void OnUpdateGreasemonkeyScripts(SharedMemoryHandle table);
 
   void OnPluginMessage(const std::wstring& dll_path,
                        const std::vector<uint8>& data);
@@ -120,6 +126,7 @@
 
   // These objects live solely on the render thread.
   VisitedLinkSlave* visited_link_slave_;
+  GreasemonkeySlave* greasemonkey_slave_;
 
   scoped_ptr<RenderDnsMaster> render_dns_master_;