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

Unified Diff: content/child/webblobregistry_impl.h

Issue 821913004: [Storage] Consoliation of BlobItems with small size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for clearing buffer Created 5 years, 11 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
« no previous file with comments | « no previous file | content/child/webblobregistry_impl.cc » ('j') | content/child/webblobregistry_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webblobregistry_impl.h
diff --git a/content/child/webblobregistry_impl.h b/content/child/webblobregistry_impl.h
index e438baa2bdf96256a8f96e990d0207402d1ec33a..be85d7988997413b4fc0e056e51bd23f9ef334d8 100644
--- a/content/child/webblobregistry_impl.h
+++ b/content/child/webblobregistry_impl.h
@@ -6,6 +6,7 @@
#define CONTENT_CHILD_WEBBLOBREGISTRY_IMPL_H_
#include <string>
+#include <vector>
#include "base/memory/ref_counted.h"
#include "third_party/WebKit/public/platform/WebBlobRegistry.h"
@@ -43,8 +44,19 @@ class WebBlobRegistryImpl : public blink::WebBlobRegistry {
virtual void unregisterStreamURL(const blink::WebURL& url);
private:
- void SendDataForBlob(const std::string& uuid_str,
- const blink::WebThreadSafeData& data);
+ // Sends the data in the buffer as a blob item, then resets the buffer size.
+ void SendAndClearConsolidatingBuffer(
+ const std::string& uuid_str,
+ std::vector<char>* consolidating_buffer,
+ size_t* consolidating_items_size_bytes) const;
+ // Adds the item to the consolidating buffer. We assume that the buffer can
+ // hold the new item, caller should check this beforehand.
+ void AddItemToBuffer(const blink::WebThreadSafeData& data,
+ std::vector<char>* consolidating_buffer,
+ size_t* consolidating_items_size_bytes) const;
+ // Sends data that is larger than the threshold.
+ void SendOversizedDataForBlob(const std::string& uuid_str,
+ const blink::WebThreadSafeData& data);
scoped_refptr<ThreadSafeSender> sender_;
};
« no previous file with comments | « no previous file | content/child/webblobregistry_impl.cc » ('j') | content/child/webblobregistry_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698