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

Side by Side Diff: chrome/browser/history/history_backend.cc

Issue 9586012: Some fixes split off from https://chromiumcodereview.appspot.com/9570064/ to try and make the omnib… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/history/history_backend.h" 5 #include "chrome/browser/history/history_backend.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 URLRow existing_url; 787 URLRow existing_url;
788 URLID url_id = url_database->GetRowForURL(i->url(), &existing_url); 788 URLID url_id = url_database->GetRowForURL(i->url(), &existing_url);
789 if (!url_id) { 789 if (!url_id) {
790 // Add the page if it doesn't exist. 790 // Add the page if it doesn't exist.
791 url_id = url_database->AddURL(*i); 791 url_id = url_database->AddURL(*i);
792 if (!url_id) { 792 if (!url_id) {
793 NOTREACHED() << "Could not add row to DB"; 793 NOTREACHED() << "Could not add row to DB";
794 return; 794 return;
795 } 795 }
796 796
797 if (i->typed_count() > 0) 797 if (i->typed_count() > 0) {
798 modified->changed_urls.push_back(*i); 798 modified->changed_urls.push_back(*i);
799 modified->changed_urls.back().set_id(url_id); // *i likely has |id_| 0.
800 }
799 } 801 }
800 802
801 // Add the page to the full text index. This function is also used for 803 // Add the page to the full text index. This function is also used for
802 // importing. Even though we don't have page contents, we can at least 804 // importing. Even though we don't have page contents, we can at least
803 // add the title and URL to the index so they can be searched. We don't 805 // add the title and URL to the index so they can be searched. We don't
804 // bother to delete any already-existing FTS entries for the URL, since 806 // bother to delete any already-existing FTS entries for the URL, since
805 // this is normally called on import. 807 // this is normally called on import.
806 // 808 //
807 // If you ever import *after* first run (selecting import from the menu), 809 // If you ever import *after* first run (selecting import from the menu),
808 // then these additional entries will "shadow" the originals when querying 810 // then these additional entries will "shadow" the originals when querying
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
2309 break; 2311 break;
2310 } 2312 }
2311 } 2313 }
2312 } 2314 }
2313 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name 2315 UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name
2314 TimeTicks::Now() - beginning_time); 2316 TimeTicks::Now() - beginning_time);
2315 return success; 2317 return success;
2316 } 2318 }
2317 2319
2318 } // namespace history 2320 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698