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

Unified Diff: third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp

Issue 2848743003: Speed up CredentialsContainer::get for federations (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp
diff --git a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp
index 684815b852c397677a3468274a4d7898d8735306..5198c3f8c0f4822768cf0ffeb5ab9d7cfa277eae 100644
--- a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp
+++ b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp
@@ -5,6 +5,7 @@
#include "modules/credentialmanager/CredentialsContainer.h"
#include <memory>
+#include <utility>
#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
@@ -167,17 +168,10 @@ ScriptPromise CredentialsContainer::get(
Vector<KURL> providers;
if (options.hasFederated() && options.federated().hasProviders()) {
- // TODO(mkwst): CredentialRequestOptions::federated() needs to return a
- // reference, not a value. Because it returns a temporary value now, a for
- // loop that directly references the value generates code that holds a
- // reference to a value that no longer exists by the time the loop starts
- // looping. In order to avoid this crazyness for the moment, we're making a
- // copy of the vector. https://crbug.com/587088
- const Vector<String> provider_strings = options.federated().providers();
- for (const auto& string : provider_strings) {
+ for (const auto& string : options.federated().providers()) {
KURL url = KURL(KURL(), string);
if (url.IsValid())
- providers.push_back(url);
+ providers.push_back(std::move(url));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698