summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/user_script_master.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 00:34:30 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 00:34:30 +0000
commitf3b1a084a01ab82caf998daefcb989c66ff16135 (patch)
tree1072e46976c2fb7fa82d72c74bdc579d78f0ce01 /chrome/browser/extensions/user_script_master.cc
parent8f0633691cd10779408642e2ad5eaa9b0c190b0a (diff)
downloadchromium_src-f3b1a084a01ab82caf998daefcb989c66ff16135.zip
chromium_src-f3b1a084a01ab82caf998daefcb989c66ff16135.tar.gz
chromium_src-f3b1a084a01ab82caf998daefcb989c66ff16135.tar.bz2
Define the public interface for content browser RenderProcessHost. This interface is implemented by the RenderProcessHostImpl class which lives in content\browser\renderer_host\render_process_host_impl.cc/.h. The RenderProcessHostImpl class is a consolidation of the RenderProcessHost and BrowserRenderProcessHost classes.
The RenderProcessHost public interface was created from the now deleted RenderProcessHost class defined in content\browser\renderer_host\render_process_host.h. Additional methods have been added to the interface to ensure that it works correctly with the MockRenderProcessHost class used by unit tests. I had to implement a number of overrides in the MockRenderProcessHost class to ensure that tests work correctly. This was because of assumptions in the tests that the MockRPH class was a real RPH which it was till now. Added a TODO for the methods which could potentially be removed from this interface. Will revisit that in a subsequent CL. BUG=98716 TEST=No change in functionality. Hopefully it all compiles and works. Review URL: http://codereview.chromium.org/8515027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110615 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/user_script_master.cc')
-rw-r--r--chrome/browser/extensions/user_script_master.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc
index f936459..7a2082a 100644
--- a/chrome/browser/extensions/user_script_master.cc
+++ b/chrome/browser/extensions/user_script_master.cc
@@ -24,8 +24,8 @@
#include "chrome/common/extensions/extension_message_bundle.h"
#include "chrome/common/extensions/extension_resource.h"
#include "chrome/common/extensions/extension_set.h"
-#include "content/browser/renderer_host/render_process_host.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/render_process_host.h"
using content::BrowserThread;
@@ -320,7 +320,8 @@ void UserScriptMaster::NewScriptsAvailable(base::SharedMemory* handle) {
// We've got scripts ready to go.
shared_memory_.swap(handle_deleter);
- for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
+ for (content::RenderProcessHost::iterator i(
+ content::RenderProcessHost::AllHostsIterator());
!i.IsAtEnd(); i.Advance()) {
SendUpdate(i.GetCurrentValue(), handle);
}
@@ -380,10 +381,10 @@ void UserScriptMaster::Observe(int type,
break;
}
case content::NOTIFICATION_RENDERER_PROCESS_CREATED: {
- RenderProcessHost* process =
- content::Source<RenderProcessHost>(source).ptr();
+ content::RenderProcessHost* process =
+ content::Source<content::RenderProcessHost>(source).ptr();
Profile* profile = Profile::FromBrowserContext(
- process->browser_context());
+ process->GetBrowserContext());
if (!profile_->IsSameProfile(profile))
return;
if (ScriptsReady())
@@ -410,9 +411,9 @@ void UserScriptMaster::StartLoad() {
script_reloader_->StartLoad(user_scripts_, extensions_info_);
}
-void UserScriptMaster::SendUpdate(RenderProcessHost* process,
+void UserScriptMaster::SendUpdate(content::RenderProcessHost* process,
base::SharedMemory* shared_memory) {
- Profile* profile = Profile::FromBrowserContext(process->browser_context());
+ Profile* profile = Profile::FromBrowserContext(process->GetBrowserContext());
// Make sure we only send user scripts to processes in our profile.
if (!profile_->IsSameProfile(profile))
return;