Commit 99d91c1b authored by Victor Hugo Vianna Silva's avatar Victor Hugo Vianna Silva Committed by Commit Bot

Remove unused platform parameter in HistoryUiFaviconRequestHandler API

No behavior is changed, since this parameter was unused.

Bug: 978775
Change-Id: Ia16b9170507262401df5277c96e658fd7761a1fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087393Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/master@{#747160}
parent 3a6641e8
......@@ -138,7 +138,6 @@ jboolean FaviconHelper::GetForeignFaviconImageForURL(
base::BindOnce(&FaviconHelper::OnFaviconBitmapResultAvailable,
weak_ptr_factory_.GetWeakPtr(),
ScopedJavaGlobalRef<jobject>(j_favicon_image_callback)),
favicon::FaviconRequestPlatform::kMobile,
favicon::HistoryUiFaviconRequestOrigin::kRecentTabs,
/*icon_url_for_uma=*/
open_tabs ? open_tabs->GetIconUrlForPageUrl(page_url) : GURL());
......
......@@ -184,7 +184,7 @@ void FaviconSource::StartDataRequest(
base::BindOnce(&FaviconSource::OnFaviconDataAvailable,
weak_ptr_factory_.GetWeakPtr(), std::move(callback),
parsed),
favicon::FaviconRequestPlatform::kDesktop, parsed_history_ui_origin,
parsed_history_ui_origin,
/*icon_url_for_uma=*/
GURL(parsed.icon_url));
}
......
......@@ -51,12 +51,11 @@ class MockHistoryUiFaviconRequestHandler
MockHistoryUiFaviconRequestHandler() = default;
~MockHistoryUiFaviconRequestHandler() override = default;
MOCK_METHOD6(
MOCK_METHOD5(
GetRawFaviconForPageURL,
void(const GURL& page_url,
int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback callback,
favicon::FaviconRequestPlatform request_platform,
favicon::HistoryUiFaviconRequestOrigin request_origin_for_uma,
const GURL& icon_url_for_uma));
......@@ -126,10 +125,10 @@ class FaviconSourceTestBase : public testing::Test {
return kDummyTaskId;
});
ON_CALL(*mock_history_ui_favicon_request_handler_,
GetRawFaviconForPageURL(_, _, _, _, _, _))
GetRawFaviconForPageURL(_, _, _, _, _))
.WillByDefault([](auto, auto,
favicon_base::FaviconRawBitmapCallback callback, auto,
auto, auto) {
auto) {
std::move(callback).Run(favicon_base::FaviconRawBitmapResult());
});
......@@ -288,7 +287,7 @@ TEST_F(
EXPECT_CALL(
*mock_history_ui_favicon_request_handler_,
GetRawFaviconForPageURL(GURL("https://www.google.com"), _, _, _, _, _))
GetRawFaviconForPageURL(GURL("https://www.google.com"), _, _, _, _))
.Times(1);
source()->StartDataRequest(
......
......@@ -22,12 +22,6 @@ enum class HistoryUiFaviconRequestOrigin {
kRecentTabs,
};
// Platform making the request.
enum class FaviconRequestPlatform {
kMobile,
kDesktop,
};
// Keyed service for handling favicon requests made by a history UI, forwarding
// them to local storage, sync or Google server accordingly. This service should
// only be used by the UIs listed in the HistoryUiFaviconRequestOrigin enum.
......@@ -39,13 +33,10 @@ class HistoryUiFaviconRequestHandler : public KeyedService {
// Google favicon server if |favicon::kEnableHistoryFaviconsGoogleServerQuery|
// is enabled. If a non-empty |icon_url_for_uma| (optional) is passed, it will
// be used to record UMA about the grouping of requests to the favicon server.
// |request_platform| specifies whether the caller is mobile or desktop code.
// TODO(victorvianna): Remove platform parameter since it's no longer needed.
virtual void GetRawFaviconForPageURL(
const GURL& page_url,
int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback callback,
FaviconRequestPlatform request_platform,
HistoryUiFaviconRequestOrigin request_origin_for_uma,
const GURL& icon_url_for_uma) = 0;
......
......@@ -117,7 +117,6 @@ void HistoryUiFaviconRequestHandlerImpl::GetRawFaviconForPageURL(
const GURL& page_url,
int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback callback,
FaviconRequestPlatform request_platform,
HistoryUiFaviconRequestOrigin request_origin_for_uma,
const GURL& icon_url_for_uma) {
// First attempt to find the icon locally.
......@@ -128,8 +127,8 @@ void HistoryUiFaviconRequestHandlerImpl::GetRawFaviconForPageURL(
&HistoryUiFaviconRequestHandlerImpl::OnBitmapLocalDataAvailable,
weak_ptr_factory_.GetWeakPtr(), CanQueryGoogleServer(), page_url,
desired_size_in_pixel,
/*response_callback=*/std::move(callback), request_platform,
request_origin_for_uma, icon_url_for_uma, base::Time::Now()),
/*response_callback=*/std::move(callback), request_origin_for_uma,
icon_url_for_uma, base::Time::Now()),
&cancelable_task_tracker_);
}
......@@ -154,7 +153,6 @@ void HistoryUiFaviconRequestHandlerImpl::OnBitmapLocalDataAvailable(
const GURL& page_url,
int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback response_callback,
FaviconRequestPlatform platform,
HistoryUiFaviconRequestOrigin origin_for_uma,
const GURL& icon_url_for_uma,
base::Time request_start_time_for_uma,
......
......@@ -55,7 +55,6 @@ class HistoryUiFaviconRequestHandlerImpl
const GURL& page_url,
int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback callback,
FaviconRequestPlatform request_platform,
HistoryUiFaviconRequestOrigin request_origin_for_uma,
const GURL& icon_url_for_uma) override;
void GetFaviconImageForPageURL(
......@@ -76,7 +75,6 @@ class HistoryUiFaviconRequestHandlerImpl
const GURL& page_url,
int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback response_callback,
FaviconRequestPlatform platform,
HistoryUiFaviconRequestOrigin origin_for_uma,
const GURL& icon_url_for_uma,
base::Time request_start_time_for_uma,
......
......@@ -35,7 +35,6 @@ const char kDummyIconUrl[] = "https://www.example.com/favicon16.png";
const HistoryUiFaviconRequestOrigin kDummyOrigin =
HistoryUiFaviconRequestOrigin::kHistory;
const char kDummyOriginHistogramSuffix[] = ".HISTORY";
const FaviconRequestPlatform kDummyPlatform = FaviconRequestPlatform::kDesktop;
base::CancelableTaskTracker::TaskId kDummyTaskId = 1;
const char kAvailabilityHistogramName[] =
"Sync.SyncedHistoryFaviconAvailability";
......@@ -43,7 +42,6 @@ const char kLatencyHistogramName[] = "Sync.SyncedHistoryFaviconLatency";
const char kGroupingHistogramName[] =
"Sync.RequestGroupSizeForSyncedHistoryFavicons";
const int kDefaultDesiredSizeInPixel = 16;
// TODO(victorvianna): Add unit tests specific for mobile.
const SkColor kTestColor = SK_ColorRED;
SkBitmap CreateTestSkBitmap(int desired_size_in_pixel) {
......@@ -257,7 +255,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ShouldGetEmptyBitmap) {
favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin,
base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL());
EXPECT_FALSE(result.is_valid());
histogram_tester_.ExpectUniqueSample(
......@@ -278,7 +276,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ShouldGetSyncBitmap) {
favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin,
base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL());
EXPECT_TRUE(result.is_valid());
histogram_tester_.ExpectUniqueSample(
......@@ -301,7 +299,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ShouldGetLocalBitmap) {
favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin,
base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL());
EXPECT_TRUE(result.is_valid());
histogram_tester_.ExpectUniqueSample(
......@@ -328,7 +326,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest,
favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin,
base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL());
EXPECT_TRUE(result.is_valid());
histogram_tester_.ExpectUniqueSample(
......@@ -358,7 +356,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest,
favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin,
base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL());
EXPECT_TRUE(result.is_valid());
histogram_tester_.ExpectUniqueSample(
......@@ -507,7 +505,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest,
favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin,
base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL());
}
......@@ -530,7 +528,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ShouldResizeSyncBitmap) {
favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin,
base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL());
EXPECT_TRUE(result.is_valid());
EXPECT_EQ(gfx::Size(kDesiredSizeInPixel, kDesiredSizeInPixel),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment