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

Unified Diff: content/browser/web_contents/web_contents_impl.h

Issue 425713003: Fix a PowerSaveBlocker leak in WebContentsImpl. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.h
===================================================================
--- content/browser/web_contents/web_contents_impl.h (revision 288099)
+++ content/browser/web_contents/web_contents_impl.h (working copy)
@@ -10,6 +10,7 @@
#include <string>
#include "base/compiler_specific.h"
+#include "base/containers/scoped_ptr_hash_map.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
@@ -899,7 +900,7 @@
// Clear |render_frame_host|'s PowerSaveBlockers.
void ClearPowerSaveBlockers(RenderFrameHost* render_frame_host);
- // Clear all PowerSaveBlockers, leave power_save_blocker_ empty.
+ // Clear all PowerSaveBlockers, leave |power_save_blocker_| empty.
void ClearAllPowerSaveBlockers();
// Helper function to invoke WebContentsDelegate::GetSizeForNewRenderView().
@@ -966,12 +967,18 @@
// Helper classes ------------------------------------------------------------
+#if !defined(OS_CHROMEOS)
// Maps the RenderFrameHost to its media_player_cookie and PowerSaveBlocker
// pairs. Key is the RenderFrameHost, value is the map which maps
// player_cookie on to PowerSaveBlocker.
- typedef std::map<RenderFrameHost*, std::map<int64, PowerSaveBlocker*> >
+ //
+ // ChromeOS does its own detection of audio and video.
+ typedef base::ScopedPtrHashMap<int64, PowerSaveBlocker>
+ PowerSaveBlockerMapEntry;
+ typedef base::ScopedPtrHashMap<uintptr_t, PowerSaveBlockerMapEntry>
Avi (use Gerrit) 2014/08/07 19:36:33 Why uintptr_t and not RenderFrameHost*?
PowerSaveBlockerMap;
PowerSaveBlockerMap power_save_blockers_;
+#endif
// Manages the frame tree of the page and process swaps in each node.
FrameTree frame_tree_;
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698