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

Unified Diff: chrome/browser/renderer_host/browser_render_process_host.h

Issue 21485: Bitmap transport (Closed)
Patch Set: Fix some mac crashes Created 11 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: chrome/browser/renderer_host/browser_render_process_host.h
diff --git a/chrome/browser/renderer_host/browser_render_process_host.h b/chrome/browser/renderer_host/browser_render_process_host.h
index be7e225b528a60c47175bcd031dc615d9f86608b..dad06b56c5d6b76e427c870a07c85704f932383c 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.h
+++ b/chrome/browser/renderer_host/browser_render_process_host.h
@@ -13,6 +13,8 @@
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/shared_memory.h"
+#include "base/timer.h"
+#include "chrome/common/transport_dib.h"
#include "chrome/browser/renderer_host/audio_renderer_host.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/common/notification_observer.h"
@@ -62,6 +64,7 @@ class BrowserRenderProcessHost : public RenderProcessHost,
virtual void WidgetHidden();
virtual void AddWord(const std::wstring& word);
virtual bool FastShutdownIfPossible();
+ virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id);
// IPC::Channel::Sender via RenderProcessHost.
virtual bool Send(IPC::Message* msg);
@@ -99,6 +102,7 @@ class BrowserRenderProcessHost : public RenderProcessHost,
void OnClipboardReadText(std::wstring* result);
void OnClipboardReadAsciiText(std::string* result);
void OnClipboardReadHTML(std::wstring* markup, GURL* src_url);
+
void OnUpdatedCacheStats(const CacheManager::UsageStats& stats);
// Initialize support for visited links. Send the renderer process its initial
@@ -140,6 +144,20 @@ class BrowserRenderProcessHost : public RenderProcessHost,
// The host of audio renderers in the renderer process.
scoped_refptr<AudioRendererHost> audio_renderer_host_;
+ // A map of transport DIB ids to cached TransportDIBs
+ std::map<TransportDIB::Id, TransportDIB*> cached_dibs_;
+ enum {
+ // This is the maximum size of |cached_dibs_|
+ MAX_MAPPED_TRANSPORT_DIBS = 3,
+ };
+
+ // Map a transport DIB from its Id and return it. Returns NULL on error.
+ TransportDIB* MapTransportDIB(TransportDIB::Id dib_id);
+
+ void ClearTransportDIBCache();
+ // This is used to clear our cache five seconds after the last use.
+ base::DelayTimer<BrowserRenderProcessHost> cached_dibs_cleaner_;
+
DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost);
};

Powered by Google App Engine
This is Rietveld 408576698