Skip to content

Commit

Permalink
Merge pull request electron#11271 from electron/dchecks
Browse files Browse the repository at this point in the history
Build with dchecks disabled on subset of targets
  • Loading branch information
John Kleinschmidt authored Dec 4, 2017
2 parents 6beaafc + 4cf6763 commit e989005
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion atom/browser/api/event_subscriber.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ EventSubscriberBase::~EventSubscriberBase() {
}
RemoveAllListeners();
emitter_.Reset();
DCHECK_EQ(js_handlers_.size(), 0);
DCHECK_EQ(js_handlers_.size(), 0u);
}

void EventSubscriberBase::On(const std::string& event_name) {
Expand Down
3 changes: 2 additions & 1 deletion atom/browser/atom_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ bool AtomBrowserClient::CanCreateWindow(
bool user_gesture,
bool opener_suppressed,
bool* no_javascript_access) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
// FIXME: Ensure the DCHECK doesn't fail and then re-enable
// DCHECK_CURRENTLY_ON(content::BrowserThread::IO);

int opener_render_process_id = opener->GetProcess()->GetID();

Expand Down
5 changes: 3 additions & 2 deletions atom/browser/native_window_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,9 @@ NativeWindowViews::NativeWindowViews(
state_atom_list.push_back(GetAtom("_NET_WM_STATE_MODAL"));
}

ui::SetAtomArrayProperty(GetAcceleratedWidget(), "_NET_WM_STATE", "ATOM",
state_atom_list);
if (!state_atom_list.empty())
ui::SetAtomArrayProperty(GetAcceleratedWidget(), "_NET_WM_STATE", "ATOM",
state_atom_list);

// Set the _NET_WM_WINDOW_TYPE.
if (!window_type.empty())
Expand Down
4 changes: 4 additions & 0 deletions atom/browser/ui/win/taskbar_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,14 @@ bool TaskbarHost::HandleThumbarButtonEvent(int button_id) {
}

bool TaskbarHost::InitializeTaskbar() {
if (taskbar_)
return true;

if (FAILED(::CoCreateInstance(CLSID_TaskbarList, nullptr,
CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(&taskbar_))) ||
FAILED(taskbar_->HrInit())) {
taskbar_.Reset();
return false;
} else {
return true;
Expand Down
16 changes: 12 additions & 4 deletions atom/browser/web_view_guest_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ void WebViewGuestDelegate::Initialize(api::WebContents* api_web_contents) {

void WebViewGuestDelegate::Destroy() {
// Give the content module an opportunity to perform some cleanup.
if (embedder_zoom_controller_) {
embedder_zoom_controller_->RemoveObserver(this);
embedder_zoom_controller_ = nullptr;
}
ResetZoomController();
guest_host_->WillDestroy();
guest_host_ = nullptr;
}
Expand Down Expand Up @@ -113,11 +110,15 @@ void WebViewGuestDelegate::DidFinishNavigation(

void WebViewGuestDelegate::DidDetach() {
attached_ = false;
ResetZoomController();
}

void WebViewGuestDelegate::DidAttach(int guest_proxy_routing_id) {
attached_ = true;
api_web_contents_->Emit("did-attach");

ResetZoomController();

embedder_zoom_controller_ =
WebContentsZoomController::FromWebContents(embedder_web_contents_);
auto zoom_controller = api_web_contents_->GetZoomController();
Expand Down Expand Up @@ -183,6 +184,13 @@ gfx::Size WebViewGuestDelegate::GetDefaultSize() const {
}
}

void WebViewGuestDelegate::ResetZoomController() {
if (embedder_zoom_controller_) {
embedder_zoom_controller_->RemoveObserver(this);
embedder_zoom_controller_ = nullptr;
}
}

bool WebViewGuestDelegate::CanBeEmbeddedInsideCrossProcessFrames() {
return true;
}
Expand Down
2 changes: 2 additions & 0 deletions atom/browser/web_view_guest_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
// Returns the default size of the guestview.
gfx::Size GetDefaultSize() const;

void ResetZoomController();

// The WebContents that attaches this guest view.
content::WebContents* embedder_web_contents_ = nullptr;

Expand Down
3 changes: 2 additions & 1 deletion brightray/browser/media/media_capture_devices_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ MediaCaptureDevicesDispatcher::MediaCaptureDevicesDispatcher()
: is_device_enumeration_disabled_(false) {
// MediaCaptureDevicesDispatcher is a singleton. It should be created on
// UI thread.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// FIXME: Ensure the DCHECK doesn't fail and then re-enable
// DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}

MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {}
Expand Down

0 comments on commit e989005

Please sign in to comment.