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

Side by Side Diff: chrome/renderer/render_process_impl.cc

Issue 2769014: Mac/clang: Possibly contentious changes. (Closed)
Patch Set: comments2 Created 10 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // to reduce the width as well to make the size reduction more "balanced", but 278 // to reduce the width as well to make the size reduction more "balanced", but
279 // it rarely comes up in practice. 279 // it rarely comes up in practice.
280 if ((max_size != 0) && (height * stride > max_size)) 280 if ((max_size != 0) && (height * stride > max_size))
281 height = max_size / stride; 281 height = max_size / stride;
282 282
283 const size_t size = height * stride; 283 const size_t size = height * stride;
284 284
285 if (!GetTransportDIBFromCache(memory, size)) { 285 if (!GetTransportDIBFromCache(memory, size)) {
286 *memory = CreateTransportDIB(size); 286 *memory = CreateTransportDIB(size);
287 if (!*memory) 287 if (!*memory)
288 return false; 288 return NULL;
289 } 289 }
290 290
291 return (*memory)->GetPlatformCanvas(width, height); 291 return (*memory)->GetPlatformCanvas(width, height);
292 } 292 }
293 293
294 void RenderProcessImpl::ReleaseTransportDIB(TransportDIB* mem) { 294 void RenderProcessImpl::ReleaseTransportDIB(TransportDIB* mem) {
295 if (PutSharedMemInCache(mem)) { 295 if (PutSharedMemInCache(mem)) {
296 shared_mem_cache_cleaner_.Reset(); 296 shared_mem_cache_cleaner_.Reset();
297 return; 297 return;
298 } 298 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 } 361 }
362 362
363 void RenderProcessImpl::ClearTransportDIBCache() { 363 void RenderProcessImpl::ClearTransportDIBCache() {
364 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { 364 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) {
365 if (shared_mem_cache_[i]) { 365 if (shared_mem_cache_[i]) {
366 FreeTransportDIB(shared_mem_cache_[i]); 366 FreeTransportDIB(shared_mem_cache_[i]);
367 shared_mem_cache_[i] = NULL; 367 shared_mem_cache_[i] = NULL;
368 } 368 }
369 } 369 }
370 } 370 }
OLDNEW
« chrome/browser/geolocation/wifi_data_provider_corewlan_mac.mm ('K') | « chrome/common/sandbox_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698