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

Unified Diff: Source/modules/credentialmanager/LocalCredential.cpp

Issue 464783003: Credential manager: Convert strings to URLs early. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Feedback. Created 6 years, 4 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: Source/modules/credentialmanager/LocalCredential.cpp
diff --git a/Source/modules/credentialmanager/LocalCredential.cpp b/Source/modules/credentialmanager/LocalCredential.cpp
index 03dbcea512b928532979d642d42ed6d96964c887..7b61e4b98a09a07475a3eb54afdca18be6176857 100644
--- a/Source/modules/credentialmanager/LocalCredential.cpp
+++ b/Source/modules/credentialmanager/LocalCredential.cpp
@@ -4,17 +4,22 @@
#include "config.h"
#include "modules/credentialmanager/LocalCredential.h"
+
+#include "bindings/core/v8/ExceptionState.h"
#include "platform/credentialmanager/PlatformLocalCredential.h"
namespace blink {
-LocalCredential* LocalCredential::create(const String& id, const String& name, const String& avatarURL, const String& password)
+LocalCredential* LocalCredential::create(const String& id, const String& name, const String& avatar, const String& password, ExceptionState& exceptionState)
{
+ KURL avatarURL = parseStringAsURL(avatar, exceptionState);
+ if (exceptionState.hadException())
+ return nullptr;
return new LocalCredential(id, name, avatarURL, password);
}
-LocalCredential::LocalCredential(const String& id, const String& name, const String& avatarURL, const String& password)
- : Credential(PlatformLocalCredential::create(id, name, avatarURL, password))
+LocalCredential::LocalCredential(const String& id, const String& name, const KURL& avatar, const String& password)
+ : Credential(PlatformLocalCredential::create(id, name, avatar, password))
{
}
« no previous file with comments | « Source/modules/credentialmanager/LocalCredential.h ('k') | Source/modules/credentialmanager/LocalCredential.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698