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

Side by Side Diff: chrome/renderer/renderer_main_platform_delegate_mac.mm

Issue 28120: Sandbox warmup - localtime(). (Closed)
Patch Set: . Created 11 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/renderer/renderer_main_platform_delegate.h" 5 #include "chrome/renderer/renderer_main_platform_delegate.h"
6 6
7 #include "base/debug_util.h" 7 #include "base/debug_util.h"
8 8
9 #import <Foundation/Foundation.h> 9 #import <Foundation/Foundation.h>
10 #import <ApplicationServices/ApplicationServices.h> 10 #import <ApplicationServices/ApplicationServices.h>
(...skipping 29 matching lines...) Expand all
40 rgb_colorspace, 40 rgb_colorspace,
41 kCGImageAlphaPremultipliedFirst | 41 kCGImageAlphaPremultipliedFirst |
42 kCGBitmapByteOrder32Host); 42 kCGBitmapByteOrder32Host);
43 CGColorSpaceRelease(rgb_colorspace); 43 CGColorSpaceRelease(rgb_colorspace);
44 CGContextRelease(tmp); 44 CGContextRelease(tmp);
45 45
46 // Warm up NSColor conversion which also accesses the FS on it's first call. 46 // Warm up NSColor conversion which also accesses the FS on it's first call.
47 NSColor *color = [NSColor controlTextColor]; 47 NSColor *color = [NSColor controlTextColor];
48 [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; 48 [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
49 49
50 time_t tv = time(NULL); 50 // Warm up localtime().
brettw 2009/02/25 18:00:20 I don't understand why this is here at all, and yo
51 time_t tv = {0};
John Grabowski 2009/02/25 18:29:47 I think I understand why the warm-up (sandbox so w
51 localtime(&tv); 52 localtime(&tv);
52 53
53 #if 0 54 #if 0
54 55
55 // Note: by default, Cocoa is NOT thread safe. Use of NSThreads 56 // Note: by default, Cocoa is NOT thread safe. Use of NSThreads
56 // tells Cocoa to be MT-aware and create and use locks. The 57 // tells Cocoa to be MT-aware and create and use locks. The
57 // renderer process only uses Cocoa from the single renderer thread, 58 // renderer process only uses Cocoa from the single renderer thread,
58 // so we don't need to tell Cocoa we are using threads (even though, 59 // so we don't need to tell Cocoa we are using threads (even though,
59 // oddly, we are using Cocoa from the non-main thread.) 60 // oddly, we are using Cocoa from the non-main thread.)
60 // The current limit of renderer processes is 20. Brett states that 61 // The current limit of renderer processes is 20. Brett states that
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 if (error == -1) { 121 if (error == -1) {
121 LOG(ERROR) << "Failed to Initialize Sandbox: " << error_buff; 122 LOG(ERROR) << "Failed to Initialize Sandbox: " << error_buff;
122 } 123 }
123 sandbox_free_error(error_buff); 124 sandbox_free_error(error_buff);
124 return success; 125 return success;
125 } 126 }
126 127
127 void RendererMainPlatformDelegate::RunSandboxTests() { 128 void RendererMainPlatformDelegate::RunSandboxTests() {
128 // TODO(port): Run sandbox unit test here. 129 // TODO(port): Run sandbox unit test here.
129 } 130 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698