Commit 511ee4b6 authored by n.bansal's avatar n.bansal Committed by Commit bot

Importer - Change const char* foo to const char foo[]

Cleanup patch to address below mentioned issue -

[*] Change const char* foo to const char foo[]

BUG=416468

Review URL: https://codereview.chromium.org/587403002

Cr-Commit-Position: refs/heads/master@{#297282}
parent a5cdf5ea
...@@ -163,7 +163,8 @@ void FirefoxImporter::ImportHistory() { ...@@ -163,7 +163,8 @@ void FirefoxImporter::ImportHistory() {
// redirects, since we don't want them to appear in history. // redirects, since we don't want them to appear in history.
// Firefox transition types are defined in: // Firefox transition types are defined in:
// toolkit/components/places/public/nsINavHistoryService.idl // toolkit/components/places/public/nsINavHistoryService.idl
const char* query = "SELECT h.url, h.title, h.visit_count, " const char query[] =
"SELECT h.url, h.title, h.visit_count, "
"h.hidden, h.typed, v.visit_date " "h.hidden, h.typed, v.visit_date "
"FROM moz_places h JOIN moz_historyvisits v " "FROM moz_places h JOIN moz_historyvisits v "
"ON h.id = v.place_id " "ON h.id = v.place_id "
...@@ -231,7 +232,8 @@ void FirefoxImporter::ImportBookmarks() { ...@@ -231,7 +232,8 @@ void FirefoxImporter::ImportBookmarks() {
// TODO(jcampan): http://b/issue?id=1196285 we do not support POST based // TODO(jcampan): http://b/issue?id=1196285 we do not support POST based
// keywords yet. We won't include them in the list. // keywords yet. We won't include them in the list.
std::set<int> post_keyword_ids; std::set<int> post_keyword_ids;
const char* query = "SELECT b.id FROM moz_bookmarks b " const char query[] =
"SELECT b.id FROM moz_bookmarks b "
"INNER JOIN moz_items_annos ia ON ia.item_id = b.id " "INNER JOIN moz_items_annos ia ON ia.item_id = b.id "
"INNER JOIN moz_anno_attributes aa ON ia.anno_attribute_id = aa.id " "INNER JOIN moz_anno_attributes aa ON ia.anno_attribute_id = aa.id "
"WHERE aa.name = 'bookmarkProperties/POSTData'"; "WHERE aa.name = 'bookmarkProperties/POSTData'";
...@@ -437,7 +439,8 @@ void FirefoxImporter::GetSearchEnginesXMLData( ...@@ -437,7 +439,8 @@ void FirefoxImporter::GetSearchEnginesXMLData(
if (!db.Open(file)) if (!db.Open(file))
return; return;
const char* query = "SELECT engineid FROM engine_data " const char query[] =
"SELECT engineid FROM engine_data "
"WHERE engineid NOT IN " "WHERE engineid NOT IN "
"(SELECT engineid FROM engine_data " "(SELECT engineid FROM engine_data "
"WHERE name='hidden') " "WHERE name='hidden') "
...@@ -639,7 +642,7 @@ void FirefoxImporter::LoadRootNodeID(sql::Connection* db, ...@@ -639,7 +642,7 @@ void FirefoxImporter::LoadRootNodeID(sql::Connection* db,
static const char* kMenuFolderName = "menu"; static const char* kMenuFolderName = "menu";
static const char* kUnsortedFolderName = "unfiled"; static const char* kUnsortedFolderName = "unfiled";
const char* query = "SELECT root_name, folder_id FROM moz_bookmarks_roots"; const char query[] = "SELECT root_name, folder_id FROM moz_bookmarks_roots";
sql::Statement s(db->GetUniqueStatement(query)); sql::Statement s(db->GetUniqueStatement(query));
while (s.Step()) { while (s.Step()) {
...@@ -659,7 +662,8 @@ void FirefoxImporter::LoadLivemarkIDs(sql::Connection* db, ...@@ -659,7 +662,8 @@ void FirefoxImporter::LoadLivemarkIDs(sql::Connection* db,
static const char* kFeedAnnotation = "livemark/feedURI"; static const char* kFeedAnnotation = "livemark/feedURI";
livemark->clear(); livemark->clear();
const char* query = "SELECT b.item_id " const char query[] =
"SELECT b.item_id "
"FROM moz_anno_attributes a " "FROM moz_anno_attributes a "
"JOIN moz_items_annos b ON a.id = b.anno_attribute_id " "JOIN moz_items_annos b ON a.id = b.anno_attribute_id "
"WHERE a.name = ? "; "WHERE a.name = ? ";
...@@ -673,7 +677,8 @@ void FirefoxImporter::LoadLivemarkIDs(sql::Connection* db, ...@@ -673,7 +677,8 @@ void FirefoxImporter::LoadLivemarkIDs(sql::Connection* db,
void FirefoxImporter::GetTopBookmarkFolder(sql::Connection* db, void FirefoxImporter::GetTopBookmarkFolder(sql::Connection* db,
int folder_id, int folder_id,
BookmarkList* list) { BookmarkList* list) {
const char* query = "SELECT b.title " const char query[] =
"SELECT b.title "
"FROM moz_bookmarks b " "FROM moz_bookmarks b "
"WHERE b.type = 2 AND b.id = ? " "WHERE b.type = 2 AND b.id = ? "
"ORDER BY b.position"; "ORDER BY b.position";
...@@ -701,7 +706,8 @@ void FirefoxImporter::GetWholeBookmarkFolder(sql::Connection* db, ...@@ -701,7 +706,8 @@ void FirefoxImporter::GetWholeBookmarkFolder(sql::Connection* db,
return; return;
} }
const char* query = "SELECT b.id, h.url, COALESCE(b.title, h.title), " const char query[] =
"SELECT b.id, h.url, COALESCE(b.title, h.title), "
"b.type, k.keyword, b.dateAdded, h.favicon_id " "b.type, k.keyword, b.dateAdded, h.favicon_id "
"FROM moz_bookmarks b " "FROM moz_bookmarks b "
"LEFT JOIN moz_places h ON b.fk = h.id " "LEFT JOIN moz_places h ON b.fk = h.id "
...@@ -743,7 +749,7 @@ void FirefoxImporter::LoadFavicons( ...@@ -743,7 +749,7 @@ void FirefoxImporter::LoadFavicons(
sql::Connection* db, sql::Connection* db,
const FaviconMap& favicon_map, const FaviconMap& favicon_map,
std::vector<ImportedFaviconUsage>* favicons) { std::vector<ImportedFaviconUsage>* favicons) {
const char* query = "SELECT url, data FROM moz_favicons WHERE id=?"; const char query[] = "SELECT url, data FROM moz_favicons WHERE id=?";
sql::Statement s(db->GetUniqueStatement(query)); sql::Statement s(db->GetUniqueStatement(query));
if (!s.is_valid()) if (!s.is_valid())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment