This source file includes following definitions.
- routing_id_
- GetRoutingID
- Send
#include "chrome/renderer/extensions/chrome_v8_extension_handler.h"
#include "base/logging.h"
#include "chrome/renderer/extensions/chrome_v8_context.h"
#include "content/public/renderer/render_thread.h"
using content::RenderThread;
namespace extensions {
ChromeV8ExtensionHandler::ChromeV8ExtensionHandler(ChromeV8Context* context)
: context_(context), routing_id_(MSG_ROUTING_NONE) {
}
ChromeV8ExtensionHandler::~ChromeV8ExtensionHandler() {
if (routing_id_ != MSG_ROUTING_NONE)
RenderThread::Get()->RemoveRoute(routing_id_);
}
int ChromeV8ExtensionHandler::GetRoutingID() {
if (routing_id_ == MSG_ROUTING_NONE) {
routing_id_ = RenderThread::Get()->GenerateRoutingID();
RenderThread::Get()->AddRoute(routing_id_, this);
}
return routing_id_;
}
void ChromeV8ExtensionHandler::Send(IPC::Message* message) {
RenderThread::Get()->Send(message);
}
}