OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/in_memory_history_backend.h" | 5 #include "chrome/browser/history/in_memory_history_backend.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/history/history_notifications.h" | 14 #include "chrome/browser/history/history_notifications.h" |
15 #include "chrome/browser/history/in_memory_database.h" | 15 #include "chrome/browser/history/in_memory_database.h" |
16 #include "chrome/browser/history/in_memory_url_index.h" | 16 #include "chrome/browser/history/in_memory_url_index.h" |
17 #include "chrome/browser/history/url_database.h" | 17 #include "chrome/browser/history/url_database.h" |
18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
20 #include "content/common/notification_details.h" | 20 #include "content/common/notification_details.h" |
21 #include "content/common/notification_source.h" | 21 #include "content/common/notification_source.h" |
22 | 22 |
23 namespace history { | 23 namespace history { |
24 | 24 |
25 // If a page becomes starred we use this id in place of the real starred id. | |
26 // See note in OnURLsStarred. | |
27 static const StarID kBogusStarredID = 0x0FFFFFFF; | |
28 | |
29 InMemoryHistoryBackend::InMemoryHistoryBackend() | 25 InMemoryHistoryBackend::InMemoryHistoryBackend() |
30 : profile_(NULL) { | 26 : profile_(NULL) { |
31 } | 27 } |
32 | 28 |
33 InMemoryHistoryBackend::~InMemoryHistoryBackend() { | 29 InMemoryHistoryBackend::~InMemoryHistoryBackend() { |
34 if (index_.get()) | 30 if (index_.get()) |
35 index_->ShutDown(); | 31 index_->ShutDown(); |
36 } | 32 } |
37 | 33 |
38 bool InMemoryHistoryBackend::Init(const FilePath& history_filename, | 34 bool InMemoryHistoryBackend::Init(const FilePath& history_filename, |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 184 |
189 bool InMemoryHistoryBackend::HasKeyword(const GURL& url) { | 185 bool InMemoryHistoryBackend::HasKeyword(const GURL& url) { |
190 URLID id = db_->GetRowForURL(url, NULL); | 186 URLID id = db_->GetRowForURL(url, NULL); |
191 if (!id) | 187 if (!id) |
192 return false; | 188 return false; |
193 | 189 |
194 return db_->GetKeywordSearchTermRow(id, NULL); | 190 return db_->GetKeywordSearchTermRow(id, NULL); |
195 } | 191 } |
196 | 192 |
197 } // namespace history | 193 } // namespace history |
OLD | NEW |