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

Unified Diff: chrome/browser/search/search.cc

Issue 342323008: Discard ChromeViewHostMsg_SearchBox* IPCs if they not sent from an Instant process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added tests Created 6 years, 6 months 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/search/search.cc
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index f659cea157c139afea25f84c98e2dea825b2c3bb..58c376fe3f568b3cc408ad2f54cf655e30b20e91 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -198,22 +198,7 @@ bool MatchesAnySearchURL(const GURL& url,
return false;
}
-// Returns true if |contents| is rendered inside the Instant process for
-// |profile|.
-bool IsRenderedInInstantProcess(const content::WebContents* contents,
- Profile* profile) {
- const content::RenderProcessHost* process_host =
- contents->GetRenderProcessHost();
- if (!process_host)
- return false;
-
- const InstantService* instant_service =
- InstantServiceFactory::GetForProfile(profile);
- if (!instant_service)
- return false;
- return instant_service->IsInstantProcess(process_host->GetID());
-}
// |url| should either have a secure scheme or have a non-HTTPS base URL that
// the user specified using --google-base-url. (This allows testers to use
@@ -472,6 +457,21 @@ bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile) {
IsInstantURL(url, profile));
}
+bool IsRenderedInInstantProcess(const content::WebContents* contents,
+ Profile* profile) {
+ const content::RenderProcessHost* process_host =
+ contents->GetRenderProcessHost();
+ if (!process_host)
+ return false;
+
+ const InstantService* instant_service =
+ InstantServiceFactory::GetForProfile(profile);
+ if (!instant_service)
+ return false;
+
+ return instant_service->IsInstantProcess(process_host->GetID());
+}
+
bool ShouldUseProcessPerSiteForInstantURL(const GURL& url, Profile* profile) {
return ShouldAssignURLToInstantRenderer(url, profile) &&
(url.host() == chrome::kChromeSearchLocalNtpHost ||

Powered by Google App Engine
This is Rietveld 408576698