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 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_CONFIG_H_ 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_CONFIG_H_ 7 8 #include <string> 9 10 #include "base/time/time.h" 11 #include "ui/gfx/rect.h" 12 13 namespace prerender { 14 15 struct Config { 16 Config(); 17 ~Config(); 18 19 // Maximum memory use for a prerendered page until it is killed. 20 size_t max_bytes; 21 22 // Number of simultaneous prerender pages from link elements allowed. Enforced 23 // by PrerenderLinkManager. 24 size_t max_link_concurrency; 25 26 // Number of simultaneous prerender pages from link elements allowed per 27 // launching page. Enforced by PrerenderLinkManager. 28 size_t max_link_concurrency_per_launcher; 29 30 // Is rate limiting enabled? 31 bool rate_limit_enabled; 32 33 // The maximum time that a prerender can wait for launch in the 34 // PrerenderLinkManager. 35 base::TimeDelta max_wait_to_launch; 36 37 // The default time to live of a newly created prerender. May be shortened to 38 // abandon_time_to_live, below. 39 base::TimeDelta time_to_live; 40 41 // After a prerender has been abandoned by the user navigating away from the 42 // source page or otherwise mooting the launcher, how long until the prerender 43 // should be removed. This exists because a prerendered page is often 44 // navigated to through a chain of redirects; removing the prerender when the 45 // link element is removed because of navigation would destroy prerenders just 46 // before they were going to be used. 47 base::TimeDelta abandon_time_to_live; 48 49 // The default tab bounds used as the prerenderer tab size when the active tab 50 // cannot be accessed. 51 gfx::Rect default_tab_bounds; 52 53 // User agent being used as an override for the WebContents. 54 std::string user_agent_override; 55 56 // Is the user agent being overridden for this NavigationEntry? 57 bool is_overriding_user_agent; 58 }; 59 60 } // namespace prerender 61 62 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONFIG_H_ 63 64