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

Unified Diff: chrome/browser/extensions/extension_event_router.cc

Issue 8515027: Define the public version of the browser side RenderProcessHost interface. This interface is not ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/extensions/extension_event_router.cc
===================================================================
--- chrome/browser/extensions/extension_event_router.cc (revision 110571)
+++ chrome/browser/extensions/extension_event_router.cc (working copy)
@@ -22,8 +22,8 @@
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/extensions/api/extension_api.h"
#include "content/browser/child_process_security_policy.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;
using extensions::ExtensionAPI;
@@ -43,10 +43,11 @@
} // namespace
struct ExtensionEventRouter::EventListener {
- RenderProcessHost* process;
+ content::RenderProcessHost* process;
std::string extension_id;
- EventListener(RenderProcessHost* process, const std::string& extension_id)
+ EventListener(content::RenderProcessHost* process,
+ const std::string& extension_id)
: process(process), extension_id(extension_id) {}
bool operator<(const EventListener& that) const {
@@ -109,14 +110,15 @@
void ExtensionEventRouter::AddEventListener(
const std::string& event_name,
- RenderProcessHost* process,
+ content::RenderProcessHost* process,
const std::string& extension_id) {
EventListener listener(process, extension_id);
DCHECK_EQ(listeners_[event_name].count(listener), 0u) << event_name;
listeners_[event_name].insert(listener);
if (extension_devtools_manager_.get())
- extension_devtools_manager_->AddEventListener(event_name, process->id());
+ extension_devtools_manager_->AddEventListener(event_name,
+ process->GetID());
// We lazily tell the TaskManager to start updating when listeners to the
// processes.onUpdated event arrive.
@@ -126,18 +128,19 @@
void ExtensionEventRouter::RemoveEventListener(
const std::string& event_name,
- RenderProcessHost* process,
+ content::RenderProcessHost* process,
const std::string& extension_id) {
EventListener listener(process, extension_id);
DCHECK_EQ(listeners_[event_name].count(listener), 1u) <<
- " PID=" << process->id() << " extension=" << extension_id <<
+ " PID=" << process->GetID() << " extension=" << extension_id <<
" event=" << event_name;
listeners_[event_name].erase(listener);
// Note: extension_id may point to data in the now-deleted listeners_ object.
// Do not use.
if (extension_devtools_manager_.get())
- extension_devtools_manager_->RemoveEventListener(event_name, process->id());
+ extension_devtools_manager_->RemoveEventListener(event_name,
+ process->GetID());
// If a processes.onUpdated event listener is removed (or a process with one
// exits), then we let the TaskManager know that it has one fewer listener.
@@ -273,14 +276,13 @@
continue;
Profile* listener_profile = Profile::FromBrowserContext(
- listener->process->browser_context());
+ listener->process->GetBrowserContext());
extensions::ProcessMap* process_map =
listener_profile->GetExtensionService()->process_map();
-
// If the event is privileged, only send to extension processes. Otherwise,
// it's OK to send to normal renderers (e.g., for content scripts).
if (ExtensionAPI::GetInstance()->IsPrivileged(event->event_name) &&
- !process_map->Contains(extension->id(), listener->process->id())) {
+ !process_map->Contains(extension->id(), listener->process->GetID())) {
continue;
}
@@ -366,8 +368,8 @@
switch (type) {
case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED:
case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: {
- RenderProcessHost* renderer =
- content::Source<RenderProcessHost>(source).ptr();
+ content::RenderProcessHost* renderer =
+ content::Source<content::RenderProcessHost>(source).ptr();
// Remove all event listeners associated with this renderer
for (ListenerMap::iterator it = listeners_.begin();
it != listeners_.end(); ) {
« no previous file with comments | « chrome/browser/extensions/extension_event_router.h ('k') | chrome/browser/extensions/extension_file_browser_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698