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

Side by Side Diff: content/public/browser/content_browser_client.h

Issue 2946113002: Use FrameIsAd to decide whether to isolate a frame in TopDocumentIsolation mode. (Closed)
Patch Set: Addressing CR feedback from jkarlin@ and creis@. Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <set>
12 #include <string> 13 #include <string>
13 #include <utility> 14 #include <utility>
14 #include <vector> 15 #include <vector>
15 16
16 #include "base/callback.h" 17 #include "base/callback.h"
17 #include "base/task_scheduler/task_scheduler.h" 18 #include "base/task_scheduler/task_scheduler.h"
18 #include "base/values.h" 19 #include "base/values.h"
19 #include "build/build_config.h" 20 #include "build/build_config.h"
20 #include "content/public/browser/certificate_request_result_type.h" 21 #include "content/public/browser/certificate_request_result_type.h"
21 #include "content/public/browser/navigation_throttle.h" 22 #include "content/public/browser/navigation_throttle.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // This also applies in cases where the new URL will open in another process. 255 // This also applies in cases where the new URL will open in another process.
255 virtual bool ShouldAllowOpenURL(SiteInstance* site_instance, const GURL& url); 256 virtual bool ShouldAllowOpenURL(SiteInstance* site_instance, const GURL& url);
256 257
257 // Allows the embedder to override parameters when navigating. Called for both 258 // Allows the embedder to override parameters when navigating. Called for both
258 // opening new URLs and when transferring URLs across processes. 259 // opening new URLs and when transferring URLs across processes.
259 virtual void OverrideNavigationParams(SiteInstance* site_instance, 260 virtual void OverrideNavigationParams(SiteInstance* site_instance,
260 ui::PageTransition* transition, 261 ui::PageTransition* transition,
261 bool* is_renderer_initiated, 262 bool* is_renderer_initiated,
262 content::Referrer* referrer) {} 263 content::Referrer* referrer) {}
263 264
264 // Allows the embedder to override top document isolation for specific frames. 265 // Called in TopDocumentIsolation mode to let the embedder decide whether the
265 // |url| is the URL being loaded in the subframe, and |parent_site_instance| 266 // subframe navigation tracked by |navigation_handle| should end up isolated
266 // is the SiteInstance of the parent frame. Called only for subframes and only 267 // from the main content.
267 // when top document isolation mode is enabled. 268 //
268 virtual bool ShouldFrameShareParentSiteInstanceDespiteTopDocumentIsolation( 269 // The subframe navigation in question is always to a URL that is cross-site
269 const GURL& url, 270 // from the top-level frame. |main_frame_site_instance| is the SiteInstance
270 SiteInstance* parent_site_instance); 271 // of the top-level frame.
272 virtual bool ShouldIsolateFrameForTopDocumentIsolation(
273 NavigationHandle* navigation_handle,
274 SiteInstance* main_frame_site_instance);
271 275
272 // Returns whether a new view for a given |site_url| can be launched in a 276 // Returns whether a new view for a given |site_url| can be launched in a
273 // given |process_host|. 277 // given |process_host|.
274 virtual bool IsSuitableHost(RenderProcessHost* process_host, 278 virtual bool IsSuitableHost(RenderProcessHost* process_host,
275 const GURL& site_url); 279 const GURL& site_url);
276 280
277 // Returns whether a new view for a new site instance can be added to a 281 // Returns whether a new view for a new site instance can be added to a
278 // given |process_host|. 282 // given |process_host|.
279 virtual bool MayReuseHost(RenderProcessHost* process_host); 283 virtual bool MayReuseHost(RenderProcessHost* process_host);
280 284
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 // Allows the embedder to register one or more URLLoaderThrottles for a 827 // Allows the embedder to register one or more URLLoaderThrottles for a
824 // URL request. This is used only when --enable-network-service is in effect. 828 // URL request. This is used only when --enable-network-service is in effect.
825 // This is called on the IO thread. 829 // This is called on the IO thread.
826 virtual std::vector<std::unique_ptr<URLLoaderThrottle>> 830 virtual std::vector<std::unique_ptr<URLLoaderThrottle>>
827 CreateURLLoaderThrottles(const base::Callback<WebContents*()>& wc_getter); 831 CreateURLLoaderThrottles(const base::Callback<WebContents*()>& wc_getter);
828 }; 832 };
829 833
830 } // namespace content 834 } // namespace content
831 835
832 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 836 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
OLDNEW
« no previous file with comments | « content/browser/top_document_isolation_browsertest.cc ('k') | content/public/browser/content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698