Merge remote-tracking branch 'atom/master'
This commit is contained in:
commit
c8954ff32c
26 changed files with 50 additions and 69 deletions
|
@ -19,6 +19,7 @@
|
||||||
#include "atom/browser/api/atom_api_web_contents.h"
|
#include "atom/browser/api/atom_api_web_contents.h"
|
||||||
#include "atom/common/native_mate_converters/callback.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/file_path_converter.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
#include "base/environment.h"
|
#include "base/environment.h"
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
|
@ -34,8 +35,6 @@
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
using atom::Browser;
|
using atom::Browser;
|
||||||
|
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
|
|
@ -7,11 +7,10 @@
|
||||||
#include "base/time/time.h"
|
#include "base/time/time.h"
|
||||||
#include "atom/browser/auto_updater.h"
|
#include "atom/browser/auto_updater.h"
|
||||||
#include "atom/browser/browser.h"
|
#include "atom/browser/browser.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
#include "native_mate/object_template_builder.h"
|
#include "native_mate/object_template_builder.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
|
@ -7,13 +7,12 @@
|
||||||
|
|
||||||
#include "atom/common/native_mate_converters/callback.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/file_path_converter.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/files/file_util.h"
|
#include "base/files/file_util.h"
|
||||||
#include "content/public/browser/tracing_controller.h"
|
#include "content/public/browser/tracing_controller.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
using content::TracingController;
|
using content::TracingController;
|
||||||
|
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
#include "net/url_request/url_request_context.h"
|
#include "net/url_request/url_request_context.h"
|
||||||
#include "net/url_request/url_request_context_getter.h"
|
#include "net/url_request/url_request_context_getter.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
using atom::api::Cookies;
|
using atom::api::Cookies;
|
||||||
using content::BrowserThread;
|
using content::BrowserThread;
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,11 @@
|
||||||
#include "atom/browser/api/atom_api_power_monitor.h"
|
#include "atom/browser/api/atom_api_power_monitor.h"
|
||||||
|
|
||||||
#include "atom/browser/browser.h"
|
#include "atom/browser/browser.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "base/power_monitor/power_monitor.h"
|
#include "base/power_monitor/power_monitor.h"
|
||||||
#include "base/power_monitor/power_monitor_device_source.h"
|
#include "base/power_monitor/power_monitor_device_source.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
@ -41,9 +40,9 @@ void PowerMonitor::OnResume() {
|
||||||
// static
|
// static
|
||||||
v8::Local<v8::Value> PowerMonitor::Create(v8::Isolate* isolate) {
|
v8::Local<v8::Value> PowerMonitor::Create(v8::Isolate* isolate) {
|
||||||
if (!Browser::Get()->is_ready()) {
|
if (!Browser::Get()->is_ready()) {
|
||||||
node::ThrowError(
|
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
|
||||||
isolate,
|
isolate,
|
||||||
"Cannot initialize \"power-monitor\" module before app is ready");
|
"Cannot initialize \"power-monitor\" module before app is ready")));
|
||||||
return v8::Null(isolate);
|
return v8::Null(isolate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "content/public/browser/power_save_blocker.h"
|
#include "content/public/browser/power_save_blocker.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,8 @@
|
||||||
#include "atom/browser/net/url_request_fetch_job.h"
|
#include "atom/browser/net/url_request_fetch_job.h"
|
||||||
#include "atom/browser/net/url_request_string_job.h"
|
#include "atom/browser/net/url_request_string_job.h"
|
||||||
#include "atom/common/native_mate_converters/callback.h"
|
#include "atom/common/native_mate_converters/callback.h"
|
||||||
#include "native_mate/dictionary.h"
|
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
#include "atom/common/node_includes.h"
|
||||||
|
#include "native_mate/dictionary.h"
|
||||||
|
|
||||||
using content::BrowserThread;
|
using content::BrowserThread;
|
||||||
|
|
||||||
|
|
|
@ -113,14 +113,16 @@ mate::ObjectTemplateBuilder Screen::GetObjectTemplateBuilder(
|
||||||
// static
|
// static
|
||||||
v8::Local<v8::Value> Screen::Create(v8::Isolate* isolate) {
|
v8::Local<v8::Value> Screen::Create(v8::Isolate* isolate) {
|
||||||
if (!Browser::Get()->is_ready()) {
|
if (!Browser::Get()->is_ready()) {
|
||||||
node::ThrowError(isolate,
|
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
|
||||||
"Cannot initialize \"screen\" module before app is ready");
|
isolate,
|
||||||
|
"Cannot initialize \"screen\" module before app is ready")));
|
||||||
return v8::Null(isolate);
|
return v8::Null(isolate);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx::Screen* screen = gfx::Screen::GetNativeScreen();
|
gfx::Screen* screen = gfx::Screen::GetNativeScreen();
|
||||||
if (!screen) {
|
if (!screen) {
|
||||||
node::ThrowError(isolate, "Failed to get screen information");
|
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
|
||||||
|
isolate, "Failed to get screen information")));
|
||||||
return v8::Null(isolate);
|
return v8::Null(isolate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "atom/common/native_mate_converters/callback.h"
|
#include "atom/common/native_mate_converters/callback.h"
|
||||||
#include "atom/common/native_mate_converters/gurl_converter.h"
|
#include "atom/common/native_mate_converters/gurl_converter.h"
|
||||||
#include "atom/common/native_mate_converters/file_path_converter.h"
|
#include "atom/common/native_mate_converters/file_path_converter.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
#include "base/prefs/pref_service.h"
|
#include "base/prefs/pref_service.h"
|
||||||
#include "base/strings/string_util.h"
|
#include "base/strings/string_util.h"
|
||||||
|
@ -29,8 +30,6 @@
|
||||||
#include "net/url_request/url_request_context.h"
|
#include "net/url_request/url_request_context.h"
|
||||||
#include "net/url_request/url_request_context_getter.h"
|
#include "net/url_request/url_request_context_getter.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
using content::BrowserThread;
|
using content::BrowserThread;
|
||||||
using content::StoragePartition;
|
using content::StoragePartition;
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,12 @@
|
||||||
#include "atom/common/native_mate_converters/gfx_converter.h"
|
#include "atom/common/native_mate_converters/gfx_converter.h"
|
||||||
#include "atom/common/native_mate_converters/image_converter.h"
|
#include "atom/common/native_mate_converters/image_converter.h"
|
||||||
#include "atom/common/native_mate_converters/string16_converter.h"
|
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "native_mate/constructor.h"
|
#include "native_mate/constructor.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
#include "ui/events/event_constants.h"
|
#include "ui/events/event_constants.h"
|
||||||
#include "ui/gfx/image/image.h"
|
#include "ui/gfx/image/image.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
@ -35,7 +34,8 @@ Tray::~Tray() {
|
||||||
// static
|
// static
|
||||||
mate::Wrappable* Tray::New(v8::Isolate* isolate, const gfx::Image& image) {
|
mate::Wrappable* Tray::New(v8::Isolate* isolate, const gfx::Image& image) {
|
||||||
if (!Browser::Get()->is_ready()) {
|
if (!Browser::Get()->is_ready()) {
|
||||||
node::ThrowError(isolate, "Cannot create Tray before app is ready");
|
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
|
||||||
|
isolate, "Cannot create Tray before app is ready")));
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new Tray(image);
|
return new Tray(image);
|
||||||
|
|
|
@ -717,17 +717,19 @@ void WebContents::PrintToPDF(const base::DictionaryValue& setting,
|
||||||
PrintToPDF(setting, callback);
|
PrintToPDF(setting, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::AddWorkSpace(const base::FilePath& path) {
|
void WebContents::AddWorkSpace(mate::Arguments* args,
|
||||||
|
const base::FilePath& path) {
|
||||||
if (path.empty()) {
|
if (path.empty()) {
|
||||||
node::ThrowError(isolate(), "path cannot be empty");
|
args->ThrowError("path cannot be empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DevToolsAddFileSystem(path);
|
DevToolsAddFileSystem(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::RemoveWorkSpace(const base::FilePath& path) {
|
void WebContents::RemoveWorkSpace(mate::Arguments* args,
|
||||||
|
const base::FilePath& path) {
|
||||||
if (path.empty()) {
|
if (path.empty()) {
|
||||||
node::ThrowError(isolate(), "path cannot be empty");
|
args->ThrowError("path cannot be empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DevToolsRemoveFileSystem(path);
|
DevToolsRemoveFileSystem(path);
|
||||||
|
|
|
@ -87,8 +87,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
const PrintToPDFCallback& callback);
|
const PrintToPDFCallback& callback);
|
||||||
|
|
||||||
// DevTools workspace api.
|
// DevTools workspace api.
|
||||||
void AddWorkSpace(const base::FilePath& path);
|
void AddWorkSpace(mate::Arguments* args, const base::FilePath& path);
|
||||||
void RemoveWorkSpace(const base::FilePath& path);
|
void RemoveWorkSpace(mate::Arguments* args, const base::FilePath& path);
|
||||||
|
|
||||||
// Editing commands.
|
// Editing commands.
|
||||||
void Undo();
|
void Undo();
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#include "content/public/browser/browser_context.h"
|
#include "content/public/browser/browser_context.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
|
|
||||||
|
using atom::WebContentsPreferences;
|
||||||
|
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
@ -48,7 +50,7 @@ void AddGuest(int guest_instance_id,
|
||||||
manager->AddGuest(guest_instance_id, element_instance_id, embedder,
|
manager->AddGuest(guest_instance_id, element_instance_id, embedder,
|
||||||
guest_web_contents);
|
guest_web_contents);
|
||||||
|
|
||||||
atom::WebContentsPreferences::From(guest_web_contents)->Merge(options);
|
WebContentsPreferences::FromWebContents(guest_web_contents)->Merge(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveGuest(content::WebContents* embedder, int guest_instance_id) {
|
void RemoveGuest(content::WebContents* embedder, int guest_instance_id) {
|
||||||
|
|
|
@ -209,8 +209,8 @@ void Window::OnExecuteWindowsCommand(const std::string& command_name) {
|
||||||
mate::Wrappable* Window::New(v8::Isolate* isolate,
|
mate::Wrappable* Window::New(v8::Isolate* isolate,
|
||||||
const mate::Dictionary& options) {
|
const mate::Dictionary& options) {
|
||||||
if (!Browser::Get()->is_ready()) {
|
if (!Browser::Get()->is_ready()) {
|
||||||
node::ThrowError(isolate,
|
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
|
||||||
"Cannot create BrowserWindow before app is ready");
|
isolate, "Cannot create BrowserWindow before app is ready")));
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new Window(isolate, options);
|
return new Window(isolate, options);
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "atom/browser/node_debugger.h"
|
#include "atom/browser/node_debugger.h"
|
||||||
#include "atom/common/api/atom_bindings.h"
|
#include "atom/common/api/atom_bindings.h"
|
||||||
#include "atom/common/node_bindings.h"
|
#include "atom/common/node_bindings.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
#include "base/thread_task_runner_handle.h"
|
#include "base/thread_task_runner_handle.h"
|
||||||
#include "chrome/browser/browser_process.h"
|
#include "chrome/browser/browser_process.h"
|
||||||
|
@ -22,8 +23,6 @@
|
||||||
#include "chrome/browser/ui/libgtk2ui/gtk2_util.h"
|
#include "chrome/browser/ui/libgtk2ui/gtk2_util.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
|
@ -16,13 +16,12 @@
|
||||||
#include "ui/gfx/switches.h"
|
#include "ui/gfx/switches.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DEFINE_WEB_CONTENTS_USER_DATA_KEY(atom::WebContentsPreferences);
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// Pointer as WebContents's user data key.
|
|
||||||
const char* kWebPreferencesKey = "WebContentsPreferences";
|
|
||||||
|
|
||||||
// Array of available web runtime features.
|
// Array of available web runtime features.
|
||||||
const char* kWebRuntimeFeatures[] = {
|
const char* kWebRuntimeFeatures[] = {
|
||||||
switches::kExperimentalFeatures,
|
switches::kExperimentalFeatures,
|
||||||
|
@ -40,7 +39,7 @@ WebContentsPreferences::WebContentsPreferences(
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
base::DictionaryValue* web_preferences) {
|
base::DictionaryValue* web_preferences) {
|
||||||
web_preferences_.Swap(web_preferences);
|
web_preferences_.Swap(web_preferences);
|
||||||
web_contents->SetUserData(kWebPreferencesKey, this);
|
web_contents->SetUserData(UserDataKey(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebContentsPreferences::~WebContentsPreferences() {
|
WebContentsPreferences::~WebContentsPreferences() {
|
||||||
|
@ -50,17 +49,10 @@ void WebContentsPreferences::Merge(const base::DictionaryValue& extend) {
|
||||||
web_preferences_.MergeDictionary(&extend);
|
web_preferences_.MergeDictionary(&extend);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
|
||||||
WebContentsPreferences* WebContentsPreferences::From(
|
|
||||||
content::WebContents* web_contents) {
|
|
||||||
return static_cast<WebContentsPreferences*>(
|
|
||||||
web_contents->GetUserData(kWebPreferencesKey));
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void WebContentsPreferences::AppendExtraCommandLineSwitches(
|
void WebContentsPreferences::AppendExtraCommandLineSwitches(
|
||||||
content::WebContents* web_contents, base::CommandLine* command_line) {
|
content::WebContents* web_contents, base::CommandLine* command_line) {
|
||||||
WebContentsPreferences* self = From(web_contents);
|
WebContentsPreferences* self = FromWebContents(web_contents);
|
||||||
if (!self)
|
if (!self)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -130,7 +122,7 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
|
||||||
// static
|
// static
|
||||||
void WebContentsPreferences::OverrideWebkitPrefs(
|
void WebContentsPreferences::OverrideWebkitPrefs(
|
||||||
content::WebContents* web_contents, content::WebPreferences* prefs) {
|
content::WebContents* web_contents, content::WebPreferences* prefs) {
|
||||||
WebContentsPreferences* self = From(web_contents);
|
WebContentsPreferences* self = FromWebContents(web_contents);
|
||||||
if (!self)
|
if (!self)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,6 @@ namespace atom {
|
||||||
class WebContentsPreferences
|
class WebContentsPreferences
|
||||||
: public content::WebContentsUserData<WebContentsPreferences> {
|
: public content::WebContentsUserData<WebContentsPreferences> {
|
||||||
public:
|
public:
|
||||||
// Get the preferences of |web_contents|.
|
|
||||||
static WebContentsPreferences* From(content::WebContents* web_contents);
|
|
||||||
|
|
||||||
// Append command paramters according to |web_contents|'s preferences.
|
// Append command paramters according to |web_contents|'s preferences.
|
||||||
static void AppendExtraCommandLineSwitches(
|
static void AppendExtraCommandLineSwitches(
|
||||||
content::WebContents* web_contents, base::CommandLine* command_line);
|
content::WebContents* web_contents, base::CommandLine* command_line);
|
||||||
|
|
|
@ -10,13 +10,12 @@
|
||||||
#include "atom/common/asar/archive.h"
|
#include "atom/common/asar/archive.h"
|
||||||
#include "atom/common/native_mate_converters/callback.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/file_path_converter.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "native_mate/arguments.h"
|
#include "native_mate/arguments.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
#include "native_mate/object_template_builder.h"
|
#include "native_mate/object_template_builder.h"
|
||||||
#include "native_mate/wrappable.h"
|
#include "native_mate/wrappable.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class Archive : public mate::Wrappable {
|
class Archive : public mate::Wrappable {
|
||||||
|
|
|
@ -7,9 +7,8 @@
|
||||||
#include "atom/common/platform_util.h"
|
#include "atom/common/platform_util.h"
|
||||||
#include "atom/common/native_mate_converters/file_path_converter.h"
|
#include "atom/common/native_mate_converters/file_path_converter.h"
|
||||||
#include "atom/common/native_mate_converters/gurl_converter.h"
|
#include "atom/common/native_mate_converters/gurl_converter.h"
|
||||||
#include "native_mate/dictionary.h"
|
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
#include "atom/common/node_includes.h"
|
||||||
|
#include "native_mate/dictionary.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "atom/common/api/object_life_monitor.h"
|
#include "atom/common/api/object_life_monitor.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
#include "v8/include/v8-profiler.h"
|
#include "v8/include/v8-profiler.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
v8::Local<v8::Object> CreateObjectWithName(v8::Isolate* isolate,
|
v8::Local<v8::Object> CreateObjectWithName(v8::Isolate* isolate,
|
||||||
|
|
|
@ -5,11 +5,10 @@
|
||||||
#include "atom/common/api/event_emitter_caller.h"
|
#include "atom/common/api/event_emitter_caller.h"
|
||||||
|
|
||||||
#include "atom/common/api/locker.h"
|
#include "atom/common/api/locker.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
|
#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "atom/common/api/locker.h"
|
#include "atom/common/api/locker.h"
|
||||||
#include "atom/common/atom_command_line.h"
|
#include "atom/common/atom_command_line.h"
|
||||||
#include "atom/common/native_mate_converters/file_path_converter.h"
|
#include "atom/common/native_mate_converters/file_path_converter.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
#include "base/base_paths.h"
|
#include "base/base_paths.h"
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
|
@ -21,8 +22,6 @@
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
|
#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
using content::BrowserThread;
|
using content::BrowserThread;
|
||||||
|
|
||||||
// Force all builtin modules to be referenced so they can actually run their
|
// Force all builtin modules to be referenced so they can actually run their
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#ifndef ATOM_COMMON_NODE_INCLUDES_H_
|
#ifndef ATOM_COMMON_NODE_INCLUDES_H_
|
||||||
#define ATOM_COMMON_NODE_INCLUDES_H_
|
#define ATOM_COMMON_NODE_INCLUDES_H_
|
||||||
|
|
||||||
|
#include "base/logging.h"
|
||||||
|
|
||||||
// Include common headers for using node APIs.
|
// Include common headers for using node APIs.
|
||||||
|
|
||||||
#define BUILDING_NODE_EXTENSION
|
#define BUILDING_NODE_EXTENSION
|
||||||
|
|
|
@ -5,13 +5,12 @@
|
||||||
#include "atom/common/api/api_messages.h"
|
#include "atom/common/api/api_messages.h"
|
||||||
#include "atom/common/native_mate_converters/string16_converter.h"
|
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||||
#include "atom/common/native_mate_converters/value_converter.h"
|
#include "atom/common/native_mate_converters/value_converter.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "content/public/renderer/render_view.h"
|
#include "content/public/renderer/render_view.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
||||||
#include "third_party/WebKit/public/web/WebView.h"
|
#include "third_party/WebKit/public/web/WebView.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
using content::RenderView;
|
using content::RenderView;
|
||||||
using blink::WebLocalFrame;
|
using blink::WebLocalFrame;
|
||||||
using blink::WebView;
|
using blink::WebView;
|
||||||
|
@ -30,7 +29,7 @@ RenderView* GetCurrentRenderView() {
|
||||||
return RenderView::FromWebView(view);
|
return RenderView::FromWebView(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Send(v8::Isolate* isolate,
|
void Send(mate::Arguments* args,
|
||||||
const base::string16& channel,
|
const base::string16& channel,
|
||||||
const base::ListValue& arguments) {
|
const base::ListValue& arguments) {
|
||||||
RenderView* render_view = GetCurrentRenderView();
|
RenderView* render_view = GetCurrentRenderView();
|
||||||
|
@ -41,10 +40,10 @@ void Send(v8::Isolate* isolate,
|
||||||
render_view->GetRoutingID(), channel, arguments));
|
render_view->GetRoutingID(), channel, arguments));
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
node::ThrowError(isolate, "Unable to send AtomViewHostMsg_Message");
|
args->ThrowError("Unable to send AtomViewHostMsg_Message");
|
||||||
}
|
}
|
||||||
|
|
||||||
base::string16 SendSync(v8::Isolate* isolate,
|
base::string16 SendSync(mate::Arguments* args,
|
||||||
const base::string16& channel,
|
const base::string16& channel,
|
||||||
const base::ListValue& arguments) {
|
const base::ListValue& arguments) {
|
||||||
base::string16 json;
|
base::string16 json;
|
||||||
|
@ -60,7 +59,7 @@ base::string16 SendSync(v8::Isolate* isolate,
|
||||||
bool success = render_view->Send(message);
|
bool success = render_view->Send(message);
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
node::ThrowError(isolate, "Unable to send AtomViewHostMsg_Message_Sync");
|
args->ThrowError("Unable to send AtomViewHostMsg_Message_Sync");
|
||||||
|
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "atom/common/api/api_messages.h"
|
#include "atom/common/api/api_messages.h"
|
||||||
#include "atom/common/api/event_emitter_caller.h"
|
#include "atom/common/api/event_emitter_caller.h"
|
||||||
#include "atom/common/native_mate_converters/value_converter.h"
|
#include "atom/common/native_mate_converters/value_converter.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
#include "atom/common/options_switches.h"
|
#include "atom/common/options_switches.h"
|
||||||
#include "atom/renderer/atom_renderer_client.h"
|
#include "atom/renderer/atom_renderer_client.h"
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
|
@ -31,8 +32,6 @@
|
||||||
#include "third_party/WebKit/public/web/WebView.h"
|
#include "third_party/WebKit/public/web/WebView.h"
|
||||||
#include "ui/base/resource/resource_bundle.h"
|
#include "ui/base/resource/resource_bundle.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
2
vendor/node
vendored
2
vendor/node
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 5a8258dfabe7ce3e1489b13d3459ef1d6260d6a5
|
Subproject commit c8962e460f3bf03d405489a8380a5571730f5f8d
|
Loading…
Add table
Add a link
Reference in a new issue