Commit acae75ce authored by Hesen Zhang's avatar Hesen Zhang Committed by Commit Bot

[Notification scheduler]: Wrap result for IconConverter.

- Support IconConverter to return a bundle of
success result and data.

Bug: 963290
Change-Id: I50d2908047aa1554d7d3c5a3ba2f1bf913c03d01
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762819
Commit-Queue: Hesen Zhang <hesen@chromium.org>
Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690046}
parent 17beb072
...@@ -20,8 +20,8 @@ source_set("lib") { ...@@ -20,8 +20,8 @@ source_set("lib") {
"distribution_policy.cc", "distribution_policy.cc",
"distribution_policy.h", "distribution_policy.h",
"icon_converter.h", "icon_converter.h",
"icon_converter_impl.cc", "icon_converter_result.cc",
"icon_converter_impl.h", "icon_converter_result.h",
"icon_entry.cc", "icon_entry.cc",
"icon_entry.h", "icon_entry.h",
"icon_store.cc", "icon_store.cc",
...@@ -46,6 +46,8 @@ source_set("lib") { ...@@ -46,6 +46,8 @@ source_set("lib") {
"notification_scheduler_context.h", "notification_scheduler_context.h",
"notification_store.cc", "notification_store.cc",
"notification_store.h", "notification_store.h",
"png_icon_converter_impl.cc",
"png_icon_converter_impl.h",
"proto_conversion.cc", "proto_conversion.cc",
"proto_conversion.h", "proto_conversion.h",
"scheduled_notification_manager.cc", "scheduled_notification_manager.cc",
......
...@@ -5,11 +5,13 @@ ...@@ -5,11 +5,13 @@
#ifndef CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_CONVERTER_H_ #ifndef CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_CONVERTER_H_
#define CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_CONVERTER_H_ #define CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_CONVERTER_H_
#include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/callback.h" #include "base/callback.h"
#include "base/macros.h" #include "base/macros.h"
#include "chrome/browser/notifications/scheduler/internal/icon_converter_result.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
namespace notifications { namespace notifications {
...@@ -18,8 +20,10 @@ namespace notifications { ...@@ -18,8 +20,10 @@ namespace notifications {
// and to decode strings to icons. // and to decode strings to icons.
class IconConverter { class IconConverter {
public: public:
using EncodeCallback = base::OnceCallback<void(std::vector<std::string>)>; using EncodeCallback =
using DecodeCallback = base::OnceCallback<void(std::vector<SkBitmap>)>; base::OnceCallback<void(std::unique_ptr<EncodeResult>)>;
using DecodeCallback =
base::OnceCallback<void(std::unique_ptr<DecodeResult>)>;
// Converts SkBitmap icons to strings. // Converts SkBitmap icons to strings.
virtual void ConvertIconToString(std::vector<SkBitmap> images, virtual void ConvertIconToString(std::vector<SkBitmap> images,
......
// Copyright 2019 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.
#include "chrome/browser/notifications/scheduler/internal/icon_converter_result.h"
#include <utility>
#include <vector>
namespace notifications {
EncodeResult::EncodeResult(bool success, std::vector<std::string> data)
: success(success), encoded_data(std::move(data)) {}
bool EncodeResult::operator==(const EncodeResult& other) const {
return success == other.success &&
encoded_data.size() == other.encoded_data.size();
}
EncodeResult::~EncodeResult() = default;
DecodeResult::DecodeResult(bool success, std::vector<SkBitmap> icons)
: success(success), decoded_icons(std::move(icons)) {}
bool DecodeResult::operator==(const DecodeResult& other) const {
return success == other.success &&
decoded_icons.size() == other.decoded_icons.size();
}
DecodeResult::~DecodeResult() = default;
} // namespace notifications
// Copyright 2019 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.
#ifndef CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_CONVERTER_RESULT_H_
#define CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_CONVERTER_RESULT_H_
#include <string>
#include <vector>
#include "base/optional.h"
#include "third_party/skia/include/core/SkBitmap.h"
namespace notifications {
// Result from IconConverter's encoding process.
struct EncodeResult {
EncodeResult(bool success, std::vector<std::string> data);
bool operator==(const EncodeResult& other) const;
~EncodeResult();
bool success;
std::vector<std::string> encoded_data;
private:
DISALLOW_COPY_AND_ASSIGN(EncodeResult);
};
// Result from IconConverter's decoding process.
struct DecodeResult {
DecodeResult(bool success, std::vector<SkBitmap> icons);
bool operator==(const DecodeResult& other) const;
~DecodeResult();
bool success;
std::vector<SkBitmap> decoded_icons;
private:
DISALLOW_COPY_AND_ASSIGN(DecodeResult);
};
} // namespace notifications
#endif // CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_CONVERTER_RESULT_H_
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/task_environment.h" #include "base/test/task_environment.h"
#include "chrome/browser/notifications/scheduler/internal/icon_converter_impl.h" #include "chrome/browser/notifications/scheduler/internal/png_icon_converter_impl.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace notifications { namespace notifications {
...@@ -13,46 +13,49 @@ namespace { ...@@ -13,46 +13,49 @@ namespace {
class IconConverterTest : public testing::Test { class IconConverterTest : public testing::Test {
public: public:
IconConverterTest() {} IconConverterTest() : encoded_result_(), decoded_result_() {}
~IconConverterTest() override = default; ~IconConverterTest() override = default;
void SetUp() override { void SetUp() override {
auto icon_converter = std::make_unique<IconConverterImpl>(); auto icon_converter = std::make_unique<PngIconConverterImpl>();
icon_converter_ = std::move(icon_converter); icon_converter_ = std::move(icon_converter);
encoded_data_.clear();
decoded_icons_.clear();
} }
void OnIconsEncoded(base::OnceClosure quit_closure, void OnIconsEncoded(base::OnceClosure quit_closure,
std::vector<std::string> encoded_data) { std::unique_ptr<EncodeResult> encoded_result) {
encoded_data_ = std::move(encoded_data); encoded_result_ = std::move(encoded_result);
std::move(quit_closure).Run(); std::move(quit_closure).Run();
} }
void OnIconsDecoded(base::OnceClosure quit_closure, void OnIconsDecoded(base::OnceClosure quit_closure,
std::vector<SkBitmap> decoded_icons) { std::unique_ptr<DecodeResult> decoded_result) {
decoded_icons_ = std::move(decoded_icons); decoded_result_ = std::move(decoded_result);
std::move(quit_closure).Run(); std::move(quit_closure).Run();
} }
void VerifyEncodeRoundTrip(std::vector<SkBitmap> input) { void VerifyEncodeRoundTrip(std::vector<SkBitmap> input) {
EXPECT_EQ(decoded_icons_.size(), input.size()); EXPECT_EQ(decoded_icons()->size(), input.size());
for (size_t i = 0; i < input.size(); i++) { for (size_t i = 0; i < input.size(); i++) {
EXPECT_EQ(input[i].height(), decoded_icons_[i].height()); EXPECT_EQ(input[i].height(), decoded_icons()->at(i).height());
EXPECT_EQ(input[i].width(), decoded_icons_[i].width()); EXPECT_EQ(input[i].width(), decoded_icons()->at(i).width());
} }
} }
protected: protected:
IconConverter* icon_converter() { return icon_converter_.get(); } IconConverter* icon_converter() { return icon_converter_.get(); }
std::vector<SkBitmap>* decoded_icons() { return &decoded_icons_; } std::vector<SkBitmap>* decoded_icons() {
std::vector<std::string>* encoded_data() { return &encoded_data_; } return &decoded_result_->decoded_icons;
}
std::vector<std::string>* encoded_data() {
return &encoded_result_->encoded_data;
}
private: private:
base::test::TaskEnvironment task_environment_; base::test::TaskEnvironment task_environment_;
std::unique_ptr<IconConverter> icon_converter_; std::unique_ptr<IconConverter> icon_converter_;
std::vector<std::string> encoded_data_; std::unique_ptr<EncodeResult> encoded_result_;
std::vector<SkBitmap> decoded_icons_; std::unique_ptr<DecodeResult> decoded_result_;
DISALLOW_COPY_AND_ASSIGN(IconConverterTest); DISALLOW_COPY_AND_ASSIGN(IconConverterTest);
}; };
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "chrome/browser/notifications/scheduler/internal/icon_store.h" #include "chrome/browser/notifications/scheduler/internal/icon_store.h"
#include <map>
#include <utility> #include <utility>
#include "base/guid.h" #include "base/guid.h"
...@@ -115,13 +116,17 @@ void IconProtoDbStore::OnIconEntriesLoaded( ...@@ -115,13 +116,17 @@ void IconProtoDbStore::OnIconEntriesLoaded(
void IconProtoDbStore::OnIconsEncoded( void IconProtoDbStore::OnIconsEncoded(
AddCallback callback, AddCallback callback,
std::vector<std::string> icons_uuid, std::vector<std::string> icons_uuid,
std::vector<std::string> encoded_icons_data) { std::unique_ptr<EncodeResult> encode_result) {
// TODO(hesen): Handle result return from PNGCodec. if (!encode_result->success) {
DCHECK_EQ(icons_uuid.size(), encoded_icons_data.size()); std::move(callback).Run({} /*icons_uuid*/, false);
return;
}
auto entries_to_save = std::make_unique<KeyEntryVector>(); auto entries_to_save = std::make_unique<KeyEntryVector>();
for (size_t i = 0; i < encoded_icons_data.size(); i++) { auto encoded_data = std::move(encode_result->encoded_data);
for (size_t i = 0; i < encoded_data.size(); i++) {
IconEntry icon_entry; IconEntry icon_entry;
icon_entry.data = std::move(encoded_icons_data[i]); icon_entry.data = std::move(encoded_data[i]);
entries_to_save->emplace_back(icons_uuid[i], std::move(icon_entry)); entries_to_save->emplace_back(icons_uuid[i], std::move(icon_entry));
} }
auto add_callback = auto add_callback =
...@@ -131,15 +136,21 @@ void IconProtoDbStore::OnIconsEncoded( ...@@ -131,15 +136,21 @@ void IconProtoDbStore::OnIconsEncoded(
std::move(add_callback)); std::move(add_callback));
} }
void IconProtoDbStore::OnIconsDecoded(LoadIconsCallback callback, void IconProtoDbStore::OnIconsDecoded(
LoadIconsCallback callback,
std::vector<std::string> icons_uuid, std::vector<std::string> icons_uuid,
std::vector<SkBitmap> decoded_icons) { std::unique_ptr<DecodeResult> decoded_result) {
// TODO(hesen): Handle result return from PNGCodec. if (!decoded_result->success) {
IconsMap icons; std::move(callback).Run(false, {} /*IconsMap*/);
return;
}
IconsMap icons_map;
auto icons = std::move(decoded_result->decoded_icons);
for (size_t i = 0; i < icons_uuid.size(); i++) { for (size_t i = 0; i < icons_uuid.size(); i++) {
icons.emplace(std::move(icons_uuid[i]), decoded_icons[i]); icons_map.emplace(std::move(icons_uuid[i]), std::move(icons[i]));
} }
std::move(callback).Run(true, std::move(icons)); std::move(callback).Run(true, std::move(icons_map));
} }
} // namespace notifications } // namespace notifications
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_STORE_H_ #ifndef CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_STORE_H_
#define CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_STORE_H_ #define CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_STORE_H_
#include <map>
#include <memory> #include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -15,6 +16,7 @@ ...@@ -15,6 +16,7 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "chrome/browser/notifications/proto/icon.pb.h" #include "chrome/browser/notifications/proto/icon.pb.h"
#include "chrome/browser/notifications/scheduler/internal/icon_converter.h" #include "chrome/browser/notifications/scheduler/internal/icon_converter.h"
#include "chrome/browser/notifications/scheduler/internal/icon_converter_result.h"
#include "chrome/browser/notifications/scheduler/internal/icon_entry.h" #include "chrome/browser/notifications/scheduler/internal/icon_entry.h"
#include "chrome/browser/notifications/scheduler/public/notification_data.h" #include "chrome/browser/notifications/scheduler/public/notification_data.h"
#include "components/leveldb_proto/public/proto_database.h" #include "components/leveldb_proto/public/proto_database.h"
...@@ -92,12 +94,12 @@ class IconProtoDbStore : public IconStore { ...@@ -92,12 +94,12 @@ class IconProtoDbStore : public IconStore {
// Called when the icons are encoded. // Called when the icons are encoded.
void OnIconsEncoded(AddCallback callback, void OnIconsEncoded(AddCallback callback,
std::vector<std::string> icons_uuid, std::vector<std::string> icons_uuid,
std::vector<std::string> encoded_icons_data); std::unique_ptr<EncodeResult> encode_result);
// Called when the encoded data are decoded. // Called when the encoded data are decoded.
void OnIconsDecoded(LoadIconsCallback callback, void OnIconsDecoded(LoadIconsCallback callback,
std::vector<std::string> icons_uuid, std::vector<std::string> icons_uuid,
std::vector<SkBitmap> decoded_icons); std::unique_ptr<DecodeResult> decode_result);
// The proto database instance that persists data. // The proto database instance that persists data.
std::unique_ptr<leveldb_proto::ProtoDatabase<proto::Icon, IconEntry>> db_; std::unique_ptr<leveldb_proto::ProtoDatabase<proto::Icon, IconEntry>> db_;
......
...@@ -75,8 +75,9 @@ class IconStoreTest : public testing::Test { ...@@ -75,8 +75,9 @@ class IconStoreTest : public testing::Test {
EXPECT_CALL(*icon_converter(), ConvertStringToIcon(_, _)) EXPECT_CALL(*icon_converter(), ConvertStringToIcon(_, _))
.WillOnce(Invoke([&](std::vector<std::string> encoded_icons, .WillOnce(Invoke([&](std::vector<std::string> encoded_icons,
IconConverter::DecodeCallback callback) { IconConverter::DecodeCallback callback) {
std::vector<SkBitmap> results(encoded_icons.size()); std::vector<SkBitmap> icons(encoded_icons.size());
std::move(callback).Run(std::move(results)); std::move(callback).Run(
std::make_unique<DecodeResult>(true, std::move(icons)));
})); }));
store()->LoadIcons( store()->LoadIcons(
std::move(keys), std::move(keys),
...@@ -89,8 +90,9 @@ class IconStoreTest : public testing::Test { ...@@ -89,8 +90,9 @@ class IconStoreTest : public testing::Test {
EXPECT_CALL(*icon_converter(), ConvertIconToString(_, _)) EXPECT_CALL(*icon_converter(), ConvertIconToString(_, _))
.WillOnce(Invoke([&](std::vector<SkBitmap> icons, .WillOnce(Invoke([&](std::vector<SkBitmap> icons,
IconConverter::EncodeCallback callback) { IconConverter::EncodeCallback callback) {
std::vector<std::string> results(icons.size()); std::vector<std::string> encoded_icons(icons.size());
std::move(callback).Run(std::move(results)); std::move(callback).Run(
std::make_unique<EncodeResult>(true, std::move(encoded_icons)));
})); }));
store()->AddIcons(std::move(input), std::move(add_icons_callback)); store()->AddIcons(std::move(input), std::move(add_icons_callback));
} }
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/notifications/scheduler/internal/icon_converter_impl.h" #include "chrome/browser/notifications/scheduler/internal/png_icon_converter_impl.h"
#include <memory>
#include <utility> #include <utility>
#include "base/base64.h" #include "base/base64.h"
...@@ -15,41 +16,48 @@ ...@@ -15,41 +16,48 @@
namespace notifications { namespace notifications {
namespace { namespace {
std::vector<IconEntry::IconData> ConvertIconToStringInternal( std::unique_ptr<EncodeResult> ConvertIconToStringInternal(
std::vector<SkBitmap> images) { std::vector<SkBitmap> images) {
base::AssertLongCPUWorkAllowed(); base::AssertLongCPUWorkAllowed();
std::vector<std::string> results; std::vector<std::string> encoded_data;
for (size_t i = 0; i < images.size(); i++) { for (size_t i = 0; i < images.size(); i++) {
std::vector<unsigned char> image_data; std::vector<unsigned char> image_data;
gfx::PNGCodec::EncodeBGRASkBitmap( bool success = gfx::PNGCodec::EncodeBGRASkBitmap(
std::move(images[i]), false /*discard_transparency*/, &image_data); std::move(images[i]), false /*discard_transparency*/, &image_data);
if (!success)
return std::make_unique<EncodeResult>(false, std::vector<std::string>());
std::string encoded(image_data.begin(), image_data.end()); std::string encoded(image_data.begin(), image_data.end());
results.emplace_back(std::move(encoded)); encoded_data.emplace_back(std::move(encoded));
} }
return results; return std::make_unique<EncodeResult>(
true, std::vector<std::string>(std::move(encoded_data)));
} }
std::vector<SkBitmap> ConvertStringToIconInternal( std::unique_ptr<DecodeResult> ConvertStringToIconInternal(
std::vector<std::string> encoded_data) { std::vector<std::string> encoded_data) {
base::AssertLongCPUWorkAllowed(); base::AssertLongCPUWorkAllowed();
std::vector<SkBitmap> images; std::vector<SkBitmap> icons;
for (size_t i = 0; i < encoded_data.size(); i++) { for (size_t i = 0; i < encoded_data.size(); i++) {
SkBitmap image; SkBitmap image;
gfx::PNGCodec::Decode(reinterpret_cast<const unsigned char*>( bool success = gfx::PNGCodec::Decode(reinterpret_cast<const unsigned char*>(
std::move(encoded_data[i]).data()), std::move(encoded_data[i]).data()),
encoded_data[i].length(), &image); encoded_data[i].length(), &image);
images.emplace_back(std::move(image)); if (!success)
return std::make_unique<DecodeResult>(false, std::vector<SkBitmap>());
icons.emplace_back(std::move(image));
} }
return images; return std::make_unique<DecodeResult>(
true, std::vector<SkBitmap>(std::move(icons)));
} }
} // namespace } // namespace
IconConverterImpl::IconConverterImpl() = default; PngIconConverterImpl::PngIconConverterImpl() = default;
IconConverterImpl::~IconConverterImpl() = default; PngIconConverterImpl::~PngIconConverterImpl() = default;
void IconConverterImpl::ConvertIconToString(std::vector<SkBitmap> images, void PngIconConverterImpl::ConvertIconToString(std::vector<SkBitmap> images,
EncodeCallback callback) { EncodeCallback callback) {
DCHECK(callback); DCHECK(callback);
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
...@@ -59,7 +67,7 @@ void IconConverterImpl::ConvertIconToString(std::vector<SkBitmap> images, ...@@ -59,7 +67,7 @@ void IconConverterImpl::ConvertIconToString(std::vector<SkBitmap> images,
std::move(callback)); std::move(callback));
} }
void IconConverterImpl::ConvertStringToIcon( void PngIconConverterImpl::ConvertStringToIcon(
std::vector<std::string> encoded_data, std::vector<std::string> encoded_data,
DecodeCallback callback) { DecodeCallback callback) {
DCHECK(callback); DCHECK(callback);
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_CONVERTER_IMPL_H_ #ifndef CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_PNG_ICON_CONVERTER_IMPL_H_
#define CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_CONVERTER_IMPL_H_ #define CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_PNG_ICON_CONVERTER_IMPL_H_
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
namespace notifications { namespace notifications {
class IconConverterImpl : public IconConverter { class PngIconConverterImpl : public IconConverter {
public: public:
IconConverterImpl(); PngIconConverterImpl();
~IconConverterImpl() override; ~PngIconConverterImpl() override;
private: private:
// IconConverter implementation. // IconConverter implementation.
...@@ -26,9 +26,9 @@ class IconConverterImpl : public IconConverter { ...@@ -26,9 +26,9 @@ class IconConverterImpl : public IconConverter {
void ConvertStringToIcon(std::vector<std::string> encoded_data, void ConvertStringToIcon(std::vector<std::string> encoded_data,
DecodeCallback callback) override; DecodeCallback callback) override;
DISALLOW_COPY_AND_ASSIGN(IconConverterImpl); DISALLOW_COPY_AND_ASSIGN(PngIconConverterImpl);
}; };
} // namespace notifications } // namespace notifications
#endif // CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_ICON_CONVERTER_IMPL_H_ #endif // CHROME_BROWSER_NOTIFICATIONS_SCHEDULER_INTERNAL_PNG_ICON_CONVERTER_IMPL_H_
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "base/time/default_clock.h" #include "base/time/default_clock.h"
#include "chrome/browser/notifications/scheduler/internal/background_task_coordinator.h" #include "chrome/browser/notifications/scheduler/internal/background_task_coordinator.h"
#include "chrome/browser/notifications/scheduler/internal/display_decider.h" #include "chrome/browser/notifications/scheduler/internal/display_decider.h"
#include "chrome/browser/notifications/scheduler/internal/icon_converter_impl.h"
#include "chrome/browser/notifications/scheduler/internal/icon_store.h" #include "chrome/browser/notifications/scheduler/internal/icon_store.h"
#include "chrome/browser/notifications/scheduler/internal/impression_history_tracker.h" #include "chrome/browser/notifications/scheduler/internal/impression_history_tracker.h"
#include "chrome/browser/notifications/scheduler/internal/impression_store.h" #include "chrome/browser/notifications/scheduler/internal/impression_store.h"
...@@ -21,6 +20,7 @@ ...@@ -21,6 +20,7 @@
#include "chrome/browser/notifications/scheduler/internal/notification_schedule_service_impl.h" #include "chrome/browser/notifications/scheduler/internal/notification_schedule_service_impl.h"
#include "chrome/browser/notifications/scheduler/internal/notification_scheduler_context.h" #include "chrome/browser/notifications/scheduler/internal/notification_scheduler_context.h"
#include "chrome/browser/notifications/scheduler/internal/notification_store.h" #include "chrome/browser/notifications/scheduler/internal/notification_store.h"
#include "chrome/browser/notifications/scheduler/internal/png_icon_converter_impl.h"
#include "chrome/browser/notifications/scheduler/internal/scheduled_notification_manager.h" #include "chrome/browser/notifications/scheduler/internal/scheduled_notification_manager.h"
#include "chrome/browser/notifications/scheduler/internal/scheduler_config.h" #include "chrome/browser/notifications/scheduler/internal/scheduler_config.h"
#include "chrome/browser/notifications/scheduler/internal/scheduler_utils.h" #include "chrome/browser/notifications/scheduler/internal/scheduler_utils.h"
...@@ -65,7 +65,7 @@ KeyedService* CreateNotificationScheduleService( ...@@ -65,7 +65,7 @@ KeyedService* CreateNotificationScheduleService(
leveldb_proto::ProtoDbType::NOTIFICATION_SCHEDULER_ICON_STORE, leveldb_proto::ProtoDbType::NOTIFICATION_SCHEDULER_ICON_STORE,
icon_store_dir, task_runner); icon_store_dir, task_runner);
auto icon_store = std::make_unique<IconProtoDbStore>( auto icon_store = std::make_unique<IconProtoDbStore>(
std::move(icon_db), std::make_unique<IconConverterImpl>()); std::move(icon_db), std::make_unique<PngIconConverterImpl>());
// Build impression tracker. // Build impression tracker.
base::FilePath impression_store_dir = storage_dir.Append(kImpressionDBName); base::FilePath impression_store_dir = storage_dir.Append(kImpressionDBName);
......
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