#include "atom/browser/native_window.h"
#include "atom/browser/web_view_guest_delegate.h"
#include "atom/common/api/api_messages.h"
-#include "atom/common/event_emitter_caller.h"
+#include "atom/common/api/event_emitter_caller.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/file_path_converter.h"
#include "atom/common/native_mate_converters/gfx_converter.h"
#include <vector>
-#include "atom/common/event_emitter_caller.h"
+#include "atom/common/api/event_emitter_caller.h"
#include "native_mate/wrappable.h"
namespace content {
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
-#include "atom/common/event_emitter_caller.h"
+#include "atom/common/api/event_emitter_caller.h"
+#include "atom/common/api/locker.h"
#include "base/memory/scoped_ptr.h"
#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
namespace internal {
-namespace {
-
-// Returns whether current process is browser process, currently we detect it
-// by checking whether current has used V8 Lock, but it might be a bad idea.
-inline bool IsBrowserProcess() {
- return v8::Locker::IsActive();
-}
-
-} // namespace
-
v8::Local<v8::Value> CallEmitWithArgs(v8::Isolate* isolate,
v8::Local<v8::Object> obj,
ValueVector* args) {
// Perform microtask checkpoint after running JavaScript.
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
- IsBrowserProcess() ? nullptr : new blink::WebScopedRunV8Script(isolate));
+ Locker::IsBrowserProcess() ?
+ nullptr : new blink::WebScopedRunV8Script(isolate));
// Use node::MakeCallback to call the callback, and it will also run pending
// tasks in Node.js.
return node::MakeCallback(
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
-#ifndef ATOM_COMMON_EVENT_EMITTER_CALLER_H_
-#define ATOM_COMMON_EVENT_EMITTER_CALLER_H_
+#ifndef ATOM_COMMON_API_EVENT_EMITTER_CALLER_H_
+#define ATOM_COMMON_API_EVENT_EMITTER_CALLER_H_
#include <vector>
} // namespace mate
-#endif // ATOM_COMMON_EVENT_EMITTER_CALLER_H_
+#endif // ATOM_COMMON_API_EVENT_EMITTER_CALLER_H_
--- /dev/null
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE.chromium file.
+
+#include "atom/common/api/locker.h"
+
+namespace mate {
+
+Locker::Locker(v8::Isolate* isolate) {
+ if (IsBrowserProcess())
+ locker_.reset(new v8::Locker(isolate));
+}
+
+Locker::~Locker() {
+}
+
+} // namespace mate
--- /dev/null
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE.chromium file.
+
+#ifndef ATOM_COMMON_API_LOCKER_H_
+#define ATOM_COMMON_API_LOCKER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "v8/include/v8.h"
+
+namespace mate {
+
+// Only lock when lockers are used in current thread.
+class Locker {
+ public:
+ explicit Locker(v8::Isolate* isolate);
+ ~Locker();
+
+ // Returns whether current process is browser process, currently we detect it
+ // by checking whether current has used V8 Lock, but it might be a bad idea.
+ static inline bool IsBrowserProcess() { return v8::Locker::IsActive(); }
+
+ private:
+ void* operator new(size_t size);
+ void operator delete(void*, size_t);
+
+ scoped_ptr<v8::Locker> locker_;
+
+ DISALLOW_COPY_AND_ASSIGN(Locker);
+};
+
+} // namespace mate
+
+#endif // ATOM_COMMON_API_LOCKER_H_
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
+#ifndef ATOM_COMMON_NATIVE_MATE_CONVERTERS_CALLBACK_H_
+#define ATOM_COMMON_NATIVE_MATE_CONVERTERS_CALLBACK_H_
+
#include <vector>
+#include "atom/common/api/locker.h"
#include "base/bind.h"
#include "base/callback.h"
#include "native_mate/function_template.h"
-#include "native_mate/locker.h"
#include "native_mate/scoped_persistent.h"
+#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
namespace mate {
ArgTypes... raw) {
Locker locker(isolate);
v8::EscapableHandleScope handle_scope(isolate);
+ scoped_ptr<blink::WebScopedRunV8Script> script_scope(
+ Locker::IsBrowserProcess() ?
+ nullptr : new blink::WebScopedRunV8Script(isolate));
v8::Local<v8::Function> holder = function->NewHandle();
v8::Local<v8::Context> context = holder->CreationContext();
v8::Context::Scope context_scope(context);
ArgTypes... raw) {
Locker locker(isolate);
v8::HandleScope handle_scope(isolate);
+ scoped_ptr<blink::WebScopedRunV8Script> script_scope(
+ Locker::IsBrowserProcess() ?
+ nullptr : new blink::WebScopedRunV8Script(isolate));
v8::Local<v8::Function> holder = function->NewHandle();
v8::Local<v8::Context> context = holder->CreationContext();
v8::Context::Scope context_scope(context);
ArgTypes... raw) {
Locker locker(isolate);
v8::HandleScope handle_scope(isolate);
+ scoped_ptr<blink::WebScopedRunV8Script> script_scope(
+ Locker::IsBrowserProcess() ?
+ nullptr : new blink::WebScopedRunV8Script(isolate));
v8::Local<v8::Function> holder = function->NewHandle();
v8::Local<v8::Context> context = holder->CreationContext();
v8::Context::Scope context_scope(context);
};
} // namespace mate
+
+#endif // ATOM_COMMON_NATIVE_MATE_CONVERTERS_CALLBACK_H_
#include <string>
#include <vector>
+#include "atom/common/api/event_emitter_caller.h"
+#include "atom/common/api/locker.h"
#include "atom/common/atom_command_line.h"
-#include "atom/common/event_emitter_caller.h"
#include "atom/common/native_mate_converters/file_path_converter.h"
#include "base/command_line.h"
#include "base/base_paths.h"
#include "base/path_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_paths.h"
-#include "native_mate/locker.h"
#include "native_mate/dictionary.h"
#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "atom/common/api/api_messages.h"
-#include "atom/common/event_emitter_caller.h"
+#include "atom/common/api/event_emitter_caller.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/options_switches.h"
#include "atom/renderer/atom_renderer_client.h"
'atom/common/api/atom_api_v8_util.cc',
'atom/common/api/atom_bindings.cc',
'atom/common/api/atom_bindings.h',
+ 'atom/common/api/event_emitter_caller.cc',
+ 'atom/common/api/event_emitter_caller.h',
+ 'atom/common/api/locker.cc',
+ 'atom/common/api/locker.h',
'atom/common/api/object_life_monitor.cc',
'atom/common/api/object_life_monitor.h',
'atom/common/asar/archive.cc',
'atom/common/crash_reporter/win/crash_service_main.h',
'atom/common/draggable_region.cc',
'atom/common/draggable_region.h',
- 'atom/common/event_emitter_caller.cc',
- 'atom/common/event_emitter_caller.h',
'atom/common/google_api_key.h',
'atom/common/id_weak_map.cc',
'atom/common/id_weak_map.h',
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
- 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
+ 'http://github-janky-artifacts.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'dd51a41b42246b0b5159bfad5e327c8cf10bc585'
PLATFORM = {
-Subproject commit ebcf4c022467a43a5379446e1c031ffd10438b9c
+Subproject commit 67d9eaa215e8727d86dc7b1f7a10be8699848f1f