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

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

Issue 1876653003: Register clipboard image blob in the browser process to copy data less. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 | « components/test_runner/pixel_dump.cc ('k') | content/browser/renderer_host/clipboard_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/clipboard_message_filter.h
diff --git a/content/browser/renderer_host/clipboard_message_filter.h b/content/browser/renderer_host/clipboard_message_filter.h
index c855f3d06f1bcc23f3282744bea5db8d6cf45e84..c7b748cabc7cfcb36c50c62c1438187732df11d4 100644
--- a/content/browser/renderer_host/clipboard_message_filter.h
+++ b/content/browser/renderer_host/clipboard_message_filter.h
@@ -7,10 +7,12 @@
#include <stdint.h>
+#include <memory>
#include <string>
#include <vector>
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/shared_memory.h"
#include "build/build_config.h"
#include "content/common/clipboard_format.h"
@@ -26,11 +28,13 @@ class ScopedClipboardWriter;
namespace content {
+class ChromeBlobStorageContext;
class ClipboardMessageFilterTest;
class CONTENT_EXPORT ClipboardMessageFilter : public BrowserMessageFilter {
public:
- ClipboardMessageFilter();
+ explicit ClipboardMessageFilter(
+ scoped_refptr<ChromeBlobStorageContext> blob_storage_context);
void OverrideThreadForMessage(const IPC::Message& message,
BrowserThread::ID* thread) override;
@@ -58,7 +62,10 @@ class CONTENT_EXPORT ClipboardMessageFilter : public BrowserMessageFilter {
uint32_t* fragment_end);
void OnReadRTF(ui::ClipboardType type, std::string* result);
void OnReadImage(ui::ClipboardType type, IPC::Message* reply_msg);
- void OnReadImageReply(const SkBitmap& bitmap, IPC::Message* reply_msg);
+ void ReadAndEncodeImage(const SkBitmap& bitmap, IPC::Message* reply_msg);
+ void OnReadAndEncodeImageFinished(
+ std::unique_ptr<std::vector<uint8_t>> png_data,
+ IPC::Message* reply_msg);
void OnReadCustomData(ui::ClipboardType clipboard_type,
const base::string16& type,
base::string16* result);
@@ -91,6 +98,7 @@ class CONTENT_EXPORT ClipboardMessageFilter : public BrowserMessageFilter {
// thread.
static ui::Clipboard* GetClipboard();
+ scoped_refptr<ChromeBlobStorageContext> blob_storage_context_;
std::unique_ptr<ui::ScopedClipboardWriter> clipboard_writer_;
DISALLOW_COPY_AND_ASSIGN(ClipboardMessageFilter);
« no previous file with comments | « components/test_runner/pixel_dump.cc ('k') | content/browser/renderer_host/clipboard_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698