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

Unified Diff: media/blink/resource_multibuffer.cc

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.cc
diff --git a/media/blink/resource_multibuffer.cc b/media/blink/resource_multibuffer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e42320fb4683c615eadf02c99c8d5d8da895c832
--- /dev/null
+++ b/media/blink/resource_multibuffer.cc
@@ -0,0 +1,35 @@
+// 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.
+
+#include "media/blink/resource_multibuffer.h"
+
+#include "media/blink/resource_multibuffer_data_provider.h"
+
+namespace media {
+
+const int kBlockSizeShift = 15; // 1<<15 == 32kb
+
+ResourceMultiBuffer::ResourceMultiBuffer(blink::WebFrame* frame)
+ : MultiBuffer(kBlockSizeShift), frame_(frame) {}
+ResourceMultiBuffer::~ResourceMultiBuffer() {}
+
+MultiBuffer::DataProvider* ResourceMultiBuffer::CreateWriter(
+ const MultiBufferBlockId& pos) {
+ ResourceMultiBufferDataProvider* ret =
+ new ResourceMultiBufferDataProvider(pos, this);
+ ret->Start();
+ return ret;
+}
+
+void ResourceMultiBuffer::OnRedirect(const scoped_refptr<UrlData>& from,
+ const scoped_refptr<UrlData>& to) {
+ UpdateUrlData(from, to);
+}
+
+void ResourceMultiBuffer::Fail(const scoped_refptr<UrlData>& from) {
+ // Or possibly just register a failure in the urldata class?
+ UpdateUrlData(from, kUnknownUrlData);
+}
+
+} // namespace media

Powered by Google App Engine
This is Rietveld 408576698