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

Side by Side Diff: content/browser/frame_host/navigation_entry_screenshot_manager.h

Issue 567943002: Refactoring the weak_ptr_factory order content/browser folder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolving swarming errors Created 6 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 bool ClearScreenshot(NavigationEntryImpl* entry); 67 bool ClearScreenshot(NavigationEntryImpl* entry);
68 68
69 // The screenshots in the NavigationEntryImpls can accumulate and consume a 69 // The screenshots in the NavigationEntryImpls can accumulate and consume a
70 // large amount of memory. This function makes sure that the memory 70 // large amount of memory. This function makes sure that the memory
71 // consumption is within a certain limit. 71 // consumption is within a certain limit.
72 void PurgeScreenshotsIfNecessary(); 72 void PurgeScreenshotsIfNecessary();
73 73
74 // The navigation controller that owns this screenshot-manager. 74 // The navigation controller that owns this screenshot-manager.
75 NavigationControllerImpl* owner_; 75 NavigationControllerImpl* owner_;
76 76
77 base::Time last_screenshot_time_;
78 int min_screenshot_interval_ms_;
79
77 // Taking a screenshot and encoding them can be async. So use a weakptr for 80 // Taking a screenshot and encoding them can be async. So use a weakptr for
78 // the callback to make sure that the screenshot/encoding completion callback 81 // the callback to make sure that the screenshot/encoding completion callback
79 // does not trigger on a destroyed NavigationEntryScreenshotManager. 82 // does not trigger on a destroyed NavigationEntryScreenshotManager.
80 base::WeakPtrFactory<NavigationEntryScreenshotManager> screenshot_factory_; 83 base::WeakPtrFactory<NavigationEntryScreenshotManager> screenshot_factory_;
81 84
82 base::Time last_screenshot_time_;
83 int min_screenshot_interval_ms_;
84
85 DISALLOW_COPY_AND_ASSIGN(NavigationEntryScreenshotManager); 85 DISALLOW_COPY_AND_ASSIGN(NavigationEntryScreenshotManager);
86 }; 86 };
87 87
88 } // namespace content 88 } // namespace content
89 89
90 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_ 90 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_SCREENSHOT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698