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

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

Issue 478243002: bindings: Adds virtual ScriptWrappable::wrap method. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 3 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 #include "platform/weborigin/KURL.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class WebCredential; 16 class WebCredential;
17 class ExceptionState; 17 class ExceptionState;
18 18
19 class Credential : public GarbageCollected<Credential>, public ScriptWrappable { 19 class Credential : public GarbageCollected<Credential>, public ScriptWrappable {
20 DEFINE_WRAPPERTYPEINFO();
20 public: 21 public:
21 static Credential* create(const String& id, const String& name, const KURL& avatar); 22 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&); 23 static Credential* create(const String& id, const String& name, const String & avatar, ExceptionState&);
23 24
24 // Credential.idl 25 // Credential.idl
25 const String& id() const { return m_platformCredential->id(); } 26 const String& id() const { return m_platformCredential->id(); }
26 const String& name() const { return m_platformCredential->name(); } 27 const String& name() const { return m_platformCredential->name(); }
27 const KURL& avatarURL() const { return m_platformCredential->avatarURL(); } 28 const KURL& avatarURL() const { return m_platformCredential->avatarURL(); }
28 29
29 virtual void trace(Visitor*); 30 virtual void trace(Visitor*);
30 31
31 protected: 32 protected:
32 explicit Credential(PlatformCredential*); 33 explicit Credential(PlatformCredential*);
33 Credential(const String& id, const String& name, const KURL& avatar); 34 Credential(const String& id, const String& name, const KURL& avatar);
34 35
35 // Parses a string as a KURL. Throws an exception via |exceptionState| if an invalid URL is produced. 36 // Parses a string as a KURL. Throws an exception via |exceptionState| if an invalid URL is produced.
36 static KURL parseStringAsURL(const String&, ExceptionState&); 37 static KURL parseStringAsURL(const String&, ExceptionState&);
37 38
38 Member<PlatformCredential> m_platformCredential; 39 Member<PlatformCredential> m_platformCredential;
39 }; 40 };
40 41
41 } // namespace blink 42 } // namespace blink
42 43
43 #endif // Credential_h 44 #endif // Credential_h
OLDNEW
« no previous file with comments | « Source/modules/battery/BatteryManager.h ('k') | Source/modules/credentialmanager/CredentialsContainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698