Index: chrome/browser/search/iframe_source.cc |
diff --git a/chrome/browser/search/iframe_source.cc b/chrome/browser/search/iframe_source.cc |
index 16d6c416ca5cd43b10b777e6b858f2a5f8885df8..285638569c19235779699764060f9e692651060d 100644 |
--- a/chrome/browser/search/iframe_source.cc |
+++ b/chrome/browser/search/iframe_source.cc |
@@ -9,7 +9,8 @@ |
#include "base/strings/string_util.h" |
#include "chrome/browser/search/instant_io_context.h" |
#include "chrome/common/url_constants.h" |
-#include "content/public/browser/render_view_host.h" |
+#include "content/public/browser/navigation_entry.h" |
+#include "content/public/browser/render_frame_host.h" |
#include "content/public/browser/web_contents.h" |
#include "grit/browser_resources.h" |
#include "net/url_request/url_request.h" |
@@ -51,17 +52,22 @@ bool IframeSource::ShouldDenyXFrameOptions() const { |
bool IframeSource::GetOrigin( |
int render_process_id, |
- int render_view_id, |
+ int render_frame_id, |
std::string* origin) const { |
- content::RenderViewHost* rvh = |
- content::RenderViewHost::FromID(render_process_id, render_view_id); |
- if (rvh == NULL) |
+ content::RenderFrameHost* rfh = |
+ content::RenderFrameHost::FromID(render_process_id, render_frame_id); |
+ if (rfh == NULL) |
return false; |
content::WebContents* contents = |
- content::WebContents::FromRenderViewHost(rvh); |
+ content::WebContents::FromRenderFrameHost(rfh); |
if (contents == NULL) |
return false; |
- *origin = contents->GetURL().GetOrigin().spec(); |
+ const content::NavigationEntry* entry = |
+ contents->GetController().GetVisibleEntry(); |
+ if (entry == NULL) |
+ return false; |
+ |
+ *origin = entry->GetURL().GetOrigin().spec(); |
// Origin should not include a trailing slash. That is part of the path. |
base::TrimString(*origin, "/", origin); |
return true; |
@@ -78,10 +84,10 @@ void IframeSource::SendResource( |
void IframeSource::SendJSWithOrigin( |
int resource_id, |
int render_process_id, |
- int render_view_id, |
+ int render_frame_id, |
const content::URLDataSource::GotDataCallback& callback) { |
std::string origin; |
- if (!GetOrigin(render_process_id, render_view_id, &origin)) { |
+ if (!GetOrigin(render_process_id, render_frame_id, &origin)) { |
callback.Run(NULL); |
return; |
} |