| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <objidl.h> | 9 #include <objidl.h> |
| 10 #include <mlang.h> | 10 #include <mlang.h> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 #else | 109 #else |
| 110 return command_line.HasSwitch(switches::kInProcessPlugins) || | 110 return command_line.HasSwitch(switches::kInProcessPlugins) || |
| 111 command_line.HasSwitch(switches::kSingleProcess); | 111 command_line.HasSwitch(switches::kSingleProcess); |
| 112 #endif | 112 #endif |
| 113 } | 113 } |
| 114 | 114 |
| 115 // ----------------------------------------------------------------------------- | 115 // ----------------------------------------------------------------------------- |
| 116 // Platform specific code for dealing with bitmap transport... | 116 // Platform specific code for dealing with bitmap transport... |
| 117 | 117 |
| 118 TransportDIB* RenderProcess::CreateTransportDIB(size_t size) { | 118 TransportDIB* RenderProcess::CreateTransportDIB(size_t size) { |
| 119 #if defined(OS_WIN) || defined(OS_LINUX) | 119 #if defined(OS_WIN) || defined(USE_X11) |
| 120 // Windows and Linux create transport DIBs inside the renderer | 120 // Windows and Linux create transport DIBs inside the renderer |
| 121 return TransportDIB::Create(size, sequence_number_++); | 121 return TransportDIB::Create(size, sequence_number_++); |
| 122 #elif defined(OS_MACOSX) // defined(OS_WIN) || defined(OS_LINUX) | 122 #elif defined(OS_MACOSX) // defined(OS_WIN) || defined(OS_LINUX) |
| 123 // Mac creates transport DIBs in the browser, so we need to do a sync IPC to | 123 // Mac creates transport DIBs in the browser, so we need to do a sync IPC to |
| 124 // get one. | 124 // get one. |
| 125 TransportDIB::Handle handle; | 125 TransportDIB::Handle handle; |
| 126 IPC::Message* msg = new ViewHostMsg_AllocTransportDIB(size, &handle); | 126 IPC::Message* msg = new ViewHostMsg_AllocTransportDIB(size, &handle); |
| 127 if (!main_thread()->Send(msg)) | 127 if (!main_thread()->Send(msg)) |
| 128 return NULL; | 128 return NULL; |
| 129 if (handle.fd < 0) | 129 if (handle.fd < 0) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 } | 239 } |
| 240 | 240 |
| 241 void RenderProcess::ClearTransportDIBCache() { | 241 void RenderProcess::ClearTransportDIBCache() { |
| 242 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { | 242 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { |
| 243 if (shared_mem_cache_[i]) { | 243 if (shared_mem_cache_[i]) { |
| 244 FreeTransportDIB(shared_mem_cache_[i]); | 244 FreeTransportDIB(shared_mem_cache_[i]); |
| 245 shared_mem_cache_[i] = NULL; | 245 shared_mem_cache_[i] = NULL; |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 } | 248 } |
| OLD | NEW |