Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1929)

Unified Diff: components/history/core/android/android_history_types.cc

Issue 849323002: Componentize HistoryDatabase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android compilation Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/history/core/android/android_history_types.cc
diff --git a/components/history/core/android/android_history_types.cc b/components/history/core/android/android_history_types.cc
deleted file mode 100644
index c712101b679e1c7e76a4326616a7a37edbf989fa..0000000000000000000000000000000000000000
--- a/components/history/core/android/android_history_types.cc
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/history/core/android/android_history_types.h"
-
-namespace history {
-
-namespace {
-// The column name defined in android.provider.Browser.BookmarkColumns
-const char* const kAndroidBookmarkColumn[] = {
- "_id",
- "url",
- "title",
- "created",
- "date",
- "visits",
- "favicon",
- "bookmark",
- "raw_url",
-};
-
-// The column name defined in android.provider.Browser.SearchColumns
-const char* const kAndroidSearchColumn[] = {
- "_id",
- "search",
- "date",
-};
-
-class BookmarkIDMapping : public std::map<std::string,
- HistoryAndBookmarkRow::ColumnID> {
- public:
- BookmarkIDMapping() {
- static_assert(arraysize(kAndroidBookmarkColumn) <=
- HistoryAndBookmarkRow::COLUMN_END,
- "kAndroidBookmarkColumn should not have more than "
- "COLUMN_END elements");
- for (size_t i = 0; i < arraysize(kAndroidBookmarkColumn); ++i) {
- (*this)[kAndroidBookmarkColumn[i]] =
- static_cast<HistoryAndBookmarkRow::ColumnID>(i);
- }
- }
-};
-
-// The mapping from Android column name to ColumnID; It is initialized
-// once it used.
-BookmarkIDMapping* g_bookmark_id_mapping = NULL;
-
-class SearchIDMapping : public std::map<std::string,
- SearchRow::ColumnID> {
- public:
- SearchIDMapping() {
- static_assert(arraysize(kAndroidSearchColumn) <= SearchRow::COLUMN_END,
- "kAndroidSearchColumn should not have more than "
- "COLUMN_END elements");
- for (size_t i = 0; i < arraysize(kAndroidSearchColumn); ++i) {
- (*this)[kAndroidSearchColumn[i]] =
- static_cast<SearchRow::ColumnID>(i);
- }
- }
-};
-
-// The mapping from Android column name to ColumnID; It is initialized
-// once it used.
-SearchIDMapping* g_search_id_mapping = NULL;
-
-} // namespace
-
-HistoryAndBookmarkRow::HistoryAndBookmarkRow()
- : id_(0),
- created_(base::Time()),
- last_visit_time_(base::Time()),
- visit_count_(0),
- is_bookmark_(false),
- parent_id_(0),
- url_id_(0) {
-}
-
-HistoryAndBookmarkRow::~HistoryAndBookmarkRow() {
-}
-
-std::string HistoryAndBookmarkRow::GetAndroidName(ColumnID id) {
- return kAndroidBookmarkColumn[id];
-}
-
-HistoryAndBookmarkRow::ColumnID HistoryAndBookmarkRow::GetColumnID(
- const std::string& name) {
- if (!g_bookmark_id_mapping)
- g_bookmark_id_mapping = new BookmarkIDMapping();
-
- BookmarkIDMapping::const_iterator i = g_bookmark_id_mapping->find(name);
- if (i == g_bookmark_id_mapping->end())
- return HistoryAndBookmarkRow::COLUMN_END;
- else
- return i->second;
-}
-
-SearchRow::SearchRow()
- : id_(0),
- keyword_id_(0) {
-}
-
-SearchRow::~SearchRow() {
-}
-
-std::string SearchRow::GetAndroidName(ColumnID id) {
- return kAndroidSearchColumn[id];
-}
-
-SearchRow::ColumnID SearchRow::GetColumnID(
- const std::string& name) {
- if (!g_search_id_mapping)
- g_search_id_mapping = new SearchIDMapping();
-
- SearchIDMapping::const_iterator i = g_search_id_mapping->find(name);
- if (i == g_search_id_mapping->end())
- return SearchRow:: COLUMN_END;
- else
- return i->second;
-}
-
-AndroidURLRow::AndroidURLRow()
- : id(0),
- url_id(0) {
-}
-
-AndroidURLRow::~AndroidURLRow() {
-}
-
-SearchTermRow::SearchTermRow()
- : id(0) {
-}
-
-SearchTermRow::~SearchTermRow() {
-}
-
-AndroidStatement::AndroidStatement(sql::Statement* statement, int favicon_index)
- : statement_(statement),
- favicon_index_(favicon_index) {
-}
-
-AndroidStatement::~AndroidStatement() {
-}
-
-} // namespace history.

Powered by Google App Engine
This is Rietveld 408576698