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

Unified Diff: content/browser/renderer_host/websocket_dispatcher_host.h

Issue 1568523002: Implement content::WebSocketBlobSender (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@websocket_blob_send_ipcs
Patch Set: Rebase. Created 4 years, 10 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: content/browser/renderer_host/websocket_dispatcher_host.h
diff --git a/content/browser/renderer_host/websocket_dispatcher_host.h b/content/browser/renderer_host/websocket_dispatcher_host.h
index 56c5f3aaa5d74ab81f5eebe64b8b0eff53dce6e2..5d5c804ddf3e98edb607403c52b889fada6560da 100644
--- a/content/browser/renderer_host/websocket_dispatcher_host.h
+++ b/content/browser/renderer_host/websocket_dispatcher_host.h
@@ -13,6 +13,7 @@
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "content/common/content_export.h"
@@ -23,8 +24,14 @@ namespace net {
class URLRequestContext;
} // namespace net
+namespace storage {
+class BlobStorageContext;
+}
+
namespace content {
+class ChromeBlobStorageContext;
+class StoragePartition;
struct WebSocketHandshakeRequest;
struct WebSocketHandshakeResponse;
class WebSocketHost;
@@ -49,9 +56,10 @@ class CONTENT_EXPORT WebSocketDispatcherHost : public BrowserMessageFilter {
WEBSOCKET_HOST_DELETED
};
- WebSocketDispatcherHost(
- int process_id,
- const GetRequestContextCallback& get_context_callback);
+ WebSocketDispatcherHost(int process_id,
+ const GetRequestContextCallback& get_context_callback,
+ ChromeBlobStorageContext* blob_storage_context,
+ StoragePartition* storage_partition);
// BrowserMessageFilter:
bool OnMessageReceived(const IPC::Message& message) override;
@@ -96,6 +104,8 @@ class CONTENT_EXPORT WebSocketDispatcherHost : public BrowserMessageFilter {
int routing_id,
const std::string& message) WARN_UNUSED_RESULT;
+ WebSocketHostState BlobSendComplete(int routing_id);
+
// Sends a WebSocketMsg_DropChannel IPC and deletes and unregisters the
// channel.
WebSocketHostState DoDropChannel(int routing_id,
@@ -109,6 +119,13 @@ class CONTENT_EXPORT WebSocketDispatcherHost : public BrowserMessageFilter {
int render_process_id() const { return process_id_; }
+ // Returns a BlobStorageContext associated with this object's render process.
+ // The pointer will be valid for as long this object is.
+ storage::BlobStorageContext* blob_storage_context() const;
+
+ // Returns the StoragePartition associated with this render process.
+ StoragePartition* storage_partition() const { return storage_partition_; }
+
protected:
// For testing. Specify a factory method that creates mock version of
// WebSocketHost.
@@ -181,6 +198,12 @@ class CONTENT_EXPORT WebSocketDispatcherHost : public BrowserMessageFilter {
int64_t num_current_failed_connections_;
int64_t num_previous_failed_connections_;
+ // Needed to read from blobs for browser-side blob sending.
+ const scoped_refptr<const ChromeBlobStorageContext> blob_storage_context_;
+
+ // Needed to access to the StoragePartition for browser-side blob sending.
+ StoragePartition* const storage_partition_;
+
DISALLOW_COPY_AND_ASSIGN(WebSocketDispatcherHost);
};

Powered by Google App Engine
This is Rietveld 408576698