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

Side by Side Diff: Source/modules/credentialmanager/Credential.h

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef Credential_h 5 #ifndef Credential_h
6 #define Credential_h 6 #define Credential_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "bindings/core/v8/SerializedScriptValue.h" 9 #include "bindings/core/v8/SerializedScriptValue.h"
10 #include "platform/credentialmanager/PlatformCredential.h" 10 #include "platform/credentialmanager/PlatformCredential.h"
11 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
12 #include "platform/weborigin/KURL.h"
12 13
13 namespace blink { 14 namespace blink {
14 15
15 class WebCredential; 16 class WebCredential;
17 class ExceptionState;
16 18
17 class Credential : public GarbageCollected<Credential>, public ScriptWrappable { 19 class Credential : public GarbageCollected<Credential>, public ScriptWrappable {
18 public: 20 public:
19 static Credential* create(const String& id, const String& name, const String & avatarURL); 21 static Credential* create(const String& id, const String& name, const KURL& avatar);
22 static Credential* create(const String& id, const String& name, const String & avatar, ExceptionState&);
20 23
21 // Credential.idl 24 // Credential.idl
22 const String& id() const { return m_platformCredential->id(); } 25 const String& id() const { return m_platformCredential->id(); }
23 const String& name() const { return m_platformCredential->name(); } 26 const String& name() const { return m_platformCredential->name(); }
24 const String& avatarURL() const { return m_platformCredential->avatarURL(); } 27 const KURL& avatarURL() const { return m_platformCredential->avatarURL(); }
25 28
26 virtual void trace(Visitor*); 29 virtual void trace(Visitor*);
27 30
28 protected: 31 protected:
29 explicit Credential(PlatformCredential*); 32 explicit Credential(PlatformCredential*);
30 Credential(const String& id, const String& name, const String& avatarURL); 33 Credential(const String& id, const String& name, const KURL& avatar);
34
35 // Parses a string as a KURL. Throws an exception via |exceptionState| if an invalid URL is produced.
36 static KURL parseStringAsURL(const String&, ExceptionState&);
31 37
32 Member<PlatformCredential> m_platformCredential; 38 Member<PlatformCredential> m_platformCredential;
33 }; 39 };
34 40
35 } // namespace blink 41 } // namespace blink
36 42
37 #endif // Credential_h 43 #endif // Credential_h
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/credentialmanager/localcredential-basics.html ('k') | Source/modules/credentialmanager/Credential.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698