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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
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 CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 RenderFrameHostManager* GetRenderManager() const; 890 RenderFrameHostManager* GetRenderManager() const;
891 891
892 RenderViewHostImpl* GetRenderViewHostImpl(); 892 RenderViewHostImpl* GetRenderViewHostImpl();
893 893
894 // Removes browser plugin embedder if there is one. 894 // Removes browser plugin embedder if there is one.
895 void RemoveBrowserPluginEmbedder(); 895 void RemoveBrowserPluginEmbedder();
896 896
897 // Clear |render_frame_host|'s PowerSaveBlockers. 897 // Clear |render_frame_host|'s PowerSaveBlockers.
898 void ClearPowerSaveBlockers(RenderFrameHost* render_frame_host); 898 void ClearPowerSaveBlockers(RenderFrameHost* render_frame_host);
899 899
900 // Clear all PowerSaveBlockers, leave power_save_blocker_ empty. 900 // Clear all PowerSaveBlockers, leave |power_save_blocker_| empty.
901 void ClearAllPowerSaveBlockers(); 901 void ClearAllPowerSaveBlockers();
902 902
903 // Helper function to invoke WebContentsDelegate::GetSizeForNewRenderView(). 903 // Helper function to invoke WebContentsDelegate::GetSizeForNewRenderView().
904 gfx::Size GetSizeForNewRenderView(); 904 gfx::Size GetSizeForNewRenderView();
905 905
906 void OnFrameRemoved(RenderFrameHost* render_frame_host); 906 void OnFrameRemoved(RenderFrameHost* render_frame_host);
907 907
908 // Helper method that's called whenever |preferred_size_| or 908 // Helper method that's called whenever |preferred_size_| or
909 // |preferred_size_for_capture_| changes, to propagate the new value to the 909 // |preferred_size_for_capture_| changes, to propagate the new value to the
910 // |delegate_|. 910 // |delegate_|.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 // True if this tab was opened by another tab. This is not unset if the opener 957 // True if this tab was opened by another tab. This is not unset if the opener
958 // is closed. 958 // is closed.
959 bool created_with_opener_; 959 bool created_with_opener_;
960 960
961 #if defined(OS_WIN) 961 #if defined(OS_WIN)
962 gfx::NativeViewAccessible accessible_parent_; 962 gfx::NativeViewAccessible accessible_parent_;
963 #endif 963 #endif
964 964
965 // Helper classes ------------------------------------------------------------ 965 // Helper classes ------------------------------------------------------------
966 966
967 #if !defined(OS_CHROMEOS)
967 // Maps the RenderFrameHost to its media_player_cookie and PowerSaveBlocker 968 // Maps the RenderFrameHost to its media_player_cookie and PowerSaveBlocker
968 // pairs. Key is the RenderFrameHost, value is the map which maps 969 // pairs. Key is the RenderFrameHost, value is the map which maps
969 // player_cookie on to PowerSaveBlocker. 970 // player_cookie on to PowerSaveBlocker.
971 //
972 // ChromeOS does its own detection of audio and video.
970 typedef std::map<RenderFrameHost*, std::map<int64, PowerSaveBlocker*> > 973 typedef std::map<RenderFrameHost*, std::map<int64, PowerSaveBlocker*> >
971 PowerSaveBlockerMap; 974 PowerSaveBlockerMap;
972 PowerSaveBlockerMap power_save_blockers_; 975 PowerSaveBlockerMap power_save_blockers_;
976 #endif
973 977
974 // Manages the frame tree of the page and process swaps in each node. 978 // Manages the frame tree of the page and process swaps in each node.
975 FrameTree frame_tree_; 979 FrameTree frame_tree_;
976 980
977 // SavePackage, lazily created. 981 // SavePackage, lazily created.
978 scoped_refptr<SavePackage> save_package_; 982 scoped_refptr<SavePackage> save_package_;
979 983
980 // Data for loading state ---------------------------------------------------- 984 // Data for loading state ----------------------------------------------------
981 985
982 // Indicates whether we're currently loading a resource. 986 // Indicates whether we're currently loading a resource.
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 // The accessibility mode for all frames. This is queried when each frame 1190 // The accessibility mode for all frames. This is queried when each frame
1187 // is created, and broadcast to all frames when it changes. 1191 // is created, and broadcast to all frames when it changes.
1188 AccessibilityMode accessibility_mode_; 1192 AccessibilityMode accessibility_mode_;
1189 1193
1190 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); 1194 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl);
1191 }; 1195 };
1192 1196
1193 } // namespace content 1197 } // namespace content
1194 1198
1195 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1199 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | content/browser/web_contents/web_contents_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698