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

Unified Diff: content/child/notifications/notification_manager.cc

Issue 1071203002: Consistently handle persistent notification ids as int64_t (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-Integrate
Patch Set: rebase Created 5 years, 8 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
« no previous file with comments | « content/child/notifications/notification_manager.h ('k') | content/common/platform_notification_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/notifications/notification_manager.cc
diff --git a/content/child/notifications/notification_manager.cc b/content/child/notifications/notification_manager.cc
index b442bafb2eaa8b2ee3aedb14a587c05cbce6247c..e39588e44abff3db1235b61266ddc6f946fb0a86 100644
--- a/content/child/notifications/notification_manager.cc
+++ b/content/child/notifications/notification_manager.cc
@@ -8,7 +8,6 @@
#include "base/lazy_instance.h"
#include "base/metrics/histogram_macros.h"
-#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/thread_task_runner_handle.h"
#include "base/threading/thread_local.h"
@@ -93,7 +92,7 @@ void NotificationManager::showPersistent(
blink::WebServiceWorkerRegistration* service_worker_registration,
blink::WebNotificationShowCallbacks* callbacks) {
DCHECK(service_worker_registration);
- int64 service_worker_registration_id =
+ int64_t service_worker_registration_id =
static_cast<WebServiceWorkerRegistrationImpl*>(
service_worker_registration)->registration_id();
@@ -147,7 +146,7 @@ void NotificationManager::getNotifications(
service_worker_registration);
GURL origin = GURL(service_worker_registration_impl->scope()).GetOrigin();
- int64 service_worker_registration_id =
+ int64_t service_worker_registration_id =
service_worker_registration_impl->registration_id();
// TODO(peter): GenerateNotificationId is more of a request id. Consider
@@ -186,20 +185,7 @@ void NotificationManager::close(blink::WebNotificationDelegate* delegate) {
void NotificationManager::closePersistent(
const blink::WebSerializedOrigin& origin,
- const blink::WebString& persistent_notification_id_string) {
- // TODO(peter): Blink should store the persistent_notification_id as an
- // int64_t instead of a string. The id, created by Chromium, is a decimal
- // number that fits in an int64_t, so convert it until the API updates.
- base::string16 string_value = persistent_notification_id_string;
-
- int64_t persistent_notification_id = 0;
- if (!base::StringToInt64(string_value,
- &persistent_notification_id)) {
- NOTREACHED() << "Unable to close persistent notification; invalid id: "
- << string_value;
- return;
- }
-
+ int64_t persistent_notification_id) {
thread_safe_sender_->Send(new PlatformNotificationHostMsg_ClosePersistent(
GURL(origin.string()),
persistent_notification_id));
@@ -301,8 +287,7 @@ void NotificationManager::OnDidGetNotifications(
for (size_t i = 0; i < notification_infos.size(); ++i) {
blink::WebPersistentNotificationInfo web_notification_info;
- web_notification_info.persistentNotificationId =
- blink::WebString::fromUTF8(notification_infos[i].first);
+ web_notification_info.persistentId = notification_infos[i].first;
web_notification_info.data =
ToWebNotificationData(notification_infos[i].second);
@@ -334,7 +319,7 @@ void NotificationManager::DisplayPageNotification(
void NotificationManager::DisplayPersistentNotification(
const blink::WebSerializedOrigin& origin,
const blink::WebNotificationData& notification_data,
- int64 service_worker_registration_id,
+ int64_t service_worker_registration_id,
scoped_ptr<blink::WebNotificationShowCallbacks> callbacks,
const SkBitmap& icon) {
// TODO(peter): GenerateNotificationId is more of a request id. Consider
« no previous file with comments | « content/child/notifications/notification_manager.h ('k') | content/common/platform_notification_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698