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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2374443003: Fix content settings's cookie code to work with PlzNavigate. (Closed)
Patch Set: review comments Created 4 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/content_settings/content_settings_usages_state_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 5a03ae340327b199b86239b4e4e323f9dcdfba88..8cb549fdf58f1c31a004ef8fe56721ffc602e9a6 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -778,6 +778,12 @@ class ClearSiteDataObserver : public BrowsingDataRemover::Observer {
int count_;
};
+WebContents* GetWebContents(int render_process_id, int render_frame_id) {
+ RenderFrameHost* rfh =
+ RenderFrameHost::FromID(render_process_id, render_frame_id);
+ return WebContents::FromRenderFrameHost(rfh);
+}
+
} // namespace
ChromeContentBrowserClient::ChromeContentBrowserClient()
@@ -1810,10 +1816,12 @@ bool ChromeContentBrowserClient::AllowGetCookie(
bool allow = io_data->GetCookieSettings()->
IsReadingCookieAllowed(url, first_party);
+ base::Callback<content::WebContents*(void)> wc_getter =
+ base::Bind(&GetWebContents, render_process_id, render_frame_id);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- base::Bind(&TabSpecificContentSettings::CookiesRead, render_process_id,
- render_frame_id, url, first_party, cookie_list, !allow));
+ base::Bind(&TabSpecificContentSettings::CookiesRead, wc_getter, url,
+ first_party, cookie_list, !allow));
return allow;
}
@@ -1831,11 +1839,12 @@ bool ChromeContentBrowserClient::AllowSetCookie(
io_data->GetCookieSettings();
bool allow = cookie_settings->IsSettingCookieAllowed(url, first_party);
+ base::Callback<content::WebContents*(void)> wc_getter =
+ base::Bind(&GetWebContents, render_process_id, render_frame_id);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- base::Bind(&TabSpecificContentSettings::CookieChanged, render_process_id,
- render_frame_id, url, first_party, cookie_line, options,
- !allow));
+ base::Bind(&TabSpecificContentSettings::CookieChanged, wc_getter, url,
+ first_party, cookie_line, options, !allow));
return allow;
}
« no previous file with comments | « no previous file | chrome/browser/content_settings/content_settings_usages_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698