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

Side by Side Diff: chrome/browser/prerender/prerender_manager.h

Issue 1767243002: Update prerender policy for custom tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename with "cellular" and add explicit AddPrerender call Created 4 years, 9 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 CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 const GURL& url, 127 const GURL& url,
128 content::SessionStorageNamespace* session_storage_namespace, 128 content::SessionStorageNamespace* session_storage_namespace,
129 const gfx::Size& size); 129 const gfx::Size& size);
130 130
131 PrerenderHandle* AddPrerenderFromExternalRequest( 131 PrerenderHandle* AddPrerenderFromExternalRequest(
132 const GURL& url, 132 const GURL& url,
133 const content::Referrer& referrer, 133 const content::Referrer& referrer,
134 content::SessionStorageNamespace* session_storage_namespace, 134 content::SessionStorageNamespace* session_storage_namespace,
135 const gfx::Size& size); 135 const gfx::Size& size);
136 136
137 PrerenderHandle* AddPrerenderOnCellularFromExternalRequest(
mmenke 2016/03/15 14:34:21 Needs a comment explaining what it does
Yusuf 2016/03/20 06:48:29 Done.
138 const GURL& url,
139 const content::Referrer& referrer,
140 content::SessionStorageNamespace* session_storage_namespace,
141 const gfx::Size& size);
142
137 // Adds a prerender for Instant Search |url| if valid. The 143 // Adds a prerender for Instant Search |url| if valid. The
138 // |session_storage_namespace| matches the namespace of the active tab at the 144 // |session_storage_namespace| matches the namespace of the active tab at the
139 // time the prerender is generated. Returns a caller-owned PrerenderHandle* or 145 // time the prerender is generated. Returns a caller-owned PrerenderHandle* or
140 // NULL. 146 // NULL.
141 PrerenderHandle* AddPrerenderForInstant( 147 PrerenderHandle* AddPrerenderForInstant(
142 const GURL& url, 148 const GURL& url,
143 content::SessionStorageNamespace* session_storage_namespace, 149 content::SessionStorageNamespace* session_storage_namespace,
144 const gfx::Size& size); 150 const gfx::Size& size);
145 151
146 // Cancels all active prerenders. 152 // Cancels all active prerenders.
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 394
389 // Time window for which we record old navigations, in milliseconds. 395 // Time window for which we record old navigations, in milliseconds.
390 static const int kNavigationRecordWindowMs = 5000; 396 static const int kNavigationRecordWindowMs = 5000;
391 397
392 void OnCancelPrerenderHandle(PrerenderData* prerender_data); 398 void OnCancelPrerenderHandle(PrerenderData* prerender_data);
393 399
394 // Returns whether prerendering is currently enabled or the reason why it is 400 // Returns whether prerendering is currently enabled or the reason why it is
395 // disabled. 401 // disabled.
396 chrome_browser_net::NetworkPredictionStatus GetPredictionStatus() const; 402 chrome_browser_net::NetworkPredictionStatus GetPredictionStatus() const;
397 403
404 // Returns whether prerendering is currently enabled or the reason why it is
405 // disabled after taking into account the origin of the request.
406 chrome_browser_net::NetworkPredictionStatus GetPredictionStatusForOrigin(
407 Origin origin) const;
408
398 // Adds a prerender for |url| from |referrer|. The |origin| specifies how the 409 // Adds a prerender for |url| from |referrer|. The |origin| specifies how the
399 // prerender was added. If |size| is empty, then 410 // prerender was added. If |size| is empty, then
400 // PrerenderContents::StartPrerendering will instead use a default from 411 // PrerenderContents::StartPrerendering will instead use a default from
401 // PrerenderConfig. Returns a PrerenderHandle*, owned by the caller, or NULL. 412 // PrerenderConfig. Returns a PrerenderHandle*, owned by the caller, or NULL.
402 PrerenderHandle* AddPrerender( 413 PrerenderHandle* AddPrerender(
403 Origin origin, 414 Origin origin,
404 const GURL& url, 415 const GURL& url,
405 const content::Referrer& referrer, 416 const content::Referrer& referrer,
406 const gfx::Size& size, 417 const gfx::Size& size,
407 content::SessionStorageNamespace* session_storage_namespace); 418 content::SessionStorageNamespace* session_storage_namespace);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 // Set of process hosts being prerendered. 559 // Set of process hosts being prerendered.
549 typedef std::set<content::RenderProcessHost*> PrerenderProcessSet; 560 typedef std::set<content::RenderProcessHost*> PrerenderProcessSet;
550 PrerenderProcessSet prerender_process_hosts_; 561 PrerenderProcessSet prerender_process_hosts_;
551 562
552 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); 563 DISALLOW_COPY_AND_ASSIGN(PrerenderManager);
553 }; 564 };
554 565
555 } // namespace prerender 566 } // namespace prerender
556 567
557 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 568 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_histograms.cc ('k') | chrome/browser/prerender/prerender_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698