summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsdefresne <sdefresne@chromium.org>2015-03-09 08:33:17 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-09 15:34:11 +0000
commit039209fcd5598340b3c3b02d98f5453013953cad (patch)
tree721976de13c24e7e085afbd108a2d541e6e16bfd
parent3b06d49c02b86e0a8fb28248c2f087f08edda70a (diff)
downloadchromium_src-039209fcd5598340b3c3b02d98f5453013953cad.zip
chromium_src-039209fcd5598340b3c3b02d98f5453013953cad.tar.gz
chromium_src-039209fcd5598340b3c3b02d98f5453013953cad.tar.bz2
Move InMemoryURLIndex into chrome/browser/autocomplete
InMemoryURLIndex is not used in the history code (except for the creation) but only by the autocomplete code, so move the code there and all its related types. BUG=453790 Review URL: https://codereview.chromium.org/963823003 Cr-Commit-Position: refs/heads/master@{#319634}
-rw-r--r--chrome/browser/BUILD.gn2
-rw-r--r--chrome/browser/autocomplete/BUILD.gn12
-rw-r--r--chrome/browser/autocomplete/history_provider.cc2
-rw-r--r--chrome/browser/autocomplete/history_provider.h2
-rw-r--r--chrome/browser/autocomplete/history_quick_provider.cc4
-rw-r--r--chrome/browser/autocomplete/history_quick_provider.h2
-rw-r--r--chrome/browser/autocomplete/history_quick_provider_unittest.cc4
-rw-r--r--chrome/browser/autocomplete/history_url_provider.cc2
-rw-r--r--chrome/browser/autocomplete/in_memory_url_index.cc (renamed from chrome/browser/history/in_memory_url_index.cc)4
-rw-r--r--chrome/browser/autocomplete/in_memory_url_index.h (renamed from chrome/browser/history/in_memory_url_index.h)10
-rw-r--r--chrome/browser/autocomplete/in_memory_url_index_cache.proto (renamed from components/history/core/browser/in_memory_url_index_cache.proto)0
-rw-r--r--chrome/browser/autocomplete/in_memory_url_index_types.cc (renamed from components/history/core/browser/in_memory_url_index_types.cc)2
-rw-r--r--chrome/browser/autocomplete/in_memory_url_index_types.h (renamed from components/history/core/browser/in_memory_url_index_types.h)6
-rw-r--r--chrome/browser/autocomplete/in_memory_url_index_types_unittest.cc (renamed from components/history/core/browser/in_memory_url_index_types_unittest.cc)2
-rw-r--r--chrome/browser/autocomplete/in_memory_url_index_unittest.cc (renamed from chrome/browser/history/in_memory_url_index_unittest.cc)6
-rw-r--r--chrome/browser/autocomplete/scored_history_match.cc (renamed from components/history/core/browser/scored_history_match.cc)2
-rw-r--r--chrome/browser/autocomplete/scored_history_match.h (renamed from components/history/core/browser/scored_history_match.h)11
-rw-r--r--chrome/browser/autocomplete/scored_history_match_builder_impl.h4
-rw-r--r--chrome/browser/autocomplete/shortcuts_provider_unittest.cc2
-rw-r--r--chrome/browser/autocomplete/url_index_private_data.cc (renamed from chrome/browser/history/url_index_private_data.cc)4
-rw-r--r--chrome/browser/autocomplete/url_index_private_data.h (renamed from chrome/browser/history/url_index_private_data.h)12
-rw-r--r--chrome/browser/chromeos/BUILD.gn1
-rw-r--r--chrome/browser/extensions/BUILD.gn1
-rw-r--r--chrome/browser/history/DEPS2
-rw-r--r--chrome/browser/history/history_service.cc2
-rw-r--r--chrome/browser/ui/BUILD.gn1
-rw-r--r--chrome/chrome_browser.gypi26
-rw-r--r--chrome/chrome_browser_chromeos.gypi1
-rw-r--r--chrome/chrome_browser_extensions.gypi1
-rw-r--r--chrome/chrome_browser_ui.gypi1
-rw-r--r--chrome/chrome_tests.gypi1
-rw-r--r--chrome/chrome_tests_unit.gypi2
-rw-r--r--chrome/test/base/history_index_restore_observer.h2
-rw-r--r--components/components_tests.gyp1
-rw-r--r--components/history.gypi20
-rw-r--r--components/history/core/browser/BUILD.gn12
-rw-r--r--components/history/core/browser/download_database.cc4
-rw-r--r--components/history/core/browser/history_database.cc6
-rw-r--r--components/history/core/browser/thumbnail_database.cc6
-rw-r--r--components/history/core/browser/top_sites_database.cc2
-rw-r--r--components/history/core/browser/url_utils.cc2
-rw-r--r--components/history/core/browser/visit_filter.cc6
42 files changed, 96 insertions, 99 deletions
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 9905279..9799cc1 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -74,6 +74,7 @@ static_library("browser") {
"//chrome/app:generated_resources_map",
"//chrome/app/resources:platform_locale_settings",
"//chrome/app/theme:theme_resources",
+ "//chrome/browser/autocomplete:in_memory_url_index_cache_proto",
"//chrome/browser/net:cert_logger_proto",
"//chrome/browser/net:probe_message_proto",
"//chrome/browser/ui",
@@ -98,7 +99,6 @@ static_library("browser") {
"//components/google/core/browser",
"//components/handoff",
"//components/history/core/browser",
- "//components/history/core/browser:proto",
"//components/history/core/common",
"//components/infobars/core",
"//components/invalidation",
diff --git a/chrome/browser/autocomplete/BUILD.gn b/chrome/browser/autocomplete/BUILD.gn
new file mode 100644
index 0000000..3f09281
--- /dev/null
+++ b/chrome/browser/autocomplete/BUILD.gn
@@ -0,0 +1,12 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//third_party/protobuf/proto_library.gni")
+
+# GYP version: chrome/chrome_browser.gypi:in_memory_url_index_cache_proto
+proto_library("in_memory_url_index_cache_proto") {
+ sources = [
+ "in_memory_url_index_cache.proto",
+ ]
+}
diff --git a/chrome/browser/autocomplete/history_provider.cc b/chrome/browser/autocomplete/history_provider.cc
index 7f4d314..6d940bc 100644
--- a/chrome/browser/autocomplete/history_provider.cc
+++ b/chrome/browser/autocomplete/history_provider.cc
@@ -8,13 +8,13 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
#include "components/bookmarks/browser/bookmark_model.h"
-#include "components/history/core/browser/in_memory_url_index_types.h"
#include "components/omnibox/autocomplete_input.h"
#include "components/omnibox/autocomplete_match.h"
#include "url/url_util.h"
diff --git a/chrome/browser/autocomplete/history_provider.h b/chrome/browser/autocomplete/history_provider.h
index ed957ad..53e6dcc 100644
--- a/chrome/browser/autocomplete/history_provider.h
+++ b/chrome/browser/autocomplete/history_provider.h
@@ -6,7 +6,7 @@
#define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_PROVIDER_H_
#include "base/compiler_specific.h"
-#include "components/history/core/browser/in_memory_url_index_types.h"
+#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
#include "components/omnibox/autocomplete_provider.h"
class AutocompleteInput;
diff --git a/chrome/browser/autocomplete/history_quick_provider.cc b/chrome/browser/autocomplete/history_quick_provider.cc
index f961e35..e977ab1 100644
--- a/chrome/browser/autocomplete/history_quick_provider.cc
+++ b/chrome/browser/autocomplete/history_quick_provider.cc
@@ -19,11 +19,12 @@
#include "base/time/time.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
#include "chrome/browser/autocomplete/history_url_provider.h"
+#include "chrome/browser/autocomplete/in_memory_url_index.h"
+#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
#include "chrome/browser/autocomplete/scored_history_match_builder_impl.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
-#include "chrome/browser/history/in_memory_url_index.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/common/chrome_switches.h"
@@ -31,7 +32,6 @@
#include "chrome/common/url_constants.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/history/core/browser/history_database.h"
-#include "components/history/core/browser/in_memory_url_index_types.h"
#include "components/metrics/proto/omnibox_input_type.pb.h"
#include "components/omnibox/autocomplete_match_type.h"
#include "components/omnibox/autocomplete_result.h"
diff --git a/chrome/browser/autocomplete/history_quick_provider.h b/chrome/browser/autocomplete/history_quick_provider.h
index 57db8c8..aadbd60 100644
--- a/chrome/browser/autocomplete/history_quick_provider.h
+++ b/chrome/browser/autocomplete/history_quick_provider.h
@@ -10,7 +10,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/browser/autocomplete/history_provider.h"
-#include "chrome/browser/history/in_memory_url_index.h"
+#include "chrome/browser/autocomplete/in_memory_url_index.h"
#include "components/history/core/browser/history_types.h"
#include "components/omnibox/autocomplete_input.h"
#include "components/omnibox/autocomplete_match.h"
diff --git a/chrome/browser/autocomplete/history_quick_provider_unittest.cc b/chrome/browser/autocomplete/history_quick_provider_unittest.cc
index 2345278..44c2bb1 100644
--- a/chrome/browser/autocomplete/history_quick_provider_unittest.cc
+++ b/chrome/browser/autocomplete/history_quick_provider_unittest.cc
@@ -18,12 +18,12 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
#include "chrome/browser/autocomplete/history_url_provider.h"
+#include "chrome/browser/autocomplete/in_memory_url_index.h"
+#include "chrome/browser/autocomplete/url_index_private_data.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/history/history_backend.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
-#include "chrome/browser/history/in_memory_url_index.h"
-#include "chrome/browser/history/url_index_private_data.h"
#include "chrome/browser/search_engines/chrome_template_url_service_client.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/test/base/testing_browser_process.h"
diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc
index ccfce94..4b865e7 100644
--- a/chrome/browser/autocomplete/history_url_provider.cc
+++ b/chrome/browser/autocomplete/history_url_provider.cc
@@ -16,6 +16,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
+#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
#include "chrome/browser/autocomplete/scored_history_match_builder_impl.h"
#include "chrome/browser/history/history_backend.h"
#include "chrome/browser/history/history_service.h"
@@ -29,7 +30,6 @@
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/history/core/browser/history_database.h"
#include "components/history/core/browser/history_types.h"
-#include "components/history/core/browser/in_memory_url_index_types.h"
#include "components/metrics/proto/omnibox_input_type.pb.h"
#include "components/omnibox/autocomplete_match.h"
#include "components/omnibox/autocomplete_provider_listener.h"
diff --git a/chrome/browser/history/in_memory_url_index.cc b/chrome/browser/autocomplete/in_memory_url_index.cc
index e3c2a91..8c84c1a 100644
--- a/chrome/browser/history/in_memory_url_index.cc
+++ b/chrome/browser/autocomplete/in_memory_url_index.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/history/in_memory_url_index.h"
+#include "chrome/browser/autocomplete/in_memory_url_index.h"
#include "base/files/file_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
+#include "chrome/browser/autocomplete/url_index_private_data.h"
#include "chrome/browser/history/history_service.h"
-#include "chrome/browser/history/url_index_private_data.h"
#include "chrome/common/url_constants.h"
#include "components/history/core/browser/url_database.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/history/in_memory_url_index.h b/chrome/browser/autocomplete/in_memory_url_index.h
index fa1647f..ec5d588 100644
--- a/chrome/browser/history/in_memory_url_index.h
+++ b/chrome/browser/autocomplete/in_memory_url_index.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_
-#define CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_
+#ifndef CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_H_
+#define CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_H_
#include <functional>
#include <map>
@@ -18,10 +18,10 @@
#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
#include "base/task/cancelable_task_tracker.h"
+#include "chrome/browser/autocomplete/scored_history_match.h"
#include "components/history/core/browser/history_db_task.h"
#include "components/history/core/browser/history_service_observer.h"
#include "components/history/core/browser/history_types.h"
-#include "components/history/core/browser/scored_history_match.h"
#include "sql/connection.h"
class HistoryService;
@@ -294,7 +294,7 @@ class InMemoryURLIndex : public HistoryServiceObserver,
// index has been destructed.
bool needs_to_be_cached_;
- // This flag is set to true,if we want to listen to the
+ // This flag is set to true if we want to listen to the
// HistoryServiceLoaded Notification.
bool listen_to_history_service_loaded_;
@@ -303,4 +303,4 @@ class InMemoryURLIndex : public HistoryServiceObserver,
} // namespace history
-#endif // CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_H_
+#endif // CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_H_
diff --git a/components/history/core/browser/in_memory_url_index_cache.proto b/chrome/browser/autocomplete/in_memory_url_index_cache.proto
index df2de1b..df2de1b 100644
--- a/components/history/core/browser/in_memory_url_index_cache.proto
+++ b/chrome/browser/autocomplete/in_memory_url_index_cache.proto
diff --git a/components/history/core/browser/in_memory_url_index_types.cc b/chrome/browser/autocomplete/in_memory_url_index_types.cc
index 25907b3..bb64822 100644
--- a/components/history/core/browser/in_memory_url_index_types.cc
+++ b/chrome/browser/autocomplete/in_memory_url_index_types.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/history/core/browser/in_memory_url_index_types.h"
+#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
#include <algorithm>
#include <functional>
diff --git a/components/history/core/browser/in_memory_url_index_types.h b/chrome/browser/autocomplete/in_memory_url_index_types.h
index fbb511a..ad2153a 100644
--- a/components/history/core/browser/in_memory_url_index_types.h
+++ b/chrome/browser/autocomplete/in_memory_url_index_types.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_HISTORY_CORE_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_
-#define COMPONENTS_HISTORY_CORE_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_
+#ifndef CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_TYPES_H_
+#define CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_TYPES_H_
#include <map>
#include <set>
@@ -176,4 +176,4 @@ typedef std::map<HistoryID, RowWordStarts> WordStartsMap;
} // namespace history
-#endif // COMPONENTS_HISTORY_CORE_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_
+#endif // CHROME_BROWSER_AUTOCOMPLETE_IN_MEMORY_URL_INDEX_TYPES_H_
diff --git a/components/history/core/browser/in_memory_url_index_types_unittest.cc b/chrome/browser/autocomplete/in_memory_url_index_types_unittest.cc
index c10f1c0..59b05d5 100644
--- a/components/history/core/browser/in_memory_url_index_types_unittest.cc
+++ b/chrome/browser/autocomplete/in_memory_url_index_types_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/history/core/browser/in_memory_url_index_types.h"
+#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
#include <algorithm>
diff --git a/chrome/browser/history/in_memory_url_index_unittest.cc b/chrome/browser/autocomplete/in_memory_url_index_unittest.cc
index 345382d..adb068d 100644
--- a/chrome/browser/history/in_memory_url_index_unittest.cc
+++ b/chrome/browser/autocomplete/in_memory_url_index_unittest.cc
@@ -14,19 +14,19 @@
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/autocomplete/in_memory_url_index.h"
+#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
#include "chrome/browser/autocomplete/scored_history_match_builder_impl.h"
+#include "chrome/browser/autocomplete/url_index_private_data.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/history/history_backend.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
-#include "chrome/browser/history/in_memory_url_index.h"
-#include "chrome/browser/history/url_index_private_data.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/history_index_restore_observer.h"
#include "chrome/test/base/testing_profile.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
#include "components/history/core/browser/history_database.h"
-#include "components/history/core/browser/in_memory_url_index_types.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "sql/transaction.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/history/core/browser/scored_history_match.cc b/chrome/browser/autocomplete/scored_history_match.cc
index 86f4fd1..93c1503 100644
--- a/components/history/core/browser/scored_history_match.cc
+++ b/chrome/browser/autocomplete/scored_history_match.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/history/core/browser/scored_history_match.h"
+#include "chrome/browser/autocomplete/scored_history_match.h"
namespace history {
diff --git a/components/history/core/browser/scored_history_match.h b/chrome/browser/autocomplete/scored_history_match.h
index 2bdde10..82e078f 100644
--- a/components/history/core/browser/scored_history_match.h
+++ b/chrome/browser/autocomplete/scored_history_match.h
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_HISTORY_CORE_BROWSER_SCORED_HISTORY_MATCH_H_
-#define COMPONENTS_HISTORY_CORE_BROWSER_SCORED_HISTORY_MATCH_H_
+#ifndef CHROME_BROWSER_AUTOCOMPLETE_SCORED_HISTORY_MATCH_H_
+#define CHROME_BROWSER_AUTOCOMPLETE_SCORED_HISTORY_MATCH_H_
#include <string>
#include <vector>
#include "base/strings/string16.h"
#include "base/time/time.h"
+#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
#include "components/history/core/browser/history_match.h"
#include "components/history/core/browser/history_types.h"
-#include "components/history/core/browser/in_memory_url_index_types.h"
namespace history {
@@ -22,6 +22,9 @@ struct ScoredHistoryMatch : public HistoryMatch {
// The Builder inner class allows the embedder to control how matches are
// scored (we cannot use a base::Callback<> as base::Bind() is limited to 6
// parameters).
+ // TODO(sdefresne): remove this since ScoredHistoryMatch can now depends on
+ // chrome/browser/autocomplete and components/bookmarks
+ // http://crbug.com/462645
class Builder {
public:
Builder() {}
@@ -105,4 +108,4 @@ typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches;
} // namespace history
-#endif // COMPONENTS_HISTORY_CORE_BROWSER_SCORED_HISTORY_MATCH_H_
+#endif // CHROME_BROWSER_AUTOCOMPLETE_SCORED_HISTORY_MATCH_H_
diff --git a/chrome/browser/autocomplete/scored_history_match_builder_impl.h b/chrome/browser/autocomplete/scored_history_match_builder_impl.h
index 578d243..83cf269 100644
--- a/chrome/browser/autocomplete/scored_history_match_builder_impl.h
+++ b/chrome/browser/autocomplete/scored_history_match_builder_impl.h
@@ -7,9 +7,9 @@
#include "base/callback.h"
#include "base/strings/string16.h"
+#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
+#include "chrome/browser/autocomplete/scored_history_match.h"
#include "components/history/core/browser/history_types.h"
-#include "components/history/core/browser/in_memory_url_index_types.h"
-#include "components/history/core/browser/scored_history_match.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
class ScoredHistoryMatchBuilderImplTest;
diff --git a/chrome/browser/autocomplete/shortcuts_provider_unittest.cc b/chrome/browser/autocomplete/shortcuts_provider_unittest.cc
index e503dd1..8acb8b4 100644
--- a/chrome/browser/autocomplete/shortcuts_provider_unittest.cc
+++ b/chrome/browser/autocomplete/shortcuts_provider_unittest.cc
@@ -18,10 +18,10 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
+#include "chrome/browser/autocomplete/in_memory_url_index.h"
#include "chrome/browser/autocomplete/shortcuts_backend.h"
#include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
#include "chrome/browser/history/history_service.h"
-#include "chrome/browser/history/in_memory_url_index.h"
#include "chrome/test/base/testing_profile.h"
#include "components/history/core/browser/url_database.h"
#include "components/metrics/proto/omnibox_event.pb.h"
diff --git a/chrome/browser/history/url_index_private_data.cc b/chrome/browser/autocomplete/url_index_private_data.cc
index 88ef8e5..1652830 100644
--- a/chrome/browser/history/url_index_private_data.cc
+++ b/chrome/browser/autocomplete/url_index_private_data.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/history/url_index_private_data.h"
+#include "chrome/browser/autocomplete/url_index_private_data.h"
#include <functional>
#include <iterator>
@@ -19,8 +19,8 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
+#include "chrome/browser/autocomplete/in_memory_url_index.h"
#include "chrome/browser/history/history_service.h"
-#include "chrome/browser/history/in_memory_url_index.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/history/core/browser/history_database.h"
#include "components/history/core/browser/history_db_task.h"
diff --git a/chrome/browser/history/url_index_private_data.h b/chrome/browser/autocomplete/url_index_private_data.h
index bb9d675..acaea05 100644
--- a/chrome/browser/history/url_index_private_data.h
+++ b/chrome/browser/autocomplete/url_index_private_data.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_
-#define CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_
+#ifndef CHROME_BROWSER_AUTOCOMPLETE_URL_INDEX_PRIVATE_DATA_H_
+#define CHROME_BROWSER_AUTOCOMPLETE_URL_INDEX_PRIVATE_DATA_H_
#include <set>
#include <string>
@@ -11,10 +11,10 @@
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
+#include "chrome/browser/autocomplete/in_memory_url_index_cache.pb.h"
+#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
+#include "chrome/browser/autocomplete/scored_history_match.h"
#include "chrome/browser/history/history_service.h"
-#include "components/history/core/browser/in_memory_url_index_cache.pb.h"
-#include "components/history/core/browser/in_memory_url_index_types.h"
-#include "components/history/core/browser/scored_history_match.h"
class HistoryQuickProviderTest;
@@ -391,4 +391,4 @@ class URLIndexPrivateData
} // namespace history
-#endif // CHROME_BROWSER_HISTORY_URL_INDEX_PRIVATE_DATA_H_
+#endif // CHROME_BROWSER_AUTOCOMPLETE_URL_INDEX_PRIVATE_DATA_H_
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn
index 0436a7b..1448c08 100644
--- a/chrome/browser/chromeos/BUILD.gn
+++ b/chrome/browser/chromeos/BUILD.gn
@@ -61,7 +61,6 @@ source_set("chromeos") {
"//chromeos:cryptohome_proto",
"//chromeos:cryptohome_signkey_proto",
"//chromeos:power_manager_proto",
- "//components/history/core/browser:proto",
"//components/onc",
"//components/ownership",
"//components/pairing",
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn
index 061b8c1..3e1bc66 100644
--- a/chrome/browser/extensions/BUILD.gn
+++ b/chrome/browser/extensions/BUILD.gn
@@ -45,7 +45,6 @@ static_library("extensions") {
"//chrome/common/safe_browsing:proto",
"//chrome/installer/util",
"//components/copresence",
- "//components/history/core/browser:proto",
"//components/onc",
"//components/proximity_auth",
"//components/strings",
diff --git a/chrome/browser/history/DEPS b/chrome/browser/history/DEPS
index 41d25c1..26d717d 100644
--- a/chrome/browser/history/DEPS
+++ b/chrome/browser/history/DEPS
@@ -20,6 +20,7 @@ include_rules = [
#
# Do not add to the list of temporarily-allowed dependencies below,
# and please do not introduce more #includes of these files.
+ "!chrome/browser/autocomplete/in_memory_url_index.h",
"!chrome/browser/chrome_notification_types.h",
"!chrome/browser/prerender/prerender_contents.h",
"!chrome/browser/prerender/prerender_manager.h",
@@ -29,7 +30,6 @@ include_rules = [
"!chrome/browser/profiles/profile_manager.h",
"!chrome/browser/ui/browser.h",
"!chrome/browser/ui/browser_finder.h",
- "!components/bookmarks/browser/bookmark_utils.h",
"!components/dom_distiller/core/url_constants.h",
]
diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc
index d57d8af..8708738 100644
--- a/chrome/browser/history/history_service.cc
+++ b/chrome/browser/history/history_service.cc
@@ -28,9 +28,9 @@
#include "base/thread_task_runner_handle.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
+#include "chrome/browser/autocomplete/in_memory_url_index.h"
#include "chrome/browser/history/history_backend.h"
#include "chrome/browser/history/in_memory_history_backend.h"
-#include "chrome/browser/history/in_memory_url_index.h"
#include "components/history/core/browser/download_row.h"
#include "components/history/core/browser/history_client.h"
#include "components/history/core/browser/history_database_params.h"
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index 3e39d0d..ca6c6f7 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -49,7 +49,6 @@ static_library("ui") {
"//components/auto_login_parser",
"//components/dom_distiller/webui",
"//components/feedback/proto",
- "//components/history/core/browser:proto",
"//components/invalidation",
"//components/onc",
"//components/password_manager/core/browser",
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index be4f0d3..2e130f3 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1193,6 +1193,12 @@
'browser/autocomplete/history_quick_provider.h',
'browser/autocomplete/history_url_provider.cc',
'browser/autocomplete/history_url_provider.h',
+ 'browser/autocomplete/in_memory_url_index.cc',
+ 'browser/autocomplete/in_memory_url_index.h',
+ 'browser/autocomplete/in_memory_url_index_types.cc',
+ 'browser/autocomplete/in_memory_url_index_types.h',
+ 'browser/autocomplete/scored_history_match.cc',
+ 'browser/autocomplete/scored_history_match.h',
'browser/autocomplete/scored_history_match_builder_impl.cc',
'browser/autocomplete/scored_history_match_builder_impl.h',
'browser/autocomplete/shortcuts_backend.cc',
@@ -1203,6 +1209,8 @@
'browser/autocomplete/shortcuts_database.h',
'browser/autocomplete/shortcuts_provider.cc',
'browser/autocomplete/shortcuts_provider.h',
+ 'browser/autocomplete/url_index_private_data.cc',
+ 'browser/autocomplete/url_index_private_data.h',
'browser/autocomplete/zero_suggest_provider.cc',
'browser/autocomplete/zero_suggest_provider.h',
],
@@ -1569,16 +1577,12 @@
'browser/history/history_utils.h',
'browser/history/in_memory_history_backend.cc',
'browser/history/in_memory_history_backend.h',
- 'browser/history/in_memory_url_index.cc',
- 'browser/history/in_memory_url_index.h',
'browser/history/top_sites_factory.cc',
'browser/history/top_sites_factory.h',
'browser/history/top_sites_impl.cc',
'browser/history/top_sites_impl.h',
'browser/history/typed_url_syncable_service.cc',
'browser/history/typed_url_syncable_service.h',
- 'browser/history/url_index_private_data.cc',
- 'browser/history/url_index_private_data.h',
'browser/history/web_history_service_factory.cc',
'browser/history/web_history_service_factory.h',
],
@@ -2900,6 +2904,7 @@
'chrome_resources.gyp:theme_resources',
'common',
'common_net',
+ 'in_memory_url_index_cache_proto',
'probe_message_proto',
'../components/components.gyp:autofill_core_browser',
'../components/components.gyp:bookmarks_browser',
@@ -3561,6 +3566,19 @@
],
},
{
+ # Protobuf compiler / generator for the InMemoryURLIndex caching
+ # protocol buffer.
+ # GN version: //chrome/browser/autocomplete:in_memory_url_index_cache_proto
+ 'target_name': 'in_memory_url_index_cache_proto',
+ 'type': 'static_library',
+ 'sources': [ 'browser/autocomplete/in_memory_url_index_cache.proto', ],
+ 'variables': {
+ 'proto_in_dir': 'browser/autocomplete',
+ 'proto_out_dir': 'chrome/browser/autocomplete',
+ },
+ 'includes': [ '../build/protoc.gypi', ],
+ },
+ {
# Protobuf compiler / generator for the fraudulent certificate reporting
# protocol buffer.
# GN version: //chrome/browser/net:cert_logger_proto
diff --git a/chrome/chrome_browser_chromeos.gypi b/chrome/chrome_browser_chromeos.gypi
index 4b5c2ad..7bdaeff 100644
--- a/chrome/chrome_browser_chromeos.gypi
+++ b/chrome/chrome_browser_chromeos.gypi
@@ -1112,7 +1112,6 @@
'../chromeos/chromeos.gyp:power_manager_proto',
'../chromeos/ime/input_method.gyp:gencode',
'../components/components.gyp:cloud_policy_proto',
- '../components/components.gyp:history_core_browser_proto',
'../components/components.gyp:login',
'../components/components.gyp:onc_component',
'../components/components.gyp:ownership',
diff --git a/chrome/chrome_browser_extensions.gypi b/chrome/chrome_browser_extensions.gypi
index e8b7998..a100bd3 100644
--- a/chrome/chrome_browser_extensions.gypi
+++ b/chrome/chrome_browser_extensions.gypi
@@ -861,7 +861,6 @@
'installer_util',
'safe_browsing_proto',
'../components/components.gyp:copresence',
- '../components/components.gyp:history_core_browser_proto',
'../components/components.gyp:onc_component',
'../components/components.gyp:proximity_auth',
'../components/components.gyp:update_client',
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi
index 2adceb4..c3c5689 100644
--- a/chrome/chrome_browser_ui.gypi
+++ b/chrome/chrome_browser_ui.gypi
@@ -2689,7 +2689,6 @@
'../components/components.gyp:dom_distiller_core',
'../components/components.gyp:dom_distiller_webui',
'../components/components.gyp:feedback_proto',
- '../components/components.gyp:history_core_browser_proto',
'../components/components.gyp:invalidation',
'../components/components.gyp:onc_component',
'../components/components.gyp:password_manager_core_browser',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 0f7d859..4960e11 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -69,6 +69,7 @@
'browser/apps/speech_recognition_browsertest.cc',
'browser/apps/window_controls_browsertest.cc',
'browser/autocomplete/autocomplete_browsertest.cc',
+ 'browser/autocomplete/in_memory_url_index_types_unittest.cc',
'browser/autofill/autofill_browsertest.cc',
'browser/autofill/autofill_server_browsertest.cc',
'browser/autofill/content_autofill_driver_browsertest.cc',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index e30e8ef..2e2ae40 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -28,6 +28,7 @@
'browser/autocomplete/builtin_provider_unittest.cc',
'browser/autocomplete/history_quick_provider_unittest.cc',
'browser/autocomplete/history_url_provider_unittest.cc',
+ 'browser/autocomplete/in_memory_url_index_unittest.cc',
'browser/autocomplete/scored_history_match_builder_impl_unittest.cc',
'browser/autocomplete/search_provider_unittest.cc',
'browser/autocomplete/shortcuts_backend_unittest.cc',
@@ -113,7 +114,6 @@
'browser/history/history_database_unittest.cc',
'browser/history/history_querying_unittest.cc',
'browser/history/history_unittest.cc',
- 'browser/history/in_memory_url_index_unittest.cc',
'browser/history/thumbnail_database_unittest.cc',
'browser/history/top_sites_impl_unittest.cc',
'browser/history/typed_url_syncable_service_unittest.cc',
diff --git a/chrome/test/base/history_index_restore_observer.h b/chrome/test/base/history_index_restore_observer.h
index 4d76aee..6990b21 100644
--- a/chrome/test/base/history_index_restore_observer.h
+++ b/chrome/test/base/history_index_restore_observer.h
@@ -8,7 +8,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
-#include "chrome/browser/history/in_memory_url_index.h"
+#include "chrome/browser/autocomplete/in_memory_url_index.h"
// HistoryIndexRestoreObserver is used when blocking until the InMemoryURLIndex
// finishes restoring. As soon as the InMemoryURLIndex finishes restoring the
diff --git a/components/components_tests.gyp b/components/components_tests.gyp
index b5698dd..4bab080 100644
--- a/components/components_tests.gyp
+++ b/components/components_tests.gyp
@@ -197,7 +197,6 @@
'history_unittest_sources': [
'history/core/browser/android/android_history_types_unittest.cc',
'history/core/browser/history_types_unittest.cc',
- 'history/core/browser/in_memory_url_index_types_unittest.cc',
'history/core/browser/top_sites_cache_unittest.cc',
'history/core/browser/top_sites_database_unittest.cc',
'history/core/browser/url_database_unittest.cc',
diff --git a/components/history.gypi b/components/history.gypi
index 384fc9c..75be781 100644
--- a/components/history.gypi
+++ b/components/history.gypi
@@ -22,7 +22,6 @@
'../ui/gfx/gfx.gyp:gfx',
'../url/url.gyp:url_lib',
'favicon_base',
- 'history_core_browser_proto',
'keyed_service_core',
'query_parser',
'signin_core_browser',
@@ -57,15 +56,11 @@
'history/core/browser/history_types.h',
'history/core/browser/in_memory_database.cc',
'history/core/browser/in_memory_database.h',
- 'history/core/browser/in_memory_url_index_types.cc',
- 'history/core/browser/in_memory_url_index_types.h',
'history/core/browser/keyword_id.h',
'history/core/browser/keyword_search_term.cc',
'history/core/browser/keyword_search_term.h',
'history/core/browser/page_usage_data.cc',
'history/core/browser/page_usage_data.h',
- 'history/core/browser/scored_history_match.cc',
- 'history/core/browser/scored_history_match.h',
'history/core/browser/thumbnail_database.cc',
'history/core/browser/thumbnail_database.h',
'history/core/browser/top_sites.cc',
@@ -121,21 +116,6 @@
],
},
{
- # GN version: //components/history/core/browser:proto
- # Protobuf compiler / generator for the InMemoryURLIndex caching
- # protocol buffer.
- 'target_name': 'history_core_browser_proto',
- 'type': 'static_library',
- 'sources': [
- 'history/core/browser/in_memory_url_index_cache.proto',
- ],
- 'variables': {
- 'proto_in_dir': 'history/core/browser',
- 'proto_out_dir': 'components/history/core/browser',
- },
- 'includes': [ '../build/protoc.gypi' ]
- },
- {
# GN version: //components/history/core/common
'target_name': 'history_core_common',
'type': 'static_library',
diff --git a/components/history/core/browser/BUILD.gn b/components/history/core/browser/BUILD.gn
index 5e8b4f4..3a4571d 100644
--- a/components/history/core/browser/BUILD.gn
+++ b/components/history/core/browser/BUILD.gn
@@ -2,8 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import("//third_party/protobuf/proto_library.gni")
-
static_library("browser") {
sources = [
"download_constants.h",
@@ -34,15 +32,11 @@ static_library("browser") {
"history_types.h",
"in_memory_database.cc",
"in_memory_database.h",
- "in_memory_url_index_types.cc",
- "in_memory_url_index_types.h",
"keyword_id.h",
"keyword_search_term.cc",
"keyword_search_term.h",
"page_usage_data.cc",
"page_usage_data.h",
- "scored_history_match.cc",
- "scored_history_match.h",
"thumbnail_database.cc",
"thumbnail_database.h",
"top_sites.cc",
@@ -114,9 +108,3 @@ static_library("browser") {
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
}
-
-proto_library("proto") {
- sources = [
- "in_memory_url_index_cache.proto",
- ]
-}
diff --git a/components/history/core/browser/download_database.cc b/components/history/core/browser/download_database.cc
index 530bd8e..b0a253c 100644
--- a/components/history/core/browser/download_database.cc
+++ b/components/history/core/browser/download_database.cc
@@ -359,7 +359,7 @@ void DownloadDatabase::QueryDownloads(std::vector<DownloadRow>* results) {
// Confirm all previous URLs in the chain have already been seen;
// if not, fill in with null or discard record.
- int current_chain_size = info_map[id]->url_chain.size();
+ int current_chain_size = static_cast<int>(info_map[id]->url_chain.size());
std::vector<GURL>* url_chain(&info_map[id]->url_chain);
DCHECK_EQ(chain_index, current_chain_size);
while (current_chain_size < chain_index) {
@@ -528,7 +528,7 @@ bool DownloadDatabase::CreateDownload(const DownloadRow& info) {
"VALUES (?, ?, ?)"));
for (size_t i = 0; i < info.url_chain.size(); ++i) {
statement_insert_chain.BindInt(0, info.id);
- statement_insert_chain.BindInt(1, i);
+ statement_insert_chain.BindInt(1, static_cast<int>(i));
statement_insert_chain.BindString(2, info.url_chain[i].spec());
if (!statement_insert_chain.Run()) {
UMA_HISTOGRAM_ENUMERATION("Download.DatabaseURLChainInsertError",
diff --git a/components/history/core/browser/history_database.cc b/components/history/core/browser/history_database.cc
index 4b58a5a..3de4523 100644
--- a/components/history/core/browser/history_database.cc
+++ b/components/history/core/browser/history_database.cc
@@ -176,9 +176,11 @@ void HistoryDatabase::ComputeDatabaseMetrics(
}
}
UMA_HISTOGRAM_COUNTS("History.WeeklyURLCount", week_url_count);
- UMA_HISTOGRAM_COUNTS_10000("History.WeeklyHostCount", week_hosts.size());
+ UMA_HISTOGRAM_COUNTS_10000("History.WeeklyHostCount",
+ static_cast<int>(week_hosts.size()));
UMA_HISTOGRAM_COUNTS("History.MonthlyURLCount", month_url_count);
- UMA_HISTOGRAM_COUNTS_10000("History.MonthlyHostCount", month_hosts.size());
+ UMA_HISTOGRAM_COUNTS_10000("History.MonthlyHostCount",
+ static_cast<int>(month_hosts.size()));
UMA_HISTOGRAM_TIMES("History.DatabaseAdvancedMetricsTime",
base::TimeTicks::Now() - start_time);
}
diff --git a/components/history/core/browser/thumbnail_database.cc b/components/history/core/browser/thumbnail_database.cc
index b7ad4c2..eefeca0 100644
--- a/components/history/core/browser/thumbnail_database.cc
+++ b/components/history/core/browser/thumbnail_database.cc
@@ -532,11 +532,11 @@ void RecoverDatabaseOrRaze(sql::Connection* db, const base::FilePath& db_path) {
// recovered" and "lots recovered". More than 10,000 rows recovered
// probably means there's something wrong with the profile.
UMA_HISTOGRAM_COUNTS_10000("History.FaviconsRecoveredRowsFavicons",
- favicons_rows_recovered);
+ static_cast<int>(favicons_rows_recovered));
UMA_HISTOGRAM_COUNTS_10000("History.FaviconsRecoveredRowsFaviconBitmaps",
- favicon_bitmaps_rows_recovered);
+ static_cast<int>(favicon_bitmaps_rows_recovered));
UMA_HISTOGRAM_COUNTS_10000("History.FaviconsRecoveredRowsIconMapping",
- icon_mapping_rows_recovered);
+ static_cast<int>(icon_mapping_rows_recovered));
RecordRecoveryEvent(RECOVERY_EVENT_RECOVERED);
}
diff --git a/components/history/core/browser/top_sites_database.cc b/components/history/core/browser/top_sites_database.cc
index ac5f71b..74ab115 100644
--- a/components/history/core/browser/top_sites_database.cc
+++ b/components/history/core/browser/top_sites_database.cc
@@ -307,7 +307,7 @@ void RecoverDatabaseOrRaze(sql::Connection* db, const base::FilePath& db_path) {
// "lots recovered". More than 10,000 rows recovered probably means there's
// something wrong with the profile.
UMA_HISTOGRAM_COUNTS_10000("History.TopSitesRecoveredRowsThumbnails",
- thumbnails_recovered);
+ static_cast<int>(thumbnails_recovered));
RecordRecoveryEvent(RECOVERY_EVENT_RECOVERED);
}
diff --git a/components/history/core/browser/url_utils.cc b/components/history/core/browser/url_utils.cc
index 2f4a1f6..a993619 100644
--- a/components/history/core/browser/url_utils.cc
+++ b/components/history/core/browser/url_utils.cc
@@ -79,7 +79,7 @@ GURL ToggleHTTPAndHTTPS(const GURL& url) {
else
return GURL::EmptyGURL();
url::Component comp;
- comp.len = new_scheme.length();
+ comp.len = static_cast<int>(new_scheme.length());
GURL::Replacements replacement;
replacement.SetScheme(new_scheme.c_str(), comp);
return url.ReplaceComponents(replacement);
diff --git a/components/history/core/browser/visit_filter.cc b/components/history/core/browser/visit_filter.cc
index 1d1f152..75582a2 100644
--- a/components/history/core/browser/visit_filter.cc
+++ b/components/history/core/browser/visit_filter.cc
@@ -115,7 +115,7 @@ void VisitFilter::GetTimesInRange(base::Time begin_time_of_the_day,
return;
}
- for (size_t i = 0; i < max_results; ++i) {
+ for (int i = 0; i < static_cast<int>(max_results); ++i) {
times->push_back(
std::make_pair(begin_time_of_the_day - base::TimeDelta::FromDays(i),
end_time_of_the_day - base::TimeDelta::FromDays(i)));
@@ -213,7 +213,7 @@ void VisitFilter::GetTimesOnTheDayOfTheWeek(int day,
if (!max_results)
max_results = kMaxReturnedResults;
- for (size_t i = 0; i < max_results; ++i) {
+ for (int i = 0; i < static_cast<int>(max_results); ++i) {
times->push_back(
std::make_pair(day_base - base::TimeDelta::FromDays(i * 7),
day_base + one_day - base::TimeDelta::FromDays(i * 7)));
@@ -245,7 +245,7 @@ void VisitFilter::GetTimesOnTheSameDayType(bool workday,
} else {
TimeVector vectors[3];
GetTimesOnTheDayOfTheWeek(1, week, max_results, &vectors[0]);
- for (size_t i = 2; i <= 5; ++i) {
+ for (int i = 2; i <= 5; ++i) {
GetTimesOnTheDayOfTheWeek(i, week, max_results, &vectors[(i - 1) % 3]);
UniteTimeVectors(vectors[(i - 2) % 3], vectors[(i - 1) % 3],
&vectors[i % 3]);