I tired with the offscreen mode and here are the problems I found:
- [x] <del>The `data` of `paint` event is empty when loading simple local pages.</del>
- [x] The size of `data` is wrong, current implement uses the size of pointer (`sizeof(bitmap_pixels)`).
- [x] Crashes when opening devtools for offscreen window.
- [x] We should probably show a dummy view indicating it is offscreen instead of provide NULL.
- [x] The offscreen window is affecting the rendering of other windows. Try running `./script/test.py -g offscreen` and then refreshing the window.

/cc @gerhardberger @brenca

atom/browser/api/atom_api_web_contents.cc
content::RenderFrameHost* render_frame_host) {
  if (!render_frame_host->GetParent()) {
    if (IsOffScreen()) {
      auto* rwhv = web_contents()->GetRenderWidgetHostView();
      static_cast<OffScreenRenderWidgetHostView*>(rwhv)->SetPaintCallback(
          base::Bind(&WebContents::OnPaint, base::Unretained(this)));
    }
    Emit("dom-ready");
  }
}
void WebContents::DidFinishLoad(content::RenderFrameHost* render_frame_host,
                                const GURL& validated_url) {
  bool is_main_frame = !render_frame_host->GetParent();
  Emit("did-frame-finish-load", is_main_frame);
  if (is_main_frame)
    Emit("did-finish-load");
}
void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
                              const GURL& url,
                              int error_code,
                              const base::string16& error_description,
                              bool was_ignored_by_handler) {
  bool is_main_frame = !render_frame_host->GetParent();
  Emit("did-fail-load", error_code, error_description, url, is_main_frame);
}
void WebContents::DidStartLoading() {