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

Unified Diff: media/blink/resource_multibuffer.h

Issue 1399603003: Tie multibuffers to URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media_cache
Patch Set: added MEDIA_BLINK_EXPORT Created 5 years, 2 months 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
Index: media/blink/resource_multibuffer.h
diff --git a/media/blink/resource_multibuffer.h b/media/blink/resource_multibuffer.h
new file mode 100644
index 0000000000000000000000000000000000000000..f2219f128acb8612d924f9996eaa446dbe7cca76
--- /dev/null
+++ b/media/blink/resource_multibuffer.h
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_BLINK_RESOURCE_MULTIBUFFER_H_
+#define MEDIA_BLINK_RESOURCE_MULTIBUFFER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "media/blink/media_blink_export.h"
+#include "media/blink/multibuffer.h"
+#include "media/blink/url_index.h"
+#include "third_party/WebKit/public/web/WebFrame.h"
+
+namespace media {
+class MediaLog;
+class ResourceMultiBufferDataProvider;
+
+// A multibuffer for loading media resources which knows
+// how to create MultibufferDataProviders to load data
+// into the cache.
+class MEDIA_BLINK_EXPORT ResourceMultiBuffer
+ : NON_EXPORTED_BASE(public MultiBuffer) {
+ public:
+ explicit ResourceMultiBuffer(blink::WebFrame* frame);
+ ~ResourceMultiBuffer() override;
+
+ // A redirect, fail or new urldata.
+ void OnRedirect(const scoped_refptr<UrlData>& from,
+ const scoped_refptr<UrlData>& to);
+ void Fail(const scoped_refptr<UrlData>& from);
+ UrlIndex* url_index() { return &url_index_; }
+ blink::WebFrame* frame() const { return frame_; }
+
+ protected:
+ MultiBuffer::DataProvider* CreateWriter(const BlockId& pos) override;
+
+ private:
+ friend class ResourceMultiBufferDataProvider;
liberato (no reviews please) 2015/11/05 19:03:18 why is this needed? didn't see anything other tha
hubbe 2015/11/13 22:56:52 Gone.
+ blink::WebFrame* frame_;
+ UrlIndex url_index_;
+};
+
+} // namespace media
+
+#endif // MEDIA_BLINK_RESOURCE_MULTIBUFFER_H_

Powered by Google App Engine
This is Rietveld 408576698