OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_RENDERER_PRERENDER_PRERENDER_WEBMEDIAPLAYER_H_ | |
6 #define CHROME_RENDERER_PRERENDER_PRERENDER_WEBMEDIAPLAYER_H_ | |
7 #pragma once | |
8 | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/memory/weak_ptr.h" | |
11 #include "content/public/renderer/render_view_observer.h" | |
12 #include "webkit/glue/webmediaplayer_impl.h" | |
13 | |
14 namespace webkit_glue { | |
15 class MediaStreamClient; | |
16 class WebMediaPlayerDelegate; | |
17 } | |
18 | |
19 namespace prerender { | |
20 | |
21 // Substitute for WebMediaPlayerImpl to be used in prerendered pages. Defers | |
22 // the loading of the media till the prerendered page is swapped in. | |
23 class PrerenderWebMediaPlayer | |
24 : public content::RenderViewObserver, | |
25 public webkit_glue::WebMediaPlayerImpl { | |
26 public: | |
27 PrerenderWebMediaPlayer( | |
28 content::RenderView* render_view, | |
29 WebKit::WebMediaPlayerClient* client, | |
30 base::WeakPtr<webkit_glue::WebMediaPlayerDelegate> delegate, | |
31 media::FilterCollection* collection, | |
32 media::MessageLoopFactory* message_loop_factory, | |
33 webkit_glue::MediaStreamClient* media_stream_client, | |
34 media::MediaLog* media_log); | |
35 virtual ~PrerenderWebMediaPlayer(); | |
36 | |
37 // WebMediaPlayer methods: | |
38 virtual void load(const WebKit::WebURL& url) OVERRIDE; | |
39 virtual void cancelLoad() OVERRIDE; | |
40 | |
41 private: | |
42 // RenderViewObserver method: | |
43 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
44 | |
45 virtual void OnSetIsPrerendering(bool is_prerendering); | |
dominich
2011/11/14 19:40:35
why is this virtual if it's not an OVERRIDE?
Shishir
2011/11/14 19:51:53
Done.
| |
46 | |
47 bool is_prerendering_; | |
48 scoped_ptr<WebKit::WebURL> url_to_load_; | |
dominich
2011/11/14 19:40:35
Consider storing a WebKit::WebURL instead of as a
Shishir
2011/11/14 19:51:53
Its cleaner to create this on load and destroy on
| |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(PrerenderWebMediaPlayer); | |
51 }; | |
52 | |
53 } // namespace prerender | |
54 | |
55 #endif // CHROME_RENDERER_PRERENDER_PRERENDER_WEBMEDIAPLAYER_H_ | |
OLD | NEW |