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_)); |
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_; |