Commit 64751a0b by James Darpinian Committed by Commit Bot

Reenable extra_warnings config for angle_utils

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: 's avatarJamie Madill <jmadill@chromium.org>
parent e86a8560
...@@ -1077,7 +1077,6 @@ foreach(is_shared_library, ...@@ -1077,7 +1077,6 @@ foreach(is_shared_library,
} }
configs += [ ":debug_annotations_config" ] configs += [ ":debug_annotations_config" ]
configs -= [ "${angle_root}:extra_warnings" ]
public_configs += [ ":angle_util_config" ] public_configs += [ ":angle_util_config" ]
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
// Include Carbon to use the keycode names in Carbon's Event.h // Include Carbon to use the keycode names in Carbon's Event.h
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
#include "anglebase/no_destructor.h"
#include "common/debug.h" #include "common/debug.h"
// On OSX 10.12 a number of AppKit interfaces have been renamed for consistency, and the previous // On OSX 10.12 a number of AppKit interfaces have been renamed for consistency, and the previous
...@@ -23,7 +24,11 @@ ...@@ -23,7 +24,11 @@
// Some events such as "ShouldTerminate" are sent to the whole application so we keep a list of // 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 // 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. // 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 @interface Application : NSApplication
@end @end
...@@ -33,7 +38,7 @@ static std::set<OSXWindow *> gAllWindows; ...@@ -33,7 +38,7 @@ static std::set<OSXWindow *> gAllWindows;
{ {
if ([nsEvent type] == NSApplicationDefined) if ([nsEvent type] == NSApplicationDefined)
{ {
for (auto window : gAllWindows) for (auto window : AllWindows())
{ {
if ([window->getNSWindow() windowNumber] == [nsEvent windowNumber]) if ([window->getNSWindow() windowNumber] == [nsEvent windowNumber])
{ {
...@@ -56,7 +61,7 @@ static std::set<OSXWindow *> gAllWindows; ...@@ -56,7 +61,7 @@ static std::set<OSXWindow *> gAllWindows;
{ {
Event event; Event event;
event.Type = Event::EVENT_CLOSED; event.Type = Event::EVENT_CLOSED;
for (auto window : gAllWindows) for (auto window : AllWindows())
{ {
window->pushEvent(event); window->pushEvent(event);
} }
...@@ -662,13 +667,13 @@ bool OSXWindow::initialize(const std::string &name, size_t width, size_t height) ...@@ -662,13 +667,13 @@ bool OSXWindow::initialize(const std::string &name, size_t width, size_t height)
mWidth = width; mWidth = width;
mHeight = height; mHeight = height;
gAllWindows.insert(this); AllWindows().insert(this);
return true; return true;
} }
void OSXWindow::destroy() void OSXWindow::destroy()
{ {
gAllWindows.erase(this); AllWindows().erase(this);
[mView release]; [mView release];
mView = nil; mView = nil;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment