Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1339)

Unified Diff: content/child/notifications/notification_sound_loader.h

Issue 1237973005: [WIP] Implement notification sound loader Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/child/notifications/notification_sound_loader.h
diff --git a/content/child/notifications/notification_image_loader.h b/content/child/notifications/notification_sound_loader.h
similarity index 71%
copy from content/child/notifications/notification_image_loader.h
copy to content/child/notifications/notification_sound_loader.h
index 33a38f065a97cedc753a03209f8d0da17103367b..dc0601dec5e9d41d93a3ffbd762836e8f349ecc1 100644
--- a/content/child/notifications/notification_image_loader.h
+++ b/content/child/notifications/notification_sound_loader.h
@@ -1,9 +1,9 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright 2015 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 CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_IMAGE_LOADER_H_
-#define CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_IMAGE_LOADER_H_
+#ifndef CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_SOUND_LOADER_H_
+#define CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_SOUND_LOADER_H_
#include <vector>
@@ -28,7 +28,7 @@ class WebURLLoader;
namespace content {
-struct NotificationImageLoaderDeleter;
+struct NotificationSoundLoaderDeleter;
// Downloads the image associated with a notification and decodes the received
// image. This must be completed before notifications are shown to the user.
@@ -36,15 +36,15 @@ struct NotificationImageLoaderDeleter;
//
// All methods, except for the constructor, are expected to be used on the
// renderer main thread.
-class NotificationImageLoader
+class NotificationSoundLoader
: public blink::WebURLLoaderClient,
- public base::RefCountedThreadSafe<NotificationImageLoader,
- NotificationImageLoaderDeleter> {
- using ImageLoadCompletedCallback = base::Callback<void(int, const SkBitmap&)>;
+ public base::RefCountedThreadSafe<NotificationSoundLoader,
+ NotificationSoundLoaderDeleter> {
+ using SoundLoadCompletedCallback = base::Callback<void(int, const SkBitmap&)>;
public:
- NotificationImageLoader(
- const ImageLoadCompletedCallback& callback,
+ NotificationSoundLoader(
+ const SoundLoadCompletedCallback& callback,
const scoped_refptr<base::SingleThreadTaskRunner>& worker_task_runner);
// Asynchronously starts loading |image_url| using a Blink WebURLLoader. Must
@@ -63,12 +63,12 @@ class NotificationImageLoader
const blink::WebURLError& error);
private:
- friend class base::DeleteHelper<NotificationImageLoader>;
- friend class base::RefCountedThreadSafe<NotificationImageLoader,
- NotificationImageLoaderDeleter>;
- friend struct NotificationImageLoaderDeleter;
+ friend class base::DeleteHelper<NotificationSoundLoader>;
+ friend class base::RefCountedThreadSafe<NotificationSoundLoader,
+ NotificationSoundLoaderDeleter>;
+ friend struct NotificationSoundLoaderDeleter;
- virtual ~NotificationImageLoader();
+ virtual ~NotificationSoundLoader();
// Invokes the callback on the thread this image loader was started for. When
// the thread id is zero (the main document), it will be executed immediately.
@@ -82,7 +82,7 @@ class NotificationImageLoader
// Ensures that we delete the image loader on the main thread.
void DeleteOnCorrectThread() const;
- ImageLoadCompletedCallback callback_;
+ SoundLoadCompletedCallback callback_;
scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
@@ -94,15 +94,15 @@ class NotificationImageLoader
std::vector<uint8_t> buffer_;
- DISALLOW_COPY_AND_ASSIGN(NotificationImageLoader);
+ DISALLOW_COPY_AND_ASSIGN(NotificationSoundLoader);
};
-struct NotificationImageLoaderDeleter {
- static void Destruct(const NotificationImageLoader* context) {
+struct NotificationSoundLoaderDeleter {
+ static void Destruct(const NotificationSoundLoader* context) {
context->DeleteOnCorrectThread();
}
};
} // namespace content
-#endif // CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_IMAGE_LOADER_H_
+#endif // CONTENT_CHILD_NOTIFICATIONS_NOTIFICATION_SOUND_LOADER_H_
« no previous file with comments | « content/child/notifications/notification_manager.cc ('k') | content/child/notifications/notification_sound_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698