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

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: Use FOR_EACH_TDI_MODE(V) macro. 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // This also applies in cases where the new URL will open in another process. 250 // This also applies in cases where the new URL will open in another process.
250 virtual bool ShouldAllowOpenURL(SiteInstance* site_instance, const GURL& url); 251 virtual bool ShouldAllowOpenURL(SiteInstance* site_instance, const GURL& url);
251 252
252 // Allows the embedder to override parameters when navigating. Called for both 253 // Allows the embedder to override parameters when navigating. Called for both
253 // opening new URLs and when transferring URLs across processes. 254 // opening new URLs and when transferring URLs across processes.
254 virtual void OverrideNavigationParams(SiteInstance* site_instance, 255 virtual void OverrideNavigationParams(SiteInstance* site_instance,
255 ui::PageTransition* transition, 256 ui::PageTransition* transition,
256 bool* is_renderer_initiated, 257 bool* is_renderer_initiated,
257 content::Referrer* referrer) {} 258 content::Referrer* referrer) {}
258 259
259 // Allows the embedder to override top document isolation for specific frames. 260 // Called in TopDocumentIsolation mode to let the embedder decide whether the
260 // |url| is the URL being loaded in the subframe, and |parent_site_instance| 261 // |frame| should be isolated from the main content (if the frame is navigated
261 // is the SiteInstance of the parent frame. Called only for subframes and only 262 // to |url| and the main content is in the |main_frame_site_instance|).
Charlie Reis 2017/06/30 23:28:47 Let's clarify that (1) the dest_url is already ass
Łukasz Anforowicz 2017/07/01 00:10:53 Correct. I've added this information to the comme
Charlie Reis 2017/07/06 20:02:29 Ok. My goal was to convey that a vanilla TDI mode
262 // when top document isolation mode is enabled. 263 virtual bool ShouldIsolateFrameFromMainContent(
Charlie Reis 2017/06/30 23:28:48 I'm finding it confusing that the name doesn't ref
Łukasz Anforowicz 2017/07/01 00:10:53 Good point. Done. (and thanks for suggesting the
263 virtual bool ShouldFrameShareParentSiteInstanceDespiteTopDocumentIsolation( 264 RenderFrameHost* frame,
264 const GURL& url, 265 const GURL& dest_url,
265 SiteInstance* parent_site_instance); 266 SiteInstance* main_frame_site_instance);
266 267
267 // Returns whether a new view for a given |site_url| can be launched in a 268 // Returns whether a new view for a given |site_url| can be launched in a
268 // given |process_host|. 269 // given |process_host|.
269 virtual bool IsSuitableHost(RenderProcessHost* process_host, 270 virtual bool IsSuitableHost(RenderProcessHost* process_host,
270 const GURL& site_url); 271 const GURL& site_url);
271 272
272 // Returns whether a new view for a new site instance can be added to a 273 // Returns whether a new view for a new site instance can be added to a
273 // given |process_host|. 274 // given |process_host|.
274 virtual bool MayReuseHost(RenderProcessHost* process_host); 275 virtual bool MayReuseHost(RenderProcessHost* process_host);
275 276
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 // Allows the embedder to register one or more URLLoaderThrottles for a 805 // Allows the embedder to register one or more URLLoaderThrottles for a
805 // URL request. This is used only when --enable-network-service is in effect. 806 // URL request. This is used only when --enable-network-service is in effect.
806 // This is called on the IO thread. 807 // This is called on the IO thread.
807 virtual std::vector<std::unique_ptr<URLLoaderThrottle>> 808 virtual std::vector<std::unique_ptr<URLLoaderThrottle>>
808 CreateURLLoaderThrottles(const base::Callback<WebContents*()>& wc_getter); 809 CreateURLLoaderThrottles(const base::Callback<WebContents*()>& wc_getter);
809 }; 810 };
810 811
811 } // namespace content 812 } // namespace content
812 813
813 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 814 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698