Index: content/browser/browser_plugin/browser_plugin_embedder.cc |
diff --git a/content/browser/browser_plugin/browser_plugin_embedder.cc b/content/browser/browser_plugin/browser_plugin_embedder.cc |
index abdde143de2e21e2cbeac70838a506ff710fb414..dd2f9191cbe352af87af40e1e8045872024c459b 100644 |
--- a/content/browser/browser_plugin/browser_plugin_embedder.cc |
+++ b/content/browser/browser_plugin/browser_plugin_embedder.cc |
@@ -21,6 +21,7 @@ |
#include "content/public/browser/notification_types.h" |
#include "content/public/browser/web_contents_view.h" |
#include "content/public/common/url_constants.h" |
+#include "net/base/escape.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
#include "ui/gfx/size.h" |
#include "ui/surface/transport_dib.h" |
@@ -90,9 +91,23 @@ void BrowserPluginEmbedder::CreateGuest(RenderViewHost* render_view_host, |
const std::string& host = |
render_view_host->GetSiteInstance()->GetSiteURL().host(); |
+ std::string url_encoded_partition = |
+ net::EscapeQueryParamValue(storage_partition_id, false); |
+ |
+ // The SiteInstance of a given webview tag is based on the fact that it's a |
+ // guest process in addition to which platform application the tag belongs to |
+ // and what storage partition is in use, rather than the URL that the tag is |
+ // being navigated to. |
awong
2012/11/02 21:56:13
Is this logic better here, or in a SiteInstance::C
nasko
2012/11/03 00:36:24
Since we use it only here, I'd rather not introduc
|
+ GURL guest_site( |
+ base::StringPrintf("%s://%s/%s?%s", chrome::kGuestScheme, |
+ host.c_str(), persist_storage ? "persist" : "", |
awong
2012/11/02 21:56:13
put persist into constant?
nasko
2012/11/03 00:36:24
If I put it into a constant, I have to do a lookup
|
+ url_encoded_partition.c_str())); |
+ SiteInstance* guest_site_instance = SiteInstance::CreateForURL( |
+ web_contents()->GetBrowserContext(), guest_site); |
+ |
guest_web_contents = WebContentsImpl::CreateGuest( |
web_contents()->GetBrowserContext(), |
- host, |
+ guest_site_instance, |
instance_id, |
focused, |
visible); |