Skip to content

Commit

Permalink
PpdProvider: Deprecate v2
Browse files Browse the repository at this point in the history
This change follows up on https://crbug.com/888189. The change does not
introduce behavioral changes, but it

*   removes the v2 code and all references to it,
*   renames all v3 code to be versionless (replacing the v2 code), and
*   updates a few files to reflect the new changes.

Bug: b:172223775
Fixed: b:172223775
Test: chromeos_unittests --gtest_filter='PpdProvider*'
Change-Id: Ia6dd9defadf0c19801995ef8a0755a046929f569
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3055152
Reviewed-by: Sean Kau <skau@chromium.org>
Commit-Queue: Kalvin Lee <kdlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#907242}
  • Loading branch information
Kalvin Lee authored and Chromium LUCI CQ committed Jul 30, 2021
1 parent ef5be45 commit 8711dc8
Show file tree
Hide file tree
Showing 8 changed files with 1,284 additions and 4,141 deletions.
6 changes: 4 additions & 2 deletions chrome/browser/chromeos/printing/ppd_provider_factory.cc
Expand Up @@ -10,7 +10,9 @@
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chromeos/printing/ppd_cache.h"
#include "chromeos/printing/ppd_provider_v3.h"
#include "chromeos/printing/ppd_metadata_manager.h"
#include "chromeos/printing/ppd_provider.h"
#include "chromeos/printing/printer_config_cache.h"
#include "components/version_info/version_info.h"
#include "content/public/browser/browser_thread.h"
#include "google_apis/google_api_keys.h"
Expand Down Expand Up @@ -41,7 +43,7 @@ scoped_refptr<PpdProvider> CreatePpdProvider(Profile* profile) {
g_browser_process->GetApplicationLocale(),
base::DefaultClock::GetInstance(), std::move(manager_config_cache));

return CreateV3Provider(
return PpdProvider::Create(
version_info::GetVersion(), PpdCache::Create(ppd_cache_path),
std::move(metadata_manager), std::move(provider_config_cache));
}
Expand Down
52 changes: 15 additions & 37 deletions chromeos/BUILD.gn
Expand Up @@ -20,14 +20,6 @@ config("chromeos_implementation") {
defines = [ "CHROMEOS_IMPLEMENTATION" ]
}

declare_args() {
# Defines a buildflag for ease of iteration on the print team's
# PpdProvider class.
# TODO(crbug.com/1025995): remove this and all related scaffolding
# once we're ready to cut over.
is_printing_ppd_provider_v3 = true
}

component("chromeos") {
public_deps = []
deps = [
Expand Down Expand Up @@ -72,7 +64,15 @@ component("chromeos") {
"printing/ppd_cache.h",
"printing/ppd_line_reader.cc",
"printing/ppd_line_reader.h",
"printing/ppd_metadata_manager.cc",
"printing/ppd_metadata_manager.h",
"printing/ppd_metadata_parser.cc",
"printing/ppd_metadata_parser.h",
"printing/ppd_provider.cc",
"printing/ppd_provider.h",
"printing/ppd_provider.h",
"printing/printer_config_cache.cc",
"printing/printer_config_cache.h",
"printing/printer_configuration.cc",
"printing/printer_configuration.h",
"printing/printer_translator.cc",
Expand All @@ -89,21 +89,6 @@ component("chromeos") {
if (current_cpu == "arm" || current_cpu == "x86") {
defines = [ "BINDER_IPC_32BIT" ]
}

if (is_printing_ppd_provider_v3) {
sources += [
"printing/ppd_metadata_manager.cc",
"printing/ppd_metadata_manager.h",
"printing/ppd_metadata_parser.cc",
"printing/ppd_metadata_parser.h",
"printing/ppd_provider_v3.cc",
"printing/ppd_provider_v3.h",
"printing/printer_config_cache.cc",
"printing/printer_config_cache.h",
]
} else {
sources += [ "printing/ppd_provider.cc" ]
}
}
}

Expand Down Expand Up @@ -224,29 +209,22 @@ test("chromeos_unittests") {
"policy/weekly_time/weekly_time_unittest.cc",
"printing/cups_printer_status_unittest.cc",
"printing/epson_driver_matching_unittest.cc",
"printing/fake_printer_config_cache.cc",
"printing/fake_printer_config_cache.h",
"printing/ppd_cache_unittest.cc",
"printing/ppd_line_reader_unittest.cc",
"printing/ppd_metadata_manager_unittest.cc",
"printing/ppd_metadata_matchers.h",
"printing/ppd_metadata_parser_unittest.cc",
"printing/ppd_provider_unittest.cc",
"printing/printer_config_cache_unittest.cc",
"printing/printer_configuration_unittest.cc",
"printing/printer_translator_unittest.cc",
"printing/uri_unittest.cc",
"printing/uri_unittest.h",
"printing/uri_unittest_consistency.cc",
"printing/usb_printer_id_unittest.cc",
]

if (is_printing_ppd_provider_v3) {
sources += [
"printing/fake_printer_config_cache.cc",
"printing/fake_printer_config_cache.h",
"printing/ppd_metadata_manager_unittest.cc",
"printing/ppd_metadata_matchers.h",
"printing/ppd_metadata_parser_unittest.cc",
"printing/ppd_provider_v3_unittest.cc",
"printing/printer_config_cache_unittest.cc",
]
} else {
sources += [ "printing/ppd_provider_unittest.cc" ]
}
}

data = [ "test/data/" ]
Expand Down

0 comments on commit 8711dc8

Please sign in to comment.