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

Unified Diff: chrome/browser/ui/webui/inline_login_ui.cc

Issue 45463004: Assign unique partition ID to gaia webview (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: default partitionId to empty string if not supplied Created 7 years, 1 month 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: chrome/browser/ui/webui/inline_login_ui.cc
diff --git a/chrome/browser/ui/webui/inline_login_ui.cc b/chrome/browser/ui/webui/inline_login_ui.cc
index 5198017ca61f28c6c4aff3b4d8e28c65be725ebc..4049a986fc693ae8a9995f2156ff0dcf92266926 100644
--- a/chrome/browser/ui/webui/inline_login_ui.cc
+++ b/chrome/browser/ui/webui/inline_login_ui.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/inline_login_ui.h"
+#include "base/atomic_sequence_num.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/memory/scoped_ptr.h"
@@ -92,6 +93,9 @@ class InlineLoginUIOAuth2Delegate
};
#endif // OS_CHROMEOS
+// Global SequenceNumber used for generating unique webview partition IDs.
+static base::StaticAtomicSequenceNumber next_partition_id;
+
class InlineLoginUIHandler : public content::WebUIMessageHandler {
public:
explicit InlineLoginUIHandler(Profile* profile)
@@ -165,6 +169,10 @@ class InlineLoginUIHandler : public content::WebUIMessageHandler {
net::GetValueForKeyInQuery(current_url, "Email", &email);
if (!email.empty())
params.SetString("email", email);
+
+ partition_id_ =
+ "gaia-webview-" + base::IntToString(next_partition_id.GetNext());
+ params.SetString("partitionId", partition_id_);
}
#endif
@@ -200,7 +208,8 @@ class InlineLoginUIHandler : public content::WebUIMessageHandler {
content::StoragePartition* partition =
content::BrowserContext::GetStoragePartitionForSite(
web_contents->GetBrowserContext(),
- GURL("chrome-guest://mfffpogegjflfpflabcdkioaeobkgjik/?"));
+ GURL("chrome-guest://mfffpogegjflfpflabcdkioaeobkgjik/?" +
+ partition_id_));
lazyboy 2013/11/04 21:08:29 nit: generally query params have "query=value" for
guohui 2013/11/05 14:35:36 i agree, but i thought currently ?partition_id is
Fady Samuel 2013/11/05 21:47:08 Yes, Hui is correct. See here: https://code.goog
scoped_refptr<SigninManagerCookieHelper> cookie_helper(
new SigninManagerCookieHelper(partition->GetURLRequestContext()));
@@ -309,6 +318,8 @@ class InlineLoginUIHandler : public content::WebUIMessageHandler {
Profile* profile_;
base::WeakPtrFactory<InlineLoginUIHandler> weak_factory_;
bool choose_what_to_sync_;
+ // Partition id for the gaia webview;
+ std::string partition_id_;
#if defined(OS_CHROMEOS)
scoped_ptr<chromeos::OAuth2TokenFetcher> oauth2_token_fetcher_;

Powered by Google App Engine
This is Rietveld 408576698