OLD | NEW |
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_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 virtual void SetWebUIProperty(const std::string& name, | 223 virtual void SetWebUIProperty(const std::string& name, |
224 const std::string& value) OVERRIDE; | 224 const std::string& value) OVERRIDE; |
225 virtual void Zoom(PageZoom zoom) OVERRIDE; | 225 virtual void Zoom(PageZoom zoom) OVERRIDE; |
226 virtual void SyncRendererPrefs() OVERRIDE; | 226 virtual void SyncRendererPrefs() OVERRIDE; |
227 virtual void ToggleSpeechInput() OVERRIDE; | 227 virtual void ToggleSpeechInput() OVERRIDE; |
228 virtual WebPreferences GetWebkitPreferences() OVERRIDE; | 228 virtual WebPreferences GetWebkitPreferences() OVERRIDE; |
229 virtual void UpdateWebkitPreferences( | 229 virtual void UpdateWebkitPreferences( |
230 const WebPreferences& prefs) OVERRIDE; | 230 const WebPreferences& prefs) OVERRIDE; |
231 virtual void GetAudioOutputControllers( | 231 virtual void GetAudioOutputControllers( |
232 const GetAudioOutputControllersCallback& callback) const OVERRIDE; | 232 const GetAudioOutputControllersCallback& callback) const OVERRIDE; |
| 233 virtual void CopyFromBackingStore( |
| 234 const gfx::Rect& src_rect, |
| 235 const gfx::Size& accelerated_dst_size, |
| 236 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 237 const SkBitmap::Config& bitmap_config) OVERRIDE; |
233 | 238 |
234 #if defined(OS_ANDROID) | 239 #if defined(OS_ANDROID) |
235 virtual void ActivateNearestFindResult(int request_id, | 240 virtual void ActivateNearestFindResult(int request_id, |
236 float x, | 241 float x, |
237 float y) OVERRIDE; | 242 float y) OVERRIDE; |
238 virtual void RequestFindMatchRects(int current_version) OVERRIDE; | 243 virtual void RequestFindMatchRects(int current_version) OVERRIDE; |
239 virtual void DisableFullscreenEncryptedMediaPlayback() OVERRIDE; | 244 virtual void DisableFullscreenEncryptedMediaPlayback() OVERRIDE; |
240 #endif | 245 #endif |
241 | 246 |
242 #if defined(USE_MOJO) | 247 #if defined(USE_MOJO) |
243 virtual void SetWebUIHandle(mojo::ScopedMessagePipeHandle handle) OVERRIDE; | 248 virtual void SetWebUIHandle(mojo::ScopedMessagePipeHandle handle) OVERRIDE; |
244 #endif | 249 #endif |
245 | 250 |
| 251 void CopyFromBackingStoreCallback( |
| 252 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 253 bool success, |
| 254 const SkBitmap& bitmap); |
| 255 |
246 void set_delegate(RenderViewHostDelegate* d) { | 256 void set_delegate(RenderViewHostDelegate* d) { |
247 CHECK(d); // http://crbug.com/82827 | 257 CHECK(d); // http://crbug.com/82827 |
248 delegate_ = d; | 258 delegate_ = d; |
249 } | 259 } |
250 | 260 |
251 // Set up the RenderView child process. Virtual because it is overridden by | 261 // Set up the RenderView child process. Virtual because it is overridden by |
252 // TestRenderViewHost. If the |frame_name| parameter is non-empty, it is used | 262 // TestRenderViewHost. If the |frame_name| parameter is non-empty, it is used |
253 // as the name of the new top-level frame. | 263 // as the name of the new top-level frame. |
254 // The |opener_route_id| parameter indicates which RenderView created this | 264 // The |opener_route_id| parameter indicates which RenderView created this |
255 // (MSG_ROUTING_NONE if none). If |max_page_id| is larger than -1, the | 265 // (MSG_ROUTING_NONE if none). If |max_page_id| is larger than -1, the |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 // Manages all the android mediaplayer objects and handling IPCs for video. | 723 // Manages all the android mediaplayer objects and handling IPCs for video. |
714 scoped_ptr<BrowserMediaPlayerManager> media_player_manager_; | 724 scoped_ptr<BrowserMediaPlayerManager> media_player_manager_; |
715 #endif | 725 #endif |
716 | 726 |
717 // Used to swap out or shutdown this RVH when the unload event is taking too | 727 // Used to swap out or shutdown this RVH when the unload event is taking too |
718 // long to execute, depending on the number of active views in the | 728 // long to execute, depending on the number of active views in the |
719 // SiteInstance. | 729 // SiteInstance. |
720 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. | 730 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. |
721 scoped_ptr<TimeoutMonitor> unload_event_monitor_timeout_; | 731 scoped_ptr<TimeoutMonitor> unload_event_monitor_timeout_; |
722 | 732 |
723 // Called after receiving the SwapOutACK when the RVH is in state pending | 733 // Called after receiving the SwapOutACK and completing outstanding copy |
724 // shutdown. Also called if the unload timer times out. | 734 // requests when the RVH is in state pending shutdown. Also called if the |
| 735 // unload timer times out. |
725 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. | 736 // TODO(nasko): Move to RenderFrameHost, as this is per-frame state. |
726 base::Closure pending_shutdown_on_swap_out_; | 737 base::Closure pending_shutdown_on_swap_out_; |
727 | 738 |
| 739 // Set to true if pending_shutdown_on_swap_out_ is not invoked upon receiving |
| 740 // the SwapOutACK because of outstanding copy requests. In this case |
| 741 // pending_shutdown_on_swap_out_ gets called when the copy requests complete. |
| 742 bool pending_shutdown_on_copy_requests_done_; |
| 743 |
| 744 // Stores the number of the outstanding copy requests (see |
| 745 // CopyFromBackingStore()). If the host gets swapped out with outstanding copy |
| 746 // requests, we delay its shutdown until the copy requests complete. |
| 747 int copy_requests_; |
| 748 |
728 base::WeakPtrFactory<RenderViewHostImpl> weak_factory_; | 749 base::WeakPtrFactory<RenderViewHostImpl> weak_factory_; |
729 | 750 |
730 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); | 751 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImpl); |
731 }; | 752 }; |
732 | 753 |
733 #if defined(COMPILER_MSVC) | 754 #if defined(COMPILER_MSVC) |
734 #pragma warning(pop) | 755 #pragma warning(pop) |
735 #endif | 756 #endif |
736 | 757 |
737 } // namespace content | 758 } // namespace content |
738 | 759 |
739 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ | 760 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_IMPL_H_ |
OLD | NEW |