This source file includes following definitions.
- routing_id_
- OnDestruct
- OnMessageReceived
- Send
- render_frame
- RenderFrameGone
#include "content/public/renderer/render_frame_observer.h"
#include "content/renderer/render_frame_impl.h"
using blink::WebFrame;
namespace content {
RenderFrameObserver::RenderFrameObserver(RenderFrame* render_frame)
: render_frame_(render_frame),
routing_id_(MSG_ROUTING_NONE) {
if (render_frame) {
RenderFrameImpl* impl = static_cast<RenderFrameImpl*>(render_frame);
routing_id_ = impl->GetRoutingID();
impl->AddObserver(this);
}
}
RenderFrameObserver::~RenderFrameObserver() {
if (render_frame_) {
RenderFrameImpl* impl = static_cast<RenderFrameImpl*>(render_frame_);
impl->RemoveObserver(this);
}
}
void RenderFrameObserver::OnDestruct() {
delete this;
}
bool RenderFrameObserver::OnMessageReceived(const IPC::Message& message) {
return false;
}
bool RenderFrameObserver::Send(IPC::Message* message) {
if (render_frame_)
return render_frame_->Send(message);
delete message;
return false;
}
RenderFrame* RenderFrameObserver::render_frame() const {
return render_frame_;
}
void RenderFrameObserver::RenderFrameGone() {
render_frame_ = NULL;
}
}