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

Unified Diff: Source/modules/credentialmanager/CredentialManagerClient.cpp

Issue 573663002: Credential Manager: Wire up the client. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Null check. 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/credentialmanager/CredentialManagerClient.cpp
diff --git a/Source/modules/credentialmanager/CredentialManagerClient.cpp b/Source/modules/credentialmanager/CredentialManagerClient.cpp
index 76a99b08eb16ebb9ea47b126f88634ba6dae4bab..325fcf6b3e2a17329207d843ac5664b265bd7115 100644
--- a/Source/modules/credentialmanager/CredentialManagerClient.cpp
+++ b/Source/modules/credentialmanager/CredentialManagerClient.cpp
@@ -5,6 +5,9 @@
#include "config.h"
#include "modules/credentialmanager/CredentialManagerClient.h"
+#include "bindings/core/v8/ScriptState.h"
+#include "core/dom/Document.h"
+#include "core/dom/ExecutionContext.h"
#include "core/page/Page.h"
namespace blink {
@@ -25,6 +28,14 @@ const char* CredentialManagerClient::supplementName()
}
// static
+CredentialManagerClient* CredentialManagerClient::from(ExecutionContext* executionContext)
+{
+ if (!executionContext->isDocument() || !toDocument(executionContext)->page())
+ return 0;
+ return from(toDocument(executionContext)->page());
+}
+
+// static
CredentialManagerClient* CredentialManagerClient::from(Page* page)
{
return static_cast<CredentialManagerClient*>(WillBeHeapSupplement<Page>::from(page, supplementName()));
« no previous file with comments | « Source/modules/credentialmanager/CredentialManagerClient.h ('k') | Source/modules/credentialmanager/CredentialsContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698