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

Unified Diff: chrome/renderer/render_thread.cc

Issue 7254: Initial Greasemonkey support (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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 | « chrome/renderer/render_thread.h ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_thread.cc
===================================================================
--- chrome/renderer/render_thread.cc (revision 3492)
+++ chrome/renderer/render_thread.cc (working copy)
@@ -15,6 +15,7 @@
#include "chrome/common/notification_service.h"
#include "chrome/plugin/plugin_channel.h"
#include "chrome/renderer/net/render_dns_master.h"
+#include "chrome/renderer/greasemonkey_slave.h"
#include "chrome/renderer/render_process.h"
#include "chrome/renderer/render_view.h"
#include "chrome/renderer/visitedlink_slave.h"
@@ -41,6 +42,7 @@
channel_name_(channel_name),
owner_loop_(MessageLoop::current()),
visited_link_slave_(NULL),
+ greasemonkey_slave_(NULL),
render_dns_master_(NULL),
in_send_(0) {
DCHECK(owner_loop_);
@@ -111,9 +113,8 @@
// The renderer thread should wind-up COM.
CoInitialize(0);
- // TODO(darin): We should actually try to share this object between
- // RenderThread instances.
visited_link_slave_ = new VisitedLinkSlave();
+ greasemonkey_slave_ = new GreasemonkeySlave();
render_dns_master_.reset(new RenderDnsMaster());
@@ -141,6 +142,9 @@
delete visited_link_slave_;
visited_link_slave_ = NULL;
+ delete greasemonkey_slave_;
+ greasemonkey_slave_ = NULL;
+
CoUninitialize();
}
@@ -149,6 +153,11 @@
visited_link_slave_->Init(table);
}
+void RenderThread::OnUpdateGreasemonkeyScripts(SharedMemoryHandle scripts) {
+ DCHECK(scripts) << "Bad scripts handle";
+ greasemonkey_slave_->UpdateScripts(scripts);
+}
+
void RenderThread::OnMessageReceived(const IPC::Message& msg) {
// NOTE: We could subclass router_ to intercept OnControlMessageReceived, but
// it seems simpler to just process any control messages that we care about
@@ -163,6 +172,8 @@
IPC_MESSAGE_HANDLER(ViewMsg_GetCacheResourceStats,
OnGetCacheResourceStats)
IPC_MESSAGE_HANDLER(ViewMsg_PluginMessage, OnPluginMessage)
+ IPC_MESSAGE_HANDLER(ViewMsg_Greasemonkey_NewScripts,
+ OnUpdateGreasemonkeyScripts)
// send the rest to the router
IPC_MESSAGE_UNHANDLED(router_.OnMessageReceived(msg))
IPC_END_MESSAGE_MAP()
« no previous file with comments | « chrome/renderer/render_thread.h ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698