summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history/history_backend.cc
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-14 17:48:40 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-14 17:48:40 +0000
commit405ed122f92ca9248de2a65103edba9b02471a9f (patch)
tree9d8cb957ff47ba6790107feec65acdfa592d9747 /chrome/browser/history/history_backend.cc
parent296d61e24b5a5311f120a767a59ac006176f6f9a (diff)
downloadchromium_src-405ed122f92ca9248de2a65103edba9b02471a9f.zip
chromium_src-405ed122f92ca9248de2a65103edba9b02471a9f.tar.gz
chromium_src-405ed122f92ca9248de2a65103edba9b02471a9f.tar.bz2
Port some files in chrome/browser/
#ifdef out windows-specific portion of chrome/common/l10n_util.h, which allows me to port some other files. I also extracted parts of chrome/views/tree_view.h to tree_model.h, so that ATL/WTL-specific parts stay in tree_view.h, but tree_model.h is platform-independent and can be included in files using it as base class. Review URL: http://codereview.chromium.org/8618 Patch from Paweł Hajdan jr. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5483 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/history_backend.cc')
-rw-r--r--chrome/browser/history/history_backend.cc33
1 files changed, 3 insertions, 30 deletions
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index d904148..fd7d465 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -6,6 +6,7 @@
#include <set>
+#include "base/compiler_specific.h"
#include "base/file_util.h"
#include "base/histogram.h"
#include "base/message_loop.h"
@@ -78,32 +79,6 @@ static const int kMaxRedirectCount = 32;
// and is archived.
static const int kArchiveDaysThreshold = 90;
-// Comparison used when inserting entries into visits vector.
-static bool VisitOccursAfter(const PageVisit& elem1,
- const PageVisit& elem2) {
- return elem1.visit_time > elem2.visit_time;
-}
-
-static bool IsMatchingHost(const URLRow& row,
- const std::string& host_name) {
- const GURL& url = row.url();
- if (!url.is_valid() || !url.IsStandard())
- return false;
-
- const std::string& spec = url.spec();
- url_parse::Parsed parsed = url.parsed_for_possibly_invalid_spec();
- if (!parsed.host.is_nonempty())
- return false; // Empty host.
-
- if (parsed.host.len != host_name.size())
- return false; // Hosts are different lengths, can not match.
-
- // TODO(brettw) we may want to also match hosts ending with a period, since
- // these will typically be the same.
- return strncmp(&spec[parsed.host.begin], host_name.c_str(),
- host_name.size()) == 0;
-}
-
// This task is run on a timer so that commits happen at regular intervals
// so they are batched together. The important thing about this class is that
// it supports canceling of the task so the reference to the backend will be
@@ -195,10 +170,9 @@ HistoryBackend::HistoryBackend(const std::wstring& history_dir,
BookmarkService* bookmark_service)
: delegate_(delegate),
history_dir_(history_dir),
-#pragma warning(suppress: 4355) // OK to pass "this" here.
- expirer_(this, bookmark_service),
- backend_destroy_message_loop_(NULL),
+ ALLOW_THIS_IN_INITIALIZER_LIST(expirer_(this, bookmark_service)),
recent_redirects_(kMaxRedirectCount),
+ backend_destroy_message_loop_(NULL),
backend_destroy_task_(NULL),
segment_queried_(false),
bookmark_service_(bookmark_service) {
@@ -620,7 +594,6 @@ std::pair<URLID, VisitID> HistoryBackend::AddPageVisit(
// Update of an existing row.
if (PageTransition::StripQualifier(transition) != PageTransition::RELOAD)
url_info.set_visit_count(url_info.visit_count() + 1);
- int old_typed_count = url_info.typed_count();
if (typed_increment)
url_info.set_typed_count(url_info.typed_count() + typed_increment);
url_info.set_last_visit(time);