| 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 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/credentialmanager/Credential.h" | 6 #include "modules/credentialmanager/Credential.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "core/dom/ExceptionCode.h" | 9 #include "core/dom/ExceptionCode.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 | 25 |
| 26 Credential::Credential(PlatformCredential* credential) | 26 Credential::Credential(PlatformCredential* credential) |
| 27 : m_platformCredential(credential) | 27 : m_platformCredential(credential) |
| 28 { | 28 { |
| 29 } | 29 } |
| 30 | 30 |
| 31 Credential::Credential(const String& id, const String& name, const KURL& avatar) | 31 Credential::Credential(const String& id, const String& name, const KURL& avatar) |
| 32 : m_platformCredential(PlatformCredential::create(id, name, avatar)) | 32 : m_platformCredential(PlatformCredential::create(id, name, avatar)) |
| 33 { | 33 { |
| 34 ScriptWrappable::init(this); | |
| 35 } | 34 } |
| 36 | 35 |
| 37 KURL Credential::parseStringAsURL(const String& url, ExceptionState& exceptionSt
ate) | 36 KURL Credential::parseStringAsURL(const String& url, ExceptionState& exceptionSt
ate) |
| 38 { | 37 { |
| 39 KURL parsedURL = KURL(KURL(), url); | 38 KURL parsedURL = KURL(KURL(), url); |
| 40 if (!parsedURL.isValid()) | 39 if (!parsedURL.isValid()) |
| 41 exceptionState.throwDOMException(SyntaxError, "'" + url + "' is not a va
lid URL."); | 40 exceptionState.throwDOMException(SyntaxError, "'" + url + "' is not a va
lid URL."); |
| 42 return parsedURL; | 41 return parsedURL; |
| 43 } | 42 } |
| 44 | 43 |
| 45 void Credential::trace(Visitor* visitor) | 44 void Credential::trace(Visitor* visitor) |
| 46 { | 45 { |
| 47 visitor->trace(m_platformCredential); | 46 visitor->trace(m_platformCredential); |
| 48 } | 47 } |
| 49 | 48 |
| 50 } // namespace blink | 49 } // namespace blink |
| OLD | NEW |