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

Unified Diff: components/previews/core/previews_decider.h

Issue 2760063002: Add support to previews/ for Server LoFi and LitePages (Closed)
Patch Set: tbansal comments Created 3 years, 7 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 | « components/previews/core/previews_black_list.cc ('k') | components/previews/core/previews_experiments.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/previews/core/previews_decider.h
diff --git a/components/previews/core/previews_decider.h b/components/previews/core/previews_decider.h
index f293c87c1ad0f621e85cf0756f6872cf0c2f6c60..11c0d3d4fd39af8a1c8d3fb3b855aa0eff636941 100644
--- a/components/previews/core/previews_decider.h
+++ b/components/previews/core/previews_decider.h
@@ -7,6 +7,8 @@
#include "components/previews/core/previews_experiments.h"
+#include "net/nqe/effective_connection_type.h"
+
namespace net {
class URLRequest;
}
@@ -15,7 +17,21 @@ namespace previews {
class PreviewsDecider {
public:
- // Whether |request| is allowed to show a preview of |type|.
+ // Whether |request| is allowed to show a preview of |type|. Previews that do
+ // not supply a network quality in
+ // GetEffectiveConnectionTypeThresholdForPreviewsType() should check the
+ // network quality before calling ShouldAllowPreview. |request| is the main
tbansal1 2017/05/05 21:31:31 s/ShouldAllowPreview/ShouldAllowPreviewAtECT/
RyanSturm 2017/05/05 21:39:02 Done.
+ // frame request of the page load. |type| is the type that would be allowed.
+ // If the current ECT better than |effective_connection_type_threshold|, the
tbansal1 2017/05/05 21:31:31 s/better/strictly faster/ OR s/better/at least as
RyanSturm 2017/05/05 21:39:02 Done.
+ // preview will be disallowed.
+ virtual bool ShouldAllowPreviewAtECT(
+ const net::URLRequest& request,
+ PreviewsType type,
+ net::EffectiveConnectionType effective_connection_type_threshold)
+ const = 0;
+
+ // Same as ShouldAllowPreviewAtECT, but uses the previews default
+ // EffectiveConnectionType.
virtual bool ShouldAllowPreview(const net::URLRequest& request,
PreviewsType type) const = 0;
« no previous file with comments | « components/previews/core/previews_black_list.cc ('k') | components/previews/core/previews_experiments.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698