Skip to content

Commit

Permalink
Reenable extra_warnings config for angle_utils
Browse files Browse the repository at this point in the history
Originally disabled in https://crrev.com/c/1738438.

Bug: angleproject:1459
Change-Id: I95172dc95a5d3e9d838c542ee6bcfb2338ffc9a6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1743078
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
  • Loading branch information
jdarpinian authored and Commit Bot committed Aug 8, 2019
1 parent e86a856 commit 64751a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,6 @@ foreach(is_shared_library,
}

configs += [ ":debug_annotations_config" ]
configs -= [ "${angle_root}:extra_warnings" ]

public_configs += [ ":angle_util_config" ]

Expand Down
15 changes: 10 additions & 5 deletions util/osx/OSXWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// Include Carbon to use the keycode names in Carbon's Event.h
#include <Carbon/Carbon.h>

#include "anglebase/no_destructor.h"
#include "common/debug.h"

// On OSX 10.12 a number of AppKit interfaces have been renamed for consistency, and the previous
Expand All @@ -23,7 +24,11 @@
// Some events such as "ShouldTerminate" are sent to the whole application so we keep a list of
// all the windows in order to forward the event to each of them. However this and calling pushEvent
// in ApplicationDelegate is inherently unsafe in a multithreaded environment.
static std::set<OSXWindow *> gAllWindows;
static std::set<OSXWindow *> &AllWindows()
{
static angle::base::NoDestructor<std::set<OSXWindow *>> allWindows;
return *allWindows;
}

@interface Application : NSApplication
@end
Expand All @@ -33,7 +38,7 @@ - (void)sendEvent:(NSEvent *)nsEvent
{
if ([nsEvent type] == NSApplicationDefined)
{
for (auto window : gAllWindows)
for (auto window : AllWindows())
{
if ([window->getNSWindow() windowNumber] == [nsEvent windowNumber])
{
Expand All @@ -56,7 +61,7 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sende
{
Event event;
event.Type = Event::EVENT_CLOSED;
for (auto window : gAllWindows)
for (auto window : AllWindows())
{
window->pushEvent(event);
}
Expand Down Expand Up @@ -662,13 +667,13 @@ - (void)flagsChanged:(NSEvent *)nsEvent
mWidth = width;
mHeight = height;

gAllWindows.insert(this);
AllWindows().insert(this);
return true;
}

void OSXWindow::destroy()
{
gAllWindows.erase(this);
AllWindows().erase(this);

[mView release];
mView = nil;
Expand Down

0 comments on commit 64751a0

Please sign in to comment.