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

Unified Diff: chrome/browser/renderer_host/resource_message_filter.cc

Issue 203062: Linux: print page to file rather than using shared memory to send it to the b... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: style Created 11 years, 3 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/resource_message_filter.cc
===================================================================
--- chrome/browser/renderer_host/resource_message_filter.cc (revision 26282)
+++ chrome/browser/renderer_host/resource_message_filter.cc (working copy)
@@ -339,8 +339,10 @@
IPC_MESSAGE_HANDLER(ViewHostMsg_DuplicateSection, OnDuplicateSection)
#endif
#if defined(OS_LINUX)
- IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateShareMemory,
- OnAllocateShareMemory)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateTempFileForPrinting,
+ OnAllocateTempFileForPrinting)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_TempFileForPrintingWritten,
+ OnTempFileForPrintingWritten)
#endif
IPC_MESSAGE_HANDLER(ViewHostMsg_ResourceTypeStats, OnResourceTypeStats)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ResolveProxy, OnResolveProxy)
@@ -706,29 +708,6 @@
}
#endif
-#if defined(OS_LINUX)
-void ResourceMessageFilter::OnAllocateShareMemory(
- size_t buffer_size,
- base::SharedMemoryHandle* browser_handle) {
- // We don't want to allocate a super big chunk of memory.
- // 32MB should be large enough for printing on Linux.
- if (buffer_size > 32 * 1024 * 1024) {
- *browser_handle = base::SharedMemory::NULLHandle();
- NOTREACHED() << "Buffer too large: " << buffer_size;
- return;
- }
- base::SharedMemory shared_buf;
- shared_buf.Create(L"", false, false, buffer_size);
- if (shared_buf.Map(buffer_size)) {
- shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), browser_handle);
- } else {
- *browser_handle = base::SharedMemory::NULLHandle();
- NOTREACHED() << "Cannot map buffer";
- return;
- }
-}
-#endif
-
void ResourceMessageFilter::OnResourceTypeStats(
const WebCache::ResourceTypeStats& stats) {
HISTOGRAM_COUNTS("WebCoreCache.ImagesSizeKB",
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.h ('k') | chrome/browser/renderer_host/resource_message_filter_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698