diff options
author | abhishek.a21 <abhishek.a21@samsung.com> | 2015-07-22 02:11:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-22 09:12:55 +0000 |
commit | faf6421d12a9499b3a3d5266b5ceb33ea81ce1d2 (patch) | |
tree | fe0c36593acb4bd50c5372080be04bc0b5e1a83f | |
parent | 1067392cb46b944e198f085fad7e226d700ad070 (diff) | |
download | chromium_src-faf6421d12a9499b3a3d5266b5ceb33ea81ce1d2.zip chromium_src-faf6421d12a9499b3a3d5266b5ceb33ea81ce1d2.tar.gz chromium_src-faf6421d12a9499b3a3d5266b5ceb33ea81ce1d2.tar.bz2 |
Componentize //chrome/browser/offline_pages
Componentize offline_page_metadata_store_impl.[cc/h], unittest and offline_pages.proto file.
Updated BUILD.gn and corresponding .gypi files for the same.
BUG=507284
Review URL: https://codereview.chromium.org/1226173004
Cr-Commit-Position: refs/heads/master@{#339852}
15 files changed, 34 insertions, 29 deletions
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 511d584..7ef02ed 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn @@ -85,7 +85,6 @@ source_set("browser") { "//chrome/app/theme:theme_resources", "//chrome/browser/net:encrypted_cert_logger_proto", "//chrome/browser/net:probe_message_proto", - "//chrome/browser/offline_pages:offline_pages_proto", "//chrome/browser/ssl:cert_logger_proto", "//chrome/browser/ui", "//chrome/common", diff --git a/chrome/browser/android/offline_pages/offline_page_model_factory.cc b/chrome/browser/android/offline_pages/offline_page_model_factory.cc index 20b19a1..5c55b34 100644 --- a/chrome/browser/android/offline_pages/offline_page_model_factory.cc +++ b/chrome/browser/android/offline_pages/offline_page_model_factory.cc @@ -8,14 +8,14 @@ #include "base/memory/singleton.h" #include "base/path_service.h" #include "base/sequenced_task_runner.h" -#include "chrome/browser/offline_pages/offline_page_metadata_store_impl.h" -#include "chrome/browser/offline_pages/offline_pages.pb.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_paths.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/leveldb_proto/proto_database_impl.h" +#include "components/offline_pages/offline_page_metadata_store_impl.h" #include "components/offline_pages/offline_page_model.h" +#include "components/offline_pages/proto/offline_pages.pb.h" #include "content/public/browser/browser_thread.h" namespace offline_pages { diff --git a/chrome/browser/offline_pages/DEPS b/chrome/browser/offline_pages/DEPS deleted file mode 100644 index 568b6d6..0000000 --- a/chrome/browser/offline_pages/DEPS +++ /dev/null @@ -1,3 +0,0 @@ -include_rules = [ - "+components/offline_pages", -] diff --git a/chrome/browser/offline_pages/OWNERS b/chrome/browser/offline_pages/OWNERS deleted file mode 100644 index 2e32330..0000000 --- a/chrome/browser/offline_pages/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -dimich@chromium.org -fgorski@chromium.org diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 4690bd0..1c684b0 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1362,8 +1362,6 @@ 'browser/enhanced_bookmarks/bookmark_server_cluster_service_factory.h', 'browser/enhanced_bookmarks/enhanced_bookmark_model_factory.cc', 'browser/enhanced_bookmarks/enhanced_bookmark_model_factory.h', - 'browser/offline_pages/offline_page_metadata_store_impl.cc', - 'browser/offline_pages/offline_page_metadata_store_impl.h', ], 'chrome_browser_bookmark_android_sources': [ 'browser/android/offline_pages/offline_page_bridge.cc', @@ -3143,7 +3141,6 @@ 'common', 'common_net', 'encrypted_cert_logger_proto', - 'offline_pages_proto', 'probe_message_proto', '../components/components.gyp:autofill_core_browser', '../components/components.gyp:bookmarks_browser', @@ -3902,18 +3899,6 @@ 'includes': [ '../build/protoc.gypi', ], }, { - # Protobuf compiler / generator for the offline page item protocol buffer. - # GN version: //chrome/browser/offline_pages:offline_pages_proto - 'target_name': 'offline_pages_proto', - 'type': 'static_library', - 'sources': [ 'browser/offline_pages/offline_pages.proto', ], - 'variables': { - 'proto_in_dir': 'browser/offline_pages', - 'proto_out_dir': 'chrome/browser/offline_pages', - }, - 'includes': [ '../build/protoc.gypi', ], - }, - { # Protobuf compiler / generator for Probe Message. # GN version: //chrome/browser/net:probe_message_proto 'target_name': 'probe_message_proto', diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index c5a8357..cc8a8bb 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi @@ -160,7 +160,6 @@ 'browser/net/spdyproxy/data_reduction_proxy_settings_unittest_android.cc', 'browser/net/ssl_config_service_manager_pref_unittest.cc', 'browser/net/url_info_unittest.cc', - 'browser/offline_pages/offline_page_metadata_store_impl_unittest.cc', 'browser/password_manager/chrome_password_manager_client_unittest.cc', 'browser/password_manager/password_manager_internals_service_unittest.cc', 'browser/password_manager/password_manager_metrics_util_unittest.cc', diff --git a/components/components_tests.gyp b/components/components_tests.gyp index 509ef5e..36e465c 100644 --- a/components/components_tests.gyp +++ b/components/components_tests.gyp @@ -342,6 +342,7 @@ 'network_time/network_time_tracker_unittest.cc', ], 'offline_page_unittest_sources': [ + 'offline_pages/offline_page_metadata_store_impl_unittest.cc', 'offline_pages/offline_page_model_unittest.cc', ], 'omnibox_unittest_sources': [ diff --git a/components/offline_pages.gypi b/components/offline_pages.gypi index 668c806..b71297f 100644 --- a/components/offline_pages.gypi +++ b/components/offline_pages.gypi @@ -15,7 +15,10 @@ '../base/base.gyp:base', '../net/net.gyp:net', '../url/url.gyp:url_lib', + '../third_party/leveldatabase/leveldatabase.gyp:leveldatabase', + 'components.gyp:leveldb_proto', 'keyed_service_core', + 'offline_pages_proto', ], 'sources': [ 'offline_pages/offline_page_archiver.h', @@ -25,7 +28,21 @@ 'offline_pages/offline_page_model.h', 'offline_pages/offline_page_metadata_store.cc', 'offline_pages/offline_page_metadata_store.h', + 'offline_pages/offline_page_metadata_store_impl.cc', + 'offline_pages/offline_page_metadata_store_impl.h', ], }, + { + # Protobuf compiler / generator for the offline page item protocol buffer. + # GN version: //components/offline_pages/proto + 'target_name': 'offline_pages_proto', + 'type': 'static_library', + 'sources': [ 'offline_pages/proto/offline_pages.proto', ], + 'variables': { + 'proto_in_dir': 'offline_pages/proto', + 'proto_out_dir': 'components/offline_pages/proto', + }, + 'includes': [ '../build/protoc.gypi', ], + }, ], } diff --git a/components/offline_pages/BUILD.gn b/components/offline_pages/BUILD.gn index 36cee85..47f6adc 100644 --- a/components/offline_pages/BUILD.gn +++ b/components/offline_pages/BUILD.gn @@ -10,6 +10,8 @@ static_library("offline_pages") { "offline_page_item.h", "offline_page_metadata_store.cc", "offline_page_metadata_store.h", + "offline_page_metadata_store_impl.cc", + "offline_page_metadata_store_impl.h", "offline_page_model.cc", "offline_page_model.h", ] @@ -17,7 +19,10 @@ static_library("offline_pages") { deps = [ "//base", "//components/keyed_service/core", + "//components/leveldb_proto", + "//components/offline_pages/proto:offline_pages_proto", "//net", + "//third_party/leveldatabase", "//url", ] } @@ -25,11 +30,13 @@ static_library("offline_pages") { source_set("unit_tests") { testonly = true sources = [ + "offline_page_metadata_store_impl_unittest.cc", "offline_page_model_unittest.cc", ] deps = [ ":offline_pages", + "//components/offline_pages/proto:offline_pages_proto", "//testing/gtest", ] } diff --git a/components/offline_pages/DEPS b/components/offline_pages/DEPS index 2393a77..e49d933c0 100644 --- a/components/offline_pages/DEPS +++ b/components/offline_pages/DEPS @@ -1,4 +1,6 @@ include_rules = [ "+components/keyed_service", + "+components/leveldb_proto", "+net", + "+third_party/leveldatabase", ] diff --git a/chrome/browser/offline_pages/offline_page_metadata_store_impl.cc b/components/offline_pages/offline_page_metadata_store_impl.cc index a6b929c..e19585fa 100644 --- a/chrome/browser/offline_pages/offline_page_metadata_store_impl.cc +++ b/components/offline_pages/offline_page_metadata_store_impl.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/offline_pages/offline_page_metadata_store_impl.h" +#include "components/offline_pages/offline_page_metadata_store_impl.h" #include "base/bind.h" #include "base/files/file_path.h" @@ -11,9 +11,9 @@ #include "base/sequenced_task_runner.h" #include "base/strings/utf_string_conversions.h" #include "base/thread_task_runner_handle.h" -#include "chrome/browser/offline_pages/offline_pages.pb.h" #include "components/leveldb_proto/proto_database.h" #include "components/offline_pages/offline_page_item.h" +#include "components/offline_pages/proto/offline_pages.pb.h" #include "third_party/leveldatabase/env_chromium.h" #include "third_party/leveldatabase/src/include/leveldb/db.h" #include "url/gurl.h" diff --git a/chrome/browser/offline_pages/offline_page_metadata_store_impl.h b/components/offline_pages/offline_page_metadata_store_impl.h index 5eb24fd..5eb24fd 100644 --- a/chrome/browser/offline_pages/offline_page_metadata_store_impl.h +++ b/components/offline_pages/offline_page_metadata_store_impl.h diff --git a/chrome/browser/offline_pages/offline_page_metadata_store_impl_unittest.cc b/components/offline_pages/offline_page_metadata_store_impl_unittest.cc index ae30400..7e7685e 100644 --- a/chrome/browser/offline_pages/offline_page_metadata_store_impl_unittest.cc +++ b/components/offline_pages/offline_page_metadata_store_impl_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 "chrome/browser/offline_pages/offline_page_metadata_store_impl.h" +#include "components/offline_pages/offline_page_metadata_store_impl.h" #include "base/bind.h" #include "base/files/file_path.h" @@ -11,9 +11,9 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/offline_pages/offline_pages.pb.h" #include "components/leveldb_proto/proto_database_impl.h" #include "components/offline_pages/offline_page_item.h" +#include "components/offline_pages/proto/offline_pages.pb.h" #include "testing/gtest/include/gtest/gtest.h" using leveldb_proto::ProtoDatabaseImpl; diff --git a/chrome/browser/offline_pages/BUILD.gn b/components/offline_pages/proto/BUILD.gn index f906f38..7cfb1a6 100644 --- a/chrome/browser/offline_pages/BUILD.gn +++ b/components/offline_pages/proto/BUILD.gn @@ -4,7 +4,7 @@ import("//third_party/protobuf/proto_library.gni") -# GYP version: chrome/chrome_browser.gypi:offline_pages_proto +# GYP version: components/offline_pages.gypi:offline_pages_proto proto_library("offline_pages_proto") { sources = [ "offline_pages.proto", diff --git a/chrome/browser/offline_pages/offline_pages.proto b/components/offline_pages/proto/offline_pages.proto index 16f23b1..16f23b1 100644 --- a/chrome/browser/offline_pages/offline_pages.proto +++ b/components/offline_pages/proto/offline_pages.proto |