Skip to content

Commit

Permalink
chore: DCHECK that events are only emitted on the UI thread (#15873)
Browse files Browse the repository at this point in the history
* chore: DCHECK that events are only emitted on the UI thread

* move dcheck to EmitWithEvent
  • Loading branch information
nornagon authored and Cheng Zhao committed Nov 30, 2018
1 parent 8483cb4 commit 83d951d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions atom/browser/api/event_emitter.h
Expand Up @@ -8,6 +8,7 @@
#include <vector>

#include "atom/common/api/event_emitter_caller.h"
#include "content/public/browser/browser_thread.h"
#include "native_mate/wrappable.h"

namespace content {
Expand Down Expand Up @@ -97,6 +98,7 @@ class EventEmitter : public Wrappable<T> {
bool EmitWithEvent(const base::StringPiece& name,
v8::Local<v8::Object> event,
const Args&... args) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
EmitEvent(isolate(), GetWrapper(), name, event, args...);
Expand Down
1 change: 1 addition & 0 deletions atom/browser/net/js_asker.cc
Expand Up @@ -7,6 +7,7 @@
#include <utility>

#include "atom/common/native_mate_converters/callback.h"
#include "content/public/browser/browser_thread.h"

namespace atom {

Expand Down
1 change: 1 addition & 0 deletions atom/common/native_mate_converters/callback.cc
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.

#include "atom/common/native_mate_converters/callback.h"
#include "content/public/browser/browser_thread.h"

#include "native_mate/dictionary.h"

Expand Down
1 change: 0 additions & 1 deletion atom/common/native_mate_converters/callback.h
Expand Up @@ -12,7 +12,6 @@
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "content/public/browser/browser_thread.h"
#include "native_mate/function_template.h"
#include "native_mate/scoped_persistent.h"

Expand Down

0 comments on commit 83d951d

Please sign in to comment.