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

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

Issue 1568073002: Reduce string copies in GURL creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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_manager.cc
diff --git a/content/child/notifications/notification_manager.cc b/content/child/notifications/notification_manager.cc
index 30d28eed96651d407c6ba3cc5017689d803f9f06..f7b839c18b1939036235bef14612270e1c006014 100644
--- a/content/child/notifications/notification_manager.cc
+++ b/content/child/notifications/notification_manager.cc
@@ -18,6 +18,7 @@
#include "content/child/thread_safe_sender.h"
#include "content/common/notification_constants.h"
#include "content/public/common/platform_notification_data.h"
+#include "third_party/WebKit/public/platform/URLConversion.h"
#include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationDelegate.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -182,7 +183,7 @@ void NotificationManager::closePersistent(
// TODO(mkwst): This is potentially doing the wrong thing with unique
// origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See
// https://crbug.com/490074 for detail.
- GURL(origin.toString()), persistent_notification_id));
+ blink::WebStringToGURL(origin.toString()), persistent_notification_id));
}
void NotificationManager::notifyDelegateDestroyed(
@@ -207,7 +208,7 @@ WebNotificationPermission NotificationManager::checkPermission(
// origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See
// https://crbug.com/490074 for detail.
thread_safe_sender_->Send(new PlatformNotificationHostMsg_CheckPermission(
- GURL(origin.toString()), &permission));
+ blink::WebStringToGURL(origin.toString()), &permission));
return permission;
}
@@ -312,7 +313,7 @@ void NotificationManager::DisplayPageNotification(
// origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See
// https://crbug.com/490074 for detail.
thread_safe_sender_->Send(new PlatformNotificationHostMsg_Show(
- notification_id, GURL(origin.toString()), icon,
+ notification_id, blink::WebStringToGURL(origin.toString()), icon,
ToPlatformNotificationData(notification_data)));
}
@@ -334,7 +335,8 @@ void NotificationManager::DisplayPersistentNotification(
// origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See
// https://crbug.com/490074 for detail.
thread_safe_sender_->Send(new PlatformNotificationHostMsg_ShowPersistent(
- request_id, service_worker_registration_id, GURL(origin.toString()), icon,
+ request_id, service_worker_registration_id,
+ blink::WebStringToGURL(origin.toString()), icon,
ToPlatformNotificationData(notification_data)));
}
« no previous file with comments | « content/child/notifications/notification_data_conversions.cc ('k') | content/renderer/dom_storage/webstoragenamespace_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698