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

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

Issue 1321683009: Remove unused 'Credential::create' methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « Source/modules/credentialmanager/Credential.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
11 namespace blink { 11 namespace blink {
12 12
13 Credential* Credential::create(const String& id, const String& name, const KURL& icon)
14 {
15 return new Credential(id, name, icon);
16 }
17
18 Credential* Credential::create(const String& id, const String& name, const Strin g& icon, ExceptionState& exceptionState)
19 {
20 KURL iconURL = parseStringAsURL(icon, exceptionState);
21 if (exceptionState.hadException())
22 return nullptr;
23 return new Credential(id, name, iconURL);
24 }
25
26 Credential::Credential(PlatformCredential* credential) 13 Credential::Credential(PlatformCredential* credential)
27 : m_platformCredential(credential) 14 : m_platformCredential(credential)
28 { 15 {
29 } 16 }
30 17
31 Credential::Credential(const String& id, const String& name, const KURL& icon) 18 Credential::Credential(const String& id, const String& name, const KURL& icon)
32 : m_platformCredential(PlatformCredential::create(id, name, icon)) 19 : m_platformCredential(PlatformCredential::create(id, name, icon))
33 { 20 {
34 } 21 }
35 22
36 KURL Credential::parseStringAsURL(const String& url, ExceptionState& exceptionSt ate) 23 KURL Credential::parseStringAsURL(const String& url, ExceptionState& exceptionSt ate)
37 { 24 {
38 if (url.isEmpty()) 25 if (url.isEmpty())
39 return KURL(); 26 return KURL();
40 KURL parsedURL = KURL(KURL(), url); 27 KURL parsedURL = KURL(KURL(), url);
41 if (!parsedURL.isValid()) 28 if (!parsedURL.isValid())
42 exceptionState.throwDOMException(SyntaxError, "'" + url + "' is not a va lid URL."); 29 exceptionState.throwDOMException(SyntaxError, "'" + url + "' is not a va lid URL.");
43 return parsedURL; 30 return parsedURL;
44 } 31 }
45 32
46 DEFINE_TRACE(Credential) 33 DEFINE_TRACE(Credential)
47 { 34 {
48 visitor->trace(m_platformCredential); 35 visitor->trace(m_platformCredential);
49 } 36 }
50 37
51 } // namespace blink 38 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/credentialmanager/Credential.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698