chromium/chrome/browser/icon_transcoder/svg_icon_transcoder.h

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_ICON_TRANSCODER_SVG_ICON_TRANSCODER_H_
#define CHROME_BROWSER_ICON_TRANSCODER_SVG_ICON_TRANSCODER_H_

#include <memory>
#include <string>
#include <vector>

#include "base/files/file_path.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_process_host_observer.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image.h"
#include "url/gurl.h"

namespace content {
class BrowserContext;
class WebContents;
}  // namespace content

namespace apps {

IconContentCallback;

// SvgIconTranscoder uses WebContents to transform an svg icon (as a file or
// as string data) into an SkBitmap and thence into png compressed data which
// can be written to a png file. In principal, this technique should work for
// any data:image/ mime-types supported by WebContents, but svg is all we need
// right now. File handling happens in the browser process.
// Some validation of svg data is performed prior to asking a WebContents
// renderer process (which could potentially die on bad data) to render the
// image. Since a renderer process can be destroyed for many valid reasons,
// SvgIconTranscoder always checks if its WebContents must be recreated.
class SvgIconTranscoder : public content::RenderProcessHostObserver {};

}  // namespace apps

#endif  // CHROME_BROWSER_ICON_TRANSCODER_SVG_ICON_TRANSCODER_H_