Chromium Code Reviews| Index: content/renderer/browser_plugin/browser_plugin.cc |
| diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc |
| index 1a81d23744cf750f0956a5aa3a9c32d961714010..572dd25a9f790d667edbf5747a1f2b5db7186f5b 100644 |
| --- a/content/renderer/browser_plugin/browser_plugin.cc |
| +++ b/content/renderer/browser_plugin/browser_plugin.cc |
| @@ -98,7 +98,21 @@ std::string BrowserPlugin::GetSrcAttribute() const { |
| void BrowserPlugin::SetSrcAttribute(const std::string& src) { |
| if (src == src_ && !guest_crashed_) |
| return; |
| - if (!src.empty() || navigate_src_sent_) { |
| + |
| + // If we haven't created the guest yet, do so now, if |src| is not empty and |
| + // we will navigate it right after creation. If |src| is empty, we can delay |
| + // the creation until we acutally need it. |
| + if (!navigate_src_sent_ && !src.empty()) { |
|
Fady Samuel
2012/09/25 19:22:40
You might need to update:
content/renderer/browse
nasko
2012/09/25 22:57:22
Done.
|
| + BrowserPluginManager::Get()->Send( |
| + new BrowserPluginHostMsg_CreateGuest( |
| + render_view_->GetRoutingID(), |
| + instance_id_, |
| + parent_frame_, |
| + storage_partition_id_, |
| + persist_storage_)); |
| + } |
| + |
| + if (navigate_src_sent_ || !src.empty()) { |
| BrowserPluginManager::Get()->Send( |
| new BrowserPluginHostMsg_NavigateGuest( |
| render_view_->GetRoutingID(), |