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

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

Issue 9270018: Make a separate histogram for MatchComplete Final Status'es and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 #include <string> 10 #include <string>
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 // destroyed as well. 194 // destroyed as well.
195 // 195 //
196 // If the CLEAR_PRERENDER_HISTORY bit is set, the prerender history is 196 // If the CLEAR_PRERENDER_HISTORY bit is set, the prerender history is
197 // cleared, including any entries newly created by destroying them in 197 // cleared, including any entries newly created by destroying them in
198 // response to the CLEAR_PRERENDER_CONTENTS flag. 198 // response to the CLEAR_PRERENDER_CONTENTS flag.
199 // 199 //
200 // Intended to be used when clearing the cache or history. 200 // Intended to be used when clearing the cache or history.
201 void ClearData(int clear_flags); 201 void ClearData(int clear_flags);
202 202
203 // Record a final status of a prerendered page in a histogram. 203 // Record a final status of a prerendered page in a histogram.
204 void RecordFinalStatus(Origin origin, 204 void RecordFinalStatus(Origin origin,
dominich 2012/01/20 22:23:37 Does this need to be public or can it be removed i
205 uint8 experiment_id, 205 uint8 experiment_id,
206 FinalStatus final_status) const; 206 FinalStatus final_status) const;
207 207
208 // Record a final status of a prerendered page in a histogram.
209 // This variation allows specifying whether prerendering had been started
210 // (necessary to flag MatchComplete dummies).
211 void RecordFinalStatusWithMatchCompleteStatus(
212 Origin origin,
213 uint8 experiment_id,
214 PrerenderContents::MatchCompleteStatus mc_status,
215 FinalStatus final_status) const;
216
208 const Config& config() const { return config_; } 217 const Config& config() const { return config_; }
209 Config& mutable_config() { return config_; } 218 Config& mutable_config() { return config_; }
210 219
211 PrerenderTracker* prerender_tracker() { return prerender_tracker_; } 220 PrerenderTracker* prerender_tracker() { return prerender_tracker_; }
212 221
213 // Adds a condition. This is owned by the PrerenderManager. 222 // Adds a condition. This is owned by the PrerenderManager.
214 void AddCondition(const PrerenderCondition* condition); 223 void AddCondition(const PrerenderCondition* condition);
215 224
216 bool IsTopSite(const GURL& url); 225 bool IsTopSite(const GURL& url);
217 226
(...skipping 18 matching lines...) Expand all
236 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, ClearTest); 245 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, ClearTest);
237 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, ControlGroup); 246 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, ControlGroup);
238 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, DropOldestRequestTest); 247 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, DropOldestRequestTest);
239 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, DropSecondRequestTest); 248 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, DropSecondRequestTest);
240 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, ExpireTest); 249 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, ExpireTest);
241 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, FoundTest); 250 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, FoundTest);
242 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, FragmentMatchesFragmentTest); 251 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, FragmentMatchesFragmentTest);
243 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, FragmentMatchesPageTest); 252 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, FragmentMatchesPageTest);
244 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, PageMatchesFragmentTest); 253 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, PageMatchesFragmentTest);
245 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, PendingPrerenderTest); 254 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, PendingPrerenderTest);
255 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, ControlGroupVisited);
246 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, RateLimitInWindowTest); 256 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, RateLimitInWindowTest);
247 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, RateLimitOutsideWindowTest); 257 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, RateLimitOutsideWindowTest);
248 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, SourceRenderViewClosed); 258 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, SourceRenderViewClosed);
249 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, TwoElementPrerenderTest); 259 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, TwoElementPrerenderTest);
250 260
251 struct PrerenderContentsData; 261 struct PrerenderContentsData;
252 struct NavigationRecord; 262 struct NavigationRecord;
253 263
254 class OnCloseTabContentsDeleter; 264 class OnCloseTabContentsDeleter;
255 265
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 371
362 // Returns a new Value representing the pages currently being prerendered. The 372 // Returns a new Value representing the pages currently being prerendered. The
363 // caller is responsible for delete'ing the return value. 373 // caller is responsible for delete'ing the return value.
364 base::Value* GetActivePrerendersAsValue() const; 374 base::Value* GetActivePrerendersAsValue() const;
365 375
366 // Destroys all pending prerenders using FinalStatus. Also deletes them as 376 // Destroys all pending prerenders using FinalStatus. Also deletes them as
367 // well as any swapped out TabContents queued for destruction. 377 // well as any swapped out TabContents queued for destruction.
368 // Used both on destruction, and when clearing the browsing history. 378 // Used both on destruction, and when clearing the browsing history.
369 void DestroyAllContents(FinalStatus final_status); 379 void DestroyAllContents(FinalStatus final_status);
370 380
381 // Helper function to destory a PrerenderContents with the specified
dominich 2012/01/20 22:23:37 nit 'destroy'
tburkard 2012/01/20 23:23:00 Done.
382 // final_status, while at the same time recording that for the MatchComplete
383 // case, that this prerender would have been used.
384 void DestroyAndMarkMatchCompleteAsUsed(PrerenderContents* prerender_contents,
385 FinalStatus final_status);
386
371 // The configuration. 387 // The configuration.
372 Config config_; 388 Config config_;
373 389
374 // Specifies whether prerendering is currently enabled for this 390 // Specifies whether prerendering is currently enabled for this
375 // manager. The value can change dynamically during the lifetime 391 // manager. The value can change dynamically during the lifetime
376 // of the PrerenderManager. 392 // of the PrerenderManager.
377 bool enabled_; 393 bool enabled_;
378 394
379 // The profile that owns this PrerenderManager. 395 // The profile that owns this PrerenderManager.
380 Profile* profile_; 396 Profile* profile_;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 446
431 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); 447 DISALLOW_COPY_AND_ASSIGN(PrerenderManager);
432 }; 448 };
433 449
434 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( 450 PrerenderManager* FindPrerenderManagerUsingRenderProcessId(
435 int render_process_id); 451 int render_process_id);
436 452
437 } // namespace prerender 453 } // namespace prerender
438 454
439 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 455 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698