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

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

Issue 2382973002: Convert WebSecurityOrigin -> GURL without re-parsing the url (Closed)
Patch Set: rebase on #427122 Created 4 years, 2 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/child/storage_util.cc » ('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 45af387fac9dfa0482a5c832f965cf96c09e267a..bb9ab7a9d2ef62a19ff0cc0e6a7f070f6a0226b6 100644
--- a/content/child/notifications/notification_manager.cc
+++ b/content/child/notifications/notification_manager.cc
@@ -19,6 +19,7 @@
#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 "url/origin.h"
namespace content {
namespace {
@@ -88,7 +89,7 @@ void NotificationManager::show(
DCHECK_EQ(0u, notification_data.actions.size());
DCHECK_EQ(0u, notification_resources->actionIcons.size());
- GURL origin_gurl = blink::WebStringToGURL(origin.toString());
+ GURL origin_gurl = url::Origin(origin).GetURL();
int notification_id =
notification_dispatcher_->GenerateNotificationId(CurrentWorkerId());
@@ -153,8 +154,7 @@ void NotificationManager::showPersistent(
// 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,
- blink::WebStringToGURL(origin.toString()),
+ request_id, service_worker_registration_id, url::Origin(origin).GetURL(),
ToPlatformNotificationData(notification_data),
ToNotificationResources(std::move(notification_resources))));
}
@@ -210,8 +210,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.
- blink::WebStringToGURL(origin.toString()),
- base::UTF16ToUTF8(base::StringPiece16(tag)),
+ url::Origin(origin).GetURL(), base::UTF16ToUTF8(base::StringPiece16(tag)),
base::UTF16ToUTF8(base::StringPiece16(notification_id))));
}
« no previous file with comments | « content/child/notifications/notification_manager.h ('k') | content/child/storage_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698