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

Side by Side Diff: webkit/tools/test_shell/test_webview_delegate.cc

Issue 3863002: Refactoring BufferedDataSource to work with WebURLLoader instead of a MediaResourceLoaderBridge. (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: Removed unnecessary WebURLLoaders in the two unittests because windows compilation complains. Created 10 years, 1 month 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This file contains the implementation of TestWebViewDelegate, which serves 5 // This file contains the implementation of TestWebViewDelegate, which serves
6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to
7 // have initialized a MessageLoop before these methods are called. 7 // have initialized a MessageLoop before these methods are called.
8 8
9 #include "webkit/tools/test_shell/test_webview_delegate.h" 9 #include "webkit/tools/test_shell/test_webview_delegate.h"
10 10
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 719
720 WebWorker* TestWebViewDelegate::createWorker( 720 WebWorker* TestWebViewDelegate::createWorker(
721 WebFrame* frame, WebWorkerClient* client) { 721 WebFrame* frame, WebWorkerClient* client) {
722 return new TestWebWorker(); 722 return new TestWebWorker();
723 } 723 }
724 724
725 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( 725 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer(
726 WebFrame* frame, WebMediaPlayerClient* client) { 726 WebFrame* frame, WebMediaPlayerClient* client) {
727 scoped_ptr<media::MediaFilterCollection> collection( 727 scoped_ptr<media::MediaFilterCollection> collection(
728 new media::MediaFilterCollection()); 728 new media::MediaFilterCollection());
729 729 /*
Alpha Left Google 2010/11/19 22:53:42 add michaeln to look at this code
730 appcache::WebApplicationCacheHostImpl* appcache_host = 730 appcache::WebApplicationCacheHostImpl* appcache_host =
731 appcache::WebApplicationCacheHostImpl::FromFrame(frame); 731 appcache::WebApplicationCacheHostImpl::FromFrame(frame);
732 732 */
733 // TODO(hclam): this is the same piece of code as in RenderView, maybe they
734 // should be grouped together.
735 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_simple =
736 new webkit_glue::MediaResourceLoaderBridgeFactory(
737 GURL(frame->url()), // referrer
738 "null", // frame origin
739 "null", // main_frame_origin
740 base::GetCurrentProcId(),
741 appcache_host ? appcache_host->host_id() : appcache::kNoHostId,
742 0);
743 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_buffered =
744 new webkit_glue::MediaResourceLoaderBridgeFactory(
745 GURL(frame->url()), // referrer
746 "null", // frame origin
747 "null", // main_frame_origin
748 base::GetCurrentProcId(),
749 appcache_host ? appcache_host->host_id() : appcache::kNoHostId,
750 0);
751
752 scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer( 733 scoped_refptr<webkit_glue::VideoRendererImpl> video_renderer(
753 new webkit_glue::VideoRendererImpl(false)); 734 new webkit_glue::VideoRendererImpl(false));
754 collection->AddVideoRenderer(video_renderer); 735 collection->AddVideoRenderer(video_renderer);
755 736
756 return new webkit_glue::WebMediaPlayerImpl( 737 return new webkit_glue::WebMediaPlayerImpl(
757 client, collection.release(), bridge_factory_simple, 738 client, collection.release(), frame,
758 bridge_factory_buffered, false, video_renderer); 739 false, video_renderer);
759 } 740 }
760 741
761 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost( 742 WebApplicationCacheHost* TestWebViewDelegate::createApplicationCacheHost(
762 WebFrame* frame, WebApplicationCacheHostClient* client) { 743 WebFrame* frame, WebApplicationCacheHostClient* client) {
763 return SimpleAppCacheSystem::CreateApplicationCacheHost(client); 744 return SimpleAppCacheSystem::CreateApplicationCacheHost(client);
764 } 745 }
765 746
766 bool TestWebViewDelegate::allowPlugins(WebFrame* frame, 747 bool TestWebViewDelegate::allowPlugins(WebFrame* frame,
767 bool enabled_per_settings) { 748 bool enabled_per_settings) {
768 return enabled_per_settings && shell_->allow_plugins(); 749 return enabled_per_settings && shell_->allow_plugins();
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 } 1336 }
1356 1337
1357 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { 1338 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) {
1358 fake_rect_ = rect; 1339 fake_rect_ = rect;
1359 using_fake_rect_ = true; 1340 using_fake_rect_ = true;
1360 } 1341 }
1361 1342
1362 WebRect TestWebViewDelegate::fake_window_rect() { 1343 WebRect TestWebViewDelegate::fake_window_rect() {
1363 return fake_rect_; 1344 return fake_rect_;
1364 } 1345 }
OLDNEW
« webkit/tools/test_shell/test_shell.gypi ('K') | « webkit/tools/test_shell/test_shell.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698