macOS: Make the NativeEventProcessor protocol dependency optional (issue #2539)

This commit is contained in:
Marshall Greenblatt 2018-11-06 13:51:02 -05:00
parent 1e0c248044
commit bb5fe57984
2 changed files with 27 additions and 0 deletions

View File

@ -367,6 +367,11 @@ patches = [
# https://bugs.chromium.org/p/chromium/issues/detail?id=757974#c23 # https://bugs.chromium.org/p/chromium/issues/detail?id=757974#c23
'name': 'mac_gpu', 'name': 'mac_gpu',
}, },
{
# macOS: Make the NativeEventProcessor protocol dependency optional.
# https://bitbucket.org/chromiumembedded/cef/issues/2539
'name': 'mac_event_observer_2539',
},
{ {
# Support rendering to a hardware GL/D3D texture/surface provided by the client # Support rendering to a hardware GL/D3D texture/surface provided by the client
# https://bitbucket.org/chromiumembedded/cef/issues/1006 # https://bitbucket.org/chromiumembedded/cef/issues/1006

View File

@ -0,0 +1,22 @@
diff --git content/browser/scheduler/responsiveness/native_event_observer_mac.mm content/browser/scheduler/responsiveness/native_event_observer_mac.mm
index 7cb3238e97ed..ae800739b686 100644
--- content/browser/scheduler/responsiveness/native_event_observer_mac.mm
+++ content/browser/scheduler/responsiveness/native_event_observer_mac.mm
@@ -12,13 +12,15 @@
namespace responsiveness {
void NativeEventObserver::RegisterObserver() {
- DCHECK([NSApp conformsToProtocol:@protocol(NativeEventProcessor)]);
+ if (![NSApp conformsToProtocol:@protocol(NativeEventProcessor)])
+ return;
id<NativeEventProcessor> processor =
static_cast<id<NativeEventProcessor>>(NSApp);
[processor addNativeEventProcessorObserver:this];
}
void NativeEventObserver::DeregisterObserver() {
- DCHECK([NSApp conformsToProtocol:@protocol(NativeEventProcessor)]);
+ if (![NSApp conformsToProtocol:@protocol(NativeEventProcessor)])
+ return;
id<NativeEventProcessor> processor =
static_cast<id<NativeEventProcessor>>(NSApp);
[processor removeNativeEventProcessorObserver:this];