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

Side by Side Diff: third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp

Issue 1373773003: Implement 'window.isSecureContext'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: document. Created 5 years, 2 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
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/PasswordCredential.h" 6 #include "modules/credentialmanager/PasswordCredential.h"
7 7
8 #include "bindings/core/v8/Dictionary.h" 8 #include "bindings/core/v8/Dictionary.h"
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
(...skipping 28 matching lines...) Expand all
39 PasswordCredential::PasswordCredential(const String& id, const String& password, const String& name, const KURL& icon) 39 PasswordCredential::PasswordCredential(const String& id, const String& password, const String& name, const KURL& icon)
40 : Credential(PlatformPasswordCredential::create(id, password, name, icon)) 40 : Credential(PlatformPasswordCredential::create(id, password, name, icon))
41 { 41 {
42 } 42 }
43 43
44 FormData* PasswordCredential::toFormData(ScriptState* scriptState, const FormDat aOptions& options) 44 FormData* PasswordCredential::toFormData(ScriptState* scriptState, const FormDat aOptions& options)
45 { 45 {
46 FormData* fd = FormData::create(); 46 FormData* fd = FormData::create();
47 47
48 String errorMessage; 48 String errorMessage;
49 if (!scriptState->executionContext()->isPrivilegedContext(errorMessage)) 49 if (!scriptState->executionContext()->isSecureContext(errorMessage))
50 return fd; 50 return fd;
51 51
52 fd->append(options.idName(), id()); 52 fd->append(options.idName(), id());
53 fd->append(options.passwordName(), password()); 53 fd->append(options.passwordName(), password());
54 fd->makeOpaque(); 54 fd->makeOpaque();
55 return fd; 55 return fd;
56 } 56 }
57 57
58 const String& PasswordCredential::password() const 58 const String& PasswordCredential::password() const
59 { 59 {
60 return static_cast<PlatformPasswordCredential*>(m_platformCredential.get())- >password(); 60 return static_cast<PlatformPasswordCredential*>(m_platformCredential.get())- >password();
61 } 61 }
62 62
63 DEFINE_TRACE(PasswordCredential) 63 DEFINE_TRACE(PasswordCredential)
64 { 64 {
65 Credential::trace(visitor); 65 Credential::trace(visitor);
66 } 66 }
67 67
68 } // namespace blink 68 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698