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( ...@@ -138,7 +138,6 @@ jboolean FaviconHelper::GetForeignFaviconImageForURL(
base::BindOnce(&FaviconHelper::OnFaviconBitmapResultAvailable, base::BindOnce(&FaviconHelper::OnFaviconBitmapResultAvailable,
weak_ptr_factory_.GetWeakPtr(), weak_ptr_factory_.GetWeakPtr(),
ScopedJavaGlobalRef<jobject>(j_favicon_image_callback)), ScopedJavaGlobalRef<jobject>(j_favicon_image_callback)),
favicon::FaviconRequestPlatform::kMobile,
favicon::HistoryUiFaviconRequestOrigin::kRecentTabs, favicon::HistoryUiFaviconRequestOrigin::kRecentTabs,
/*icon_url_for_uma=*/ /*icon_url_for_uma=*/
open_tabs ? open_tabs->GetIconUrlForPageUrl(page_url) : GURL()); open_tabs ? open_tabs->GetIconUrlForPageUrl(page_url) : GURL());
......
...@@ -184,7 +184,7 @@ void FaviconSource::StartDataRequest( ...@@ -184,7 +184,7 @@ void FaviconSource::StartDataRequest(
base::BindOnce(&FaviconSource::OnFaviconDataAvailable, base::BindOnce(&FaviconSource::OnFaviconDataAvailable,
weak_ptr_factory_.GetWeakPtr(), std::move(callback), weak_ptr_factory_.GetWeakPtr(), std::move(callback),
parsed), parsed),
favicon::FaviconRequestPlatform::kDesktop, parsed_history_ui_origin, parsed_history_ui_origin,
/*icon_url_for_uma=*/ /*icon_url_for_uma=*/
GURL(parsed.icon_url)); GURL(parsed.icon_url));
} }
......
...@@ -51,12 +51,11 @@ class MockHistoryUiFaviconRequestHandler ...@@ -51,12 +51,11 @@ class MockHistoryUiFaviconRequestHandler
MockHistoryUiFaviconRequestHandler() = default; MockHistoryUiFaviconRequestHandler() = default;
~MockHistoryUiFaviconRequestHandler() override = default; ~MockHistoryUiFaviconRequestHandler() override = default;
MOCK_METHOD6( MOCK_METHOD5(
GetRawFaviconForPageURL, GetRawFaviconForPageURL,
void(const GURL& page_url, void(const GURL& page_url,
int desired_size_in_pixel, int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback callback, favicon_base::FaviconRawBitmapCallback callback,
favicon::FaviconRequestPlatform request_platform,
favicon::HistoryUiFaviconRequestOrigin request_origin_for_uma, favicon::HistoryUiFaviconRequestOrigin request_origin_for_uma,
const GURL& icon_url_for_uma)); const GURL& icon_url_for_uma));
...@@ -126,10 +125,10 @@ class FaviconSourceTestBase : public testing::Test { ...@@ -126,10 +125,10 @@ class FaviconSourceTestBase : public testing::Test {
return kDummyTaskId; return kDummyTaskId;
}); });
ON_CALL(*mock_history_ui_favicon_request_handler_, ON_CALL(*mock_history_ui_favicon_request_handler_,
GetRawFaviconForPageURL(_, _, _, _, _, _)) GetRawFaviconForPageURL(_, _, _, _, _))
.WillByDefault([](auto, auto, .WillByDefault([](auto, auto,
favicon_base::FaviconRawBitmapCallback callback, auto, favicon_base::FaviconRawBitmapCallback callback, auto,
auto, auto) { auto) {
std::move(callback).Run(favicon_base::FaviconRawBitmapResult()); std::move(callback).Run(favicon_base::FaviconRawBitmapResult());
}); });
...@@ -288,7 +287,7 @@ TEST_F( ...@@ -288,7 +287,7 @@ TEST_F(
EXPECT_CALL( EXPECT_CALL(
*mock_history_ui_favicon_request_handler_, *mock_history_ui_favicon_request_handler_,
GetRawFaviconForPageURL(GURL("https://www.google.com"), _, _, _, _, _)) GetRawFaviconForPageURL(GURL("https://www.google.com"), _, _, _, _))
.Times(1); .Times(1);
source()->StartDataRequest( source()->StartDataRequest(
......
...@@ -22,12 +22,6 @@ enum class HistoryUiFaviconRequestOrigin { ...@@ -22,12 +22,6 @@ enum class HistoryUiFaviconRequestOrigin {
kRecentTabs, kRecentTabs,
}; };
// Platform making the request.
enum class FaviconRequestPlatform {
kMobile,
kDesktop,
};
// Keyed service for handling favicon requests made by a history UI, forwarding // Keyed service for handling favicon requests made by a history UI, forwarding
// them to local storage, sync or Google server accordingly. This service should // them to local storage, sync or Google server accordingly. This service should
// only be used by the UIs listed in the HistoryUiFaviconRequestOrigin enum. // only be used by the UIs listed in the HistoryUiFaviconRequestOrigin enum.
...@@ -39,13 +33,10 @@ class HistoryUiFaviconRequestHandler : public KeyedService { ...@@ -39,13 +33,10 @@ class HistoryUiFaviconRequestHandler : public KeyedService {
// Google favicon server if |favicon::kEnableHistoryFaviconsGoogleServerQuery| // Google favicon server if |favicon::kEnableHistoryFaviconsGoogleServerQuery|
// is enabled. If a non-empty |icon_url_for_uma| (optional) is passed, it will // 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. // 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( virtual void GetRawFaviconForPageURL(
const GURL& page_url, const GURL& page_url,
int desired_size_in_pixel, int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback callback, favicon_base::FaviconRawBitmapCallback callback,
FaviconRequestPlatform request_platform,
HistoryUiFaviconRequestOrigin request_origin_for_uma, HistoryUiFaviconRequestOrigin request_origin_for_uma,
const GURL& icon_url_for_uma) = 0; const GURL& icon_url_for_uma) = 0;
......
...@@ -117,7 +117,6 @@ void HistoryUiFaviconRequestHandlerImpl::GetRawFaviconForPageURL( ...@@ -117,7 +117,6 @@ void HistoryUiFaviconRequestHandlerImpl::GetRawFaviconForPageURL(
const GURL& page_url, const GURL& page_url,
int desired_size_in_pixel, int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback callback, favicon_base::FaviconRawBitmapCallback callback,
FaviconRequestPlatform request_platform,
HistoryUiFaviconRequestOrigin request_origin_for_uma, HistoryUiFaviconRequestOrigin request_origin_for_uma,
const GURL& icon_url_for_uma) { const GURL& icon_url_for_uma) {
// First attempt to find the icon locally. // First attempt to find the icon locally.
...@@ -128,8 +127,8 @@ void HistoryUiFaviconRequestHandlerImpl::GetRawFaviconForPageURL( ...@@ -128,8 +127,8 @@ void HistoryUiFaviconRequestHandlerImpl::GetRawFaviconForPageURL(
&HistoryUiFaviconRequestHandlerImpl::OnBitmapLocalDataAvailable, &HistoryUiFaviconRequestHandlerImpl::OnBitmapLocalDataAvailable,
weak_ptr_factory_.GetWeakPtr(), CanQueryGoogleServer(), page_url, weak_ptr_factory_.GetWeakPtr(), CanQueryGoogleServer(), page_url,
desired_size_in_pixel, desired_size_in_pixel,
/*response_callback=*/std::move(callback), request_platform, /*response_callback=*/std::move(callback), request_origin_for_uma,
request_origin_for_uma, icon_url_for_uma, base::Time::Now()), icon_url_for_uma, base::Time::Now()),
&cancelable_task_tracker_); &cancelable_task_tracker_);
} }
...@@ -154,7 +153,6 @@ void HistoryUiFaviconRequestHandlerImpl::OnBitmapLocalDataAvailable( ...@@ -154,7 +153,6 @@ void HistoryUiFaviconRequestHandlerImpl::OnBitmapLocalDataAvailable(
const GURL& page_url, const GURL& page_url,
int desired_size_in_pixel, int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback response_callback, favicon_base::FaviconRawBitmapCallback response_callback,
FaviconRequestPlatform platform,
HistoryUiFaviconRequestOrigin origin_for_uma, HistoryUiFaviconRequestOrigin origin_for_uma,
const GURL& icon_url_for_uma, const GURL& icon_url_for_uma,
base::Time request_start_time_for_uma, base::Time request_start_time_for_uma,
......
...@@ -55,7 +55,6 @@ class HistoryUiFaviconRequestHandlerImpl ...@@ -55,7 +55,6 @@ class HistoryUiFaviconRequestHandlerImpl
const GURL& page_url, const GURL& page_url,
int desired_size_in_pixel, int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback callback, favicon_base::FaviconRawBitmapCallback callback,
FaviconRequestPlatform request_platform,
HistoryUiFaviconRequestOrigin request_origin_for_uma, HistoryUiFaviconRequestOrigin request_origin_for_uma,
const GURL& icon_url_for_uma) override; const GURL& icon_url_for_uma) override;
void GetFaviconImageForPageURL( void GetFaviconImageForPageURL(
...@@ -76,7 +75,6 @@ class HistoryUiFaviconRequestHandlerImpl ...@@ -76,7 +75,6 @@ class HistoryUiFaviconRequestHandlerImpl
const GURL& page_url, const GURL& page_url,
int desired_size_in_pixel, int desired_size_in_pixel,
favicon_base::FaviconRawBitmapCallback response_callback, favicon_base::FaviconRawBitmapCallback response_callback,
FaviconRequestPlatform platform,
HistoryUiFaviconRequestOrigin origin_for_uma, HistoryUiFaviconRequestOrigin origin_for_uma,
const GURL& icon_url_for_uma, const GURL& icon_url_for_uma,
base::Time request_start_time_for_uma, base::Time request_start_time_for_uma,
......
...@@ -35,7 +35,6 @@ const char kDummyIconUrl[] = "https://www.example.com/favicon16.png"; ...@@ -35,7 +35,6 @@ const char kDummyIconUrl[] = "https://www.example.com/favicon16.png";
const HistoryUiFaviconRequestOrigin kDummyOrigin = const HistoryUiFaviconRequestOrigin kDummyOrigin =
HistoryUiFaviconRequestOrigin::kHistory; HistoryUiFaviconRequestOrigin::kHistory;
const char kDummyOriginHistogramSuffix[] = ".HISTORY"; const char kDummyOriginHistogramSuffix[] = ".HISTORY";
const FaviconRequestPlatform kDummyPlatform = FaviconRequestPlatform::kDesktop;
base::CancelableTaskTracker::TaskId kDummyTaskId = 1; base::CancelableTaskTracker::TaskId kDummyTaskId = 1;
const char kAvailabilityHistogramName[] = const char kAvailabilityHistogramName[] =
"Sync.SyncedHistoryFaviconAvailability"; "Sync.SyncedHistoryFaviconAvailability";
...@@ -43,7 +42,6 @@ const char kLatencyHistogramName[] = "Sync.SyncedHistoryFaviconLatency"; ...@@ -43,7 +42,6 @@ const char kLatencyHistogramName[] = "Sync.SyncedHistoryFaviconLatency";
const char kGroupingHistogramName[] = const char kGroupingHistogramName[] =
"Sync.RequestGroupSizeForSyncedHistoryFavicons"; "Sync.RequestGroupSizeForSyncedHistoryFavicons";
const int kDefaultDesiredSizeInPixel = 16; const int kDefaultDesiredSizeInPixel = 16;
// TODO(victorvianna): Add unit tests specific for mobile.
const SkColor kTestColor = SK_ColorRED; const SkColor kTestColor = SK_ColorRED;
SkBitmap CreateTestSkBitmap(int desired_size_in_pixel) { SkBitmap CreateTestSkBitmap(int desired_size_in_pixel) {
...@@ -257,7 +255,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ShouldGetEmptyBitmap) { ...@@ -257,7 +255,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ShouldGetEmptyBitmap) {
favicon_base::FaviconRawBitmapResult result; favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL( history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel, GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin, base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL()); /*icon_url_for_uma=*/GURL());
EXPECT_FALSE(result.is_valid()); EXPECT_FALSE(result.is_valid());
histogram_tester_.ExpectUniqueSample( histogram_tester_.ExpectUniqueSample(
...@@ -278,7 +276,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ShouldGetSyncBitmap) { ...@@ -278,7 +276,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ShouldGetSyncBitmap) {
favicon_base::FaviconRawBitmapResult result; favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL( history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel, GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin, base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL()); /*icon_url_for_uma=*/GURL());
EXPECT_TRUE(result.is_valid()); EXPECT_TRUE(result.is_valid());
histogram_tester_.ExpectUniqueSample( histogram_tester_.ExpectUniqueSample(
...@@ -301,7 +299,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ShouldGetLocalBitmap) { ...@@ -301,7 +299,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ShouldGetLocalBitmap) {
favicon_base::FaviconRawBitmapResult result; favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL( history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel, GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin, base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL()); /*icon_url_for_uma=*/GURL());
EXPECT_TRUE(result.is_valid()); EXPECT_TRUE(result.is_valid());
histogram_tester_.ExpectUniqueSample( histogram_tester_.ExpectUniqueSample(
...@@ -328,7 +326,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ...@@ -328,7 +326,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest,
favicon_base::FaviconRawBitmapResult result; favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL( history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel, GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin, base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL()); /*icon_url_for_uma=*/GURL());
EXPECT_TRUE(result.is_valid()); EXPECT_TRUE(result.is_valid());
histogram_tester_.ExpectUniqueSample( histogram_tester_.ExpectUniqueSample(
...@@ -358,7 +356,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ...@@ -358,7 +356,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest,
favicon_base::FaviconRawBitmapResult result; favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL( history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel, GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin, base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL()); /*icon_url_for_uma=*/GURL());
EXPECT_TRUE(result.is_valid()); EXPECT_TRUE(result.is_valid());
histogram_tester_.ExpectUniqueSample( histogram_tester_.ExpectUniqueSample(
...@@ -507,7 +505,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ...@@ -507,7 +505,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest,
favicon_base::FaviconRawBitmapResult result; favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL( history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel, GURL(kDummyPageUrl), kDefaultDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin, base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL()); /*icon_url_for_uma=*/GURL());
} }
...@@ -530,7 +528,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ShouldResizeSyncBitmap) { ...@@ -530,7 +528,7 @@ TEST_F(HistoryUiFaviconRequestHandlerImplTest, ShouldResizeSyncBitmap) {
favicon_base::FaviconRawBitmapResult result; favicon_base::FaviconRawBitmapResult result;
history_ui_favicon_request_handler_.GetRawFaviconForPageURL( history_ui_favicon_request_handler_.GetRawFaviconForPageURL(
GURL(kDummyPageUrl), kDesiredSizeInPixel, GURL(kDummyPageUrl), kDesiredSizeInPixel,
base::BindOnce(&StoreBitmap, &result), kDummyPlatform, kDummyOrigin, base::BindOnce(&StoreBitmap, &result), kDummyOrigin,
/*icon_url_for_uma=*/GURL()); /*icon_url_for_uma=*/GURL());
EXPECT_TRUE(result.is_valid()); EXPECT_TRUE(result.is_valid());
EXPECT_EQ(gfx::Size(kDesiredSizeInPixel, kDesiredSizeInPixel), 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