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

Unified Diff: webkit/glue/media/simple_data_source.h

Issue 5619002: Revert 68094 - Refactoring BufferedDataSource to work with WebURLLoader inste... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/media/buffered_data_source_unittest.cc ('k') | webkit/glue/media/simple_data_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/media/simple_data_source.h
===================================================================
--- webkit/glue/media/simple_data_source.h (revision 68125)
+++ webkit/glue/media/simple_data_source.h (working copy)
@@ -10,17 +10,10 @@
#ifndef WEBKIT_GLUE_MEDIA_SIMPLE_DATA_SOURCE_H_
#define WEBKIT_GLUE_MEDIA_SIMPLE_DATA_SOURCE_H_
-#include <algorithm>
-#include <string>
-
#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "media/base/filters.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebURLLoader.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h"
+#include "webkit/glue/media/media_resource_loader_bridge_factory.h"
#include "webkit/glue/media/web_data_source.h"
class MessageLoop;
@@ -29,9 +22,11 @@
namespace webkit_glue {
class SimpleDataSource : public WebDataSource,
- public WebKit::WebURLLoaderClient {
+ public webkit_glue::ResourceLoaderBridge::Peer {
public:
- SimpleDataSource(MessageLoop* render_loop, WebKit::WebFrame* frame);
+ SimpleDataSource(
+ MessageLoop* render_loop,
+ webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory);
virtual ~SimpleDataSource();
// media::Filter implementation.
@@ -46,38 +41,22 @@
virtual bool GetSize(int64* size_out);
virtual bool IsStreaming();
- // Used to inject a mock used for unittests.
- virtual void SetURLLoaderForTest(WebKit::WebURLLoader* mock_loader);
+ // webkit_glue::ResourceLoaderBridge::Peer implementation.
+ virtual void OnUploadProgress(uint64 position, uint64 size) {}
+ virtual bool OnReceivedRedirect(
+ const GURL& new_url,
+ const webkit_glue::ResourceResponseInfo& info,
+ bool* has_new_first_party_for_cookies,
+ GURL* new_first_party_for_cookies);
+ virtual void OnReceivedResponse(
+ const webkit_glue::ResourceResponseInfo& info,
+ bool content_filtered);
+ virtual void OnDownloadedData(int len) {}
+ virtual void OnReceivedData(const char* data, int len);
+ virtual void OnCompletedRequest(const URLRequestStatus& status,
+ const std::string& security_info,
+ const base::Time& completion_time);
- // WebKit::WebURLLoaderClient implementations.
- virtual void willSendRequest(
- WebKit::WebURLLoader* loader,
- WebKit::WebURLRequest& newRequest,
- const WebKit::WebURLResponse& redirectResponse);
- virtual void didSendData(
- WebKit::WebURLLoader* loader,
- unsigned long long bytesSent,
- unsigned long long totalBytesToBeSent);
- virtual void didReceiveResponse(
- WebKit::WebURLLoader* loader,
- const WebKit::WebURLResponse& response);
- virtual void didDownloadData(
- WebKit::WebURLLoader* loader,
- int dataLength);
- virtual void didReceiveData(
- WebKit::WebURLLoader* loader,
- const char* data,
- int dataLength);
- virtual void didReceiveCachedMetadata(
- WebKit::WebURLLoader* loader,
- const char* data, int dataLength);
- virtual void didFinishLoading(
- WebKit::WebURLLoader* loader,
- double finishTime);
- virtual void didFail(
- WebKit::WebURLLoader* loader,
- const WebKit::WebURLError&);
-
// webkit_glue::WebDataSource implementation.
virtual bool HasSingleOrigin();
virtual void Abort();
@@ -98,11 +77,11 @@
// Primarily used for asserting the bridge is loading on the render thread.
MessageLoop* render_loop_;
- // A webframe for loading.
- WebKit::WebFrame* frame_;
+ // Factory to create a bridge.
+ scoped_ptr<webkit_glue::MediaResourceLoaderBridgeFactory> bridge_factory_;
- // Does the work of loading and sends data back to this client.
- scoped_ptr<WebKit::WebURLLoader> url_loader_;
+ // Bridge used to load the media resource.
+ scoped_ptr<webkit_glue::ResourceLoaderBridge> bridge_;
media::MediaFormat media_format_;
GURL url_;
@@ -125,9 +104,6 @@
// Filter callbacks.
scoped_ptr<media::FilterCallback> initialize_callback_;
- // Used to ensure mocks for unittests are used instead of reset in Start().
- bool keep_test_loader_;
-
DISALLOW_COPY_AND_ASSIGN(SimpleDataSource);
};
« no previous file with comments | « webkit/glue/media/buffered_data_source_unittest.cc ('k') | webkit/glue/media/simple_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698