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

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

Issue 160513002: Reports Prerender and Profile Total Bytes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 int frame_id, 338 int frame_id,
339 const GURL& url, 339 const GURL& url,
340 const GURL& frame_url, 340 const GURL& frame_url,
341 PrerenderContents::CookieEvent event, 341 PrerenderContents::CookieEvent event,
342 const net::CookieList* cookie_list); 342 const net::CookieList* cookie_list);
343 343
344 // Arranges for all session storage merges to hang indefinitely. This is used 344 // Arranges for all session storage merges to hang indefinitely. This is used
345 // to reliably test various swap abort cases. 345 // to reliably test various swap abort cases.
346 static void HangSessionStorageMergesForTesting(); 346 static void HangSessionStorageMergesForTesting();
347 347
348 // Notification that a prerender has completed and its bytes should be
349 // recorded.
350 void RecordBytes(bool used, int64 prerender_bytes);
351
352 // Add to the running tally of bytes transferred over the network for this
353 // profile if prerendering is currently enabled.
354 void AddProfileNetworkBytesIfEnabled(int64 bytes);
355
348 protected: 356 protected:
349 class PendingSwap; 357 class PendingSwap;
350 class PrerenderData : public base::SupportsWeakPtr<PrerenderData> { 358 class PrerenderData : public base::SupportsWeakPtr<PrerenderData> {
351 public: 359 public:
352 struct OrderByExpiryTime; 360 struct OrderByExpiryTime;
353 361
354 PrerenderData(PrerenderManager* manager, 362 PrerenderData(PrerenderManager* manager,
355 PrerenderContents* contents, 363 PrerenderContents* contents,
356 base::TimeTicks expiry_time); 364 base::TimeTicks expiry_time);
357 365
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 // browser data deletion. We do not use this for actual lookups, but only 694 // browser data deletion. We do not use this for actual lookups, but only
687 // to query cookie data for domains we know there was a login before. 695 // to query cookie data for domains we know there was a login before.
688 // This is required to avoid a large number of cookie lookups on bulk 696 // This is required to avoid a large number of cookie lookups on bulk
689 // deletion of cookies. 697 // deletion of cookies.
690 scoped_ptr<LoggedInStateMap> logged_in_state_; 698 scoped_ptr<LoggedInStateMap> logged_in_state_;
691 699
692 content::NotificationRegistrar notification_registrar_; 700 content::NotificationRegistrar notification_registrar_;
693 701
694 CancelableRequestConsumer query_url_consumer_; 702 CancelableRequestConsumer query_url_consumer_;
695 703
704 // The number of bytes transferred over the network for the profile this
705 // PrerenderManager is attached to.
706 int64 profile_network_bytes_;
707
696 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); 708 DISALLOW_COPY_AND_ASSIGN(PrerenderManager);
697 }; 709 };
698 710
699 } // namespace prerender 711 } // namespace prerender
700 712
701 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 713 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698