mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Mac:
- Complete basic functionality in libcef. - Port cefclient and unittests. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@135 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
51
libcef/cef_process_ui_thread_mac.mm
Normal file
51
libcef/cef_process_ui_thread_mac.mm
Normal file
@@ -0,0 +1,51 @@
|
||||
// Copyright (c) 2010 The Chromium Embedded Framework Authors.
|
||||
// Portions copyright (c) 2010 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "include/cef.h"
|
||||
#include "cef_process_ui_thread.h"
|
||||
#include "browser_webkit_glue.h"
|
||||
#include "base/chrome_application_mac.h"
|
||||
#include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// Memory autorelease pool.
|
||||
NSAutoreleasePool* g_autopool;
|
||||
|
||||
void RunLoopObserver(CFRunLoopObserverRef observer, CFRunLoopActivity activity,
|
||||
void* info)
|
||||
{
|
||||
CefDoMessageLoopWork();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void CefProcessUIThread::PlatformInit() {
|
||||
// Initialize the CrApplication instance.
|
||||
[CrApplication sharedApplication];
|
||||
g_autopool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
InitWebCoreSystemInterface();
|
||||
|
||||
// Register the run loop observer.
|
||||
CFRunLoopObserverRef observer =
|
||||
CFRunLoopObserverCreate(NULL,
|
||||
kCFRunLoopBeforeTimers | kCFRunLoopBeforeWaiting,
|
||||
YES, /* repeat */
|
||||
0,
|
||||
&RunLoopObserver,
|
||||
NULL);
|
||||
if (observer) {
|
||||
CFRunLoopAddObserver(CFRunLoopGetCurrent(), observer,
|
||||
kCFRunLoopCommonModes);
|
||||
}
|
||||
|
||||
webkit_glue::InitializeDataPak();
|
||||
}
|
||||
|
||||
void CefProcessUIThread::PlatformCleanUp() {
|
||||
[g_autopool release];
|
||||
}
|
||||
|
Reference in New Issue
Block a user