summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_view.cc
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 17:45:51 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 17:45:51 +0000
commit8380c0910bfff5ee0af6b37536cd815023d055ef (patch)
treee8a4850c7aa9738f1fc3706cdbcd32efd6f77b6e /chrome/renderer/render_view.cc
parent5de4b03e3bcd97feae59de8828704088f97c5705 (diff)
downloadchromium_src-8380c0910bfff5ee0af6b37536cd815023d055ef.zip
chromium_src-8380c0910bfff5ee0af6b37536cd815023d055ef.tar.gz
chromium_src-8380c0910bfff5ee0af6b37536cd815023d055ef.tar.bz2
Refactorying to create the ResourceLoaderBridge through a factory class for <video>
Extract the code to create a ResourceLoaderBridge to a factory class to enable testing on the data source filters. Review URL: http://codereview.chromium.org/146007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19262 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_view.cc')
-rw-r--r--chrome/renderer/render_view.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index e2db735..f6cc47c 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -18,6 +18,7 @@
#include "base/field_trial.h"
#include "base/gfx/png_encoder.h"
#include "base/gfx/native_widget_types.h"
+#include "base/process_util.h"
#include "base/string_piece.h"
#include "base/string_util.h"
#include "build/build_config.h"
@@ -69,6 +70,7 @@
#include "webkit/glue/dom_operations.h"
#include "webkit/glue/dom_serializer.h"
#include "webkit/glue/image_decoder.h"
+#include "webkit/glue/media/simple_data_source.h"
#include "webkit/glue/password_form.h"
#include "webkit/glue/plugins/plugin_list.h"
#include "webkit/glue/searchable_form_data.h"
@@ -1763,11 +1765,26 @@ WebKit::WebMediaPlayer* RenderView::CreateWebMediaPlayer(
factory->AddFactory(
AudioRendererImpl::CreateFactory(audio_message_filter()));
}
+
+ // TODO(hclam): obtain the following parameters from |client|.
+ webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory =
+ new webkit_glue::MediaResourceLoaderBridgeFactory(
+ GURL::EmptyGURL(), // referrer
+ "null", // frame origin
+ "null", // main_frame_origin
+ base::GetCurrentProcId(),
+ WebAppCacheContext::kNoAppCacheContextId,
+ routing_id());
+
if (!cmd_line->HasSwitch(switches::kSimpleDataSource)) {
// Add the chrome specific media data source.
factory->AddFactory(
BufferedDataSource::CreateFactory(MessageLoop::current(),
- routing_id()));
+ bridge_factory));
+ } else {
+ factory->AddFactory(
+ webkit_glue::SimpleDataSource::CreateFactory(MessageLoop::current(),
+ bridge_factory));
}
return new webkit_glue::WebMediaPlayerImpl(client, factory);
}