  bool MaybeGetRenderFrame(std::string* error_msg,
                           const std::string& method_name,
                           content::RenderFrame** render_frame_ptr) {
    auto* frame = render_frame();
    if (!frame) {
      *error_msg = "Render frame was torn down before webFrame." + method_name +
                   " could be "
                   "executed";
      return false;
    }
    *render_frame_ptr = frame;
    return true;
  }
  bool MaybeGetRenderFrame(std::string* error_msg,
                           const std::string& method_name,
                           content::RenderFrame** render_frame_ptr) {
    auto* frame = render_frame();
    if (!frame) {
      *error_msg = "Render frame was torn down before webFrame." + method_name +
                   " could be "
                   "executed";
      return false;
    }
    *render_frame_ptr = frame;
    return true;
  }