#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/bookmarks/bookmark_html_writer.h"
#include <stddef.h>
#include <stdint.h>
#include <list>
#include <map>
#include <memory>
#include <string>
#include "base/base64.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/supports_user_data.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "components/bookmarks/browser/bookmark_codec.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/favicon/core/favicon_service.h"
#include "components/favicon_base/favicon_types.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/browser_thread.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/favicon_size.h"
BookmarkCodec;
BookmarkNode;
BrowserThread;
namespace {
const char kBookmarkFaviconFetcherKey[] = …;
const char kHeader[] = …;
const char kNewline[] = …;
const char kBookmarkStart[] = …;
const char kAddDate[] = …;
const char kIcon[] = …;
const char kBookmarkAttributeEnd[] = …;
const char kBookmarkEnd[] = …;
const char kFolderStart[] = …;
const char kLastModified[] = …;
const char kBookmarkBar[] = …;
const char kFolderAttributeEnd[] = …;
const char kFolderEnd[] = …;
const char kFolderChildren[] = …;
const char kFolderChildrenEnd[] = …;
const size_t kIndentSize = …;
class BookmarkFaviconFetcher : public base::SupportsUserData::Data { … };
class Writer : public base::RefCountedThreadSafe<Writer> { … };
}
BookmarkFaviconFetcher::BookmarkFaviconFetcher(
Profile* profile,
const base::FilePath& path,
BookmarksExportObserver* observer)
: … { … }
void BookmarkFaviconFetcher::ExportBookmarks() { … }
void BookmarkFaviconFetcher::ExtractUrls(const BookmarkNode* node) { … }
void BookmarkFaviconFetcher::ExecuteWriter() { … }
bool BookmarkFaviconFetcher::FetchNextFavicon() { … }
void BookmarkFaviconFetcher::OnFaviconDataAvailable(
const favicon_base::FaviconRawBitmapResult& bitmap_result) { … }
namespace bookmark_html_writer {
void WriteBookmarks(Profile* profile,
const base::FilePath& path,
BookmarksExportObserver* observer) { … }
}