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

Side by Side Diff: components/search_engines/keyword_table.cc

Issue 1234973004: Update SplitString calls in components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/search_engines/keyword_table.h" 5 #include "components/search_engines/keyword_table.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 data->image_url = s.ColumnString(19); 306 data->image_url = s.ColumnString(19);
307 data->new_tab_url = s.ColumnString(24); 307 data->new_tab_url = s.ColumnString(24);
308 data->search_url_post_params = s.ColumnString(20); 308 data->search_url_post_params = s.ColumnString(20);
309 data->suggestions_url_post_params = s.ColumnString(21); 309 data->suggestions_url_post_params = s.ColumnString(21);
310 data->instant_url_post_params = s.ColumnString(22); 310 data->instant_url_post_params = s.ColumnString(22);
311 data->image_url_post_params = s.ColumnString(23); 311 data->image_url_post_params = s.ColumnString(23);
312 data->favicon_url = GURL(s.ColumnString(3)); 312 data->favicon_url = GURL(s.ColumnString(3));
313 data->originating_url = GURL(s.ColumnString(6)); 313 data->originating_url = GURL(s.ColumnString(6));
314 data->show_in_default_list = s.ColumnBool(10); 314 data->show_in_default_list = s.ColumnBool(10);
315 data->safe_for_autoreplace = s.ColumnBool(5); 315 data->safe_for_autoreplace = s.ColumnBool(5);
316 base::SplitString(s.ColumnString(9), ';', &data->input_encodings); 316 data->input_encodings = base::SplitString(
317 s.ColumnString(9), ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
317 data->id = s.ColumnInt64(0); 318 data->id = s.ColumnInt64(0);
318 data->date_created = Time::FromTimeT(s.ColumnInt64(7)); 319 data->date_created = Time::FromTimeT(s.ColumnInt64(7));
319 data->last_modified = Time::FromTimeT(s.ColumnInt64(15)); 320 data->last_modified = Time::FromTimeT(s.ColumnInt64(15));
320 data->created_by_policy = s.ColumnBool(13); 321 data->created_by_policy = s.ColumnBool(13);
321 data->usage_count = s.ColumnInt(8); 322 data->usage_count = s.ColumnInt(8);
322 data->prepopulate_id = s.ColumnInt(12); 323 data->prepopulate_id = s.ColumnInt(12);
323 data->sync_guid = s.ColumnString(16); 324 data->sync_guid = s.ColumnString(16);
324 325
325 data->alternate_urls.clear(); 326 data->alternate_urls.clear();
326 base::JSONReader json_reader; 327 base::JSONReader json_reader;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 } 476 }
476 } 477 }
477 478
478 // Replace the old table with the new one. 479 // Replace the old table with the new one.
479 sql = "DROP TABLE " + name; 480 sql = "DROP TABLE " + name;
480 if (!db_->Execute(sql.c_str())) 481 if (!db_->Execute(sql.c_str()))
481 return false; 482 return false;
482 sql = "ALTER TABLE keywords_temp RENAME TO " + name; 483 sql = "ALTER TABLE keywords_temp RENAME TO " + name;
483 return db_->Execute(sql.c_str()); 484 return db_->Execute(sql.c_str());
484 } 485 }
OLDNEW
« no previous file with comments | « components/search_engines/default_search_pref_test_util.cc ('k') | components/search_engines/template_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698