mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-12 17:46:04 +01:00
019611c764
Under ARC (Automatic Reference Counting), assigning to an Objective-C pointer has different semantics than assigning to a void* pointer. This makes it dangerous to treat the same memory address as an Objective-C pointer in some cases and as a "regular C pointer" in other cases. This change removes the conditional type defines and instead uses void* everywhere. Explicit type casting in combination with ARC annotations makes it safe to get typed Objective-C pointers from the void* pointers. This change enables ARC by default in the CEF binary distribution CMake configuration for the cefclient and cefsimple sample applications. It can be disabled by adding `-DOPTION_USE_ARC=Off` to the CMake command line. ARC is not supported when building Chromium due to the substantial number of changes that would be required in the Chromium code base.
19 lines
575 B
Plaintext
19 lines
575 B
Plaintext
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
|
// reserved. Use of this source code is governed by a BSD-style license
|
|
// that can be found in the LICENSE file.
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#include "tests/ceftests/os_rendering_unittest_mac.h"
|
|
|
|
namespace osr_unittests {
|
|
|
|
CefWindowHandle GetFakeView() {
|
|
NSScreen* mainScreen = [NSScreen mainScreen];
|
|
NSRect screenRect = [mainScreen visibleFrame];
|
|
NSView* fakeView = [[NSView alloc] initWithFrame:screenRect];
|
|
return CAST_NSVIEW_TO_CEF_WINDOW_HANDLE(fakeView);
|
|
}
|
|
|
|
} // namespace osr_unittests
|