Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 GarbageCollectedFinalized<Credential>, public ScriptWr appable { |
|
Mike West
2014/10/20 08:05:11
Is there a way to avoid finalizing Credential? If
haraken
2014/10/20 08:16:03
Why can't you simply use GarbageCollected<Credenti
sof
2014/10/20 08:18:53
It's due to the LocalCredential change made here.
| |
| 20 DEFINE_WRAPPERTYPEINFO(); | 20 DEFINE_WRAPPERTYPEINFO(); |
| 21 public: | 21 public: |
| 22 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); |
| 23 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&); |
| 24 | 24 |
| 25 // Credential.idl | 25 // Credential.idl |
| 26 const String& id() const { return m_platformCredential->id(); } | 26 const String& id() const { return m_platformCredential->id(); } |
| 27 const String& name() const { return m_platformCredential->name(); } | 27 const String& name() const { return m_platformCredential->name(); } |
| 28 const KURL& avatarURL() const { return m_platformCredential->avatarURL(); } | 28 const KURL& avatarURL() const { return m_platformCredential->avatarURL(); } |
| 29 | 29 |
| 30 virtual void trace(Visitor*); | 30 virtual void trace(Visitor*); |
| 31 | 31 |
| 32 PlatformCredential* platformCredential() const { return m_platformCredential ; } | 32 PlatformCredential* platformCredential() const { return m_platformCredential ; } |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 Credential(PlatformCredential*); | 35 Credential(PlatformCredential*); |
| 36 Credential(const String& id, const String& name, const KURL& avatar); | 36 Credential(const String& id, const String& name, const KURL& avatar); |
| 37 | 37 |
| 38 // Parses a string as a KURL. Throws an exception via |exceptionState| if an invalid URL is produced. | 38 // Parses a string as a KURL. Throws an exception via |exceptionState| if an invalid URL is produced. |
| 39 static KURL parseStringAsURL(const String&, ExceptionState&); | 39 static KURL parseStringAsURL(const String&, ExceptionState&); |
| 40 | 40 |
| 41 Member<PlatformCredential> m_platformCredential; | 41 Member<PlatformCredential> m_platformCredential; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 } // namespace blink | 44 } // namespace blink |
| 45 | 45 |
| 46 #endif // Credential_h | 46 #endif // Credential_h |
| OLD | NEW |