commit
c65ccb6857
42 changed files with 305 additions and 98 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -17,4 +17,3 @@ node_modules/
|
||||||
*.pyc
|
*.pyc
|
||||||
debug.log
|
debug.log
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
atom/common/chrome_version.h
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
#include "atom/app/node_main.h"
|
#include "atom/app/node_main.h"
|
||||||
#include "atom/common/atom_command_line.h"
|
#include "atom/common/atom_command_line.h"
|
||||||
|
#include "base/at_exit.h"
|
||||||
#include "base/i18n/icu_util.h"
|
#include "base/i18n/icu_util.h"
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
|
@ -134,6 +135,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
|
||||||
if (env->GetVar("ATOM_SHELL_INTERNAL_RUN_AS_NODE", &node_indicator) &&
|
if (env->GetVar("ATOM_SHELL_INTERNAL_RUN_AS_NODE", &node_indicator) &&
|
||||||
node_indicator == "1") {
|
node_indicator == "1") {
|
||||||
// Now that argv conversion is done, we can finally start.
|
// Now that argv conversion is done, we can finally start.
|
||||||
|
base::AtExitManager atexit_manager;
|
||||||
base::i18n::InitializeICU();
|
base::i18n::InitializeICU();
|
||||||
return atom::NodeMain(argc, argv);
|
return atom::NodeMain(argc, argv);
|
||||||
} else if (env->GetVar("ATOM_SHELL_INTERNAL_CRASH_SERVICE",
|
} else if (env->GetVar("ATOM_SHELL_INTERNAL_CRASH_SERVICE",
|
||||||
|
@ -165,6 +167,7 @@ int main(int argc, const char* argv[]) {
|
||||||
char* node_indicator = getenv("ATOM_SHELL_INTERNAL_RUN_AS_NODE");
|
char* node_indicator = getenv("ATOM_SHELL_INTERNAL_RUN_AS_NODE");
|
||||||
if (node_indicator != NULL && strcmp(node_indicator, "1") == 0) {
|
if (node_indicator != NULL && strcmp(node_indicator, "1") == 0) {
|
||||||
base::i18n::InitializeICU();
|
base::i18n::InitializeICU();
|
||||||
|
base::AtExitManager atexit_manager;
|
||||||
return atom::NodeMain(argc, const_cast<char**>(argv));
|
return atom::NodeMain(argc, const_cast<char**>(argv));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,12 @@
|
||||||
|
|
||||||
#include "atom/app/node_main.h"
|
#include "atom/app/node_main.h"
|
||||||
|
|
||||||
|
#include "atom/app/uv_task_runner.h"
|
||||||
#include "atom/browser/javascript_environment.h"
|
#include "atom/browser/javascript_environment.h"
|
||||||
#include "atom/browser/node_debugger.h"
|
#include "atom/browser/node_debugger.h"
|
||||||
#include "atom/common/node_includes.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 "gin/array_buffer.h"
|
#include "gin/array_buffer.h"
|
||||||
#include "gin/public/isolate_holder.h"
|
#include "gin/public/isolate_holder.h"
|
||||||
#include "gin/v8_initializer.h"
|
#include "gin/v8_initializer.h"
|
||||||
|
@ -24,14 +26,20 @@ int NodeMain(int argc, char *argv[]) {
|
||||||
|
|
||||||
int exit_code = 1;
|
int exit_code = 1;
|
||||||
{
|
{
|
||||||
|
// Feed gin::PerIsolateData with a task runner.
|
||||||
|
uv_loop_t* loop = uv_default_loop();
|
||||||
|
scoped_refptr<UvTaskRunner> uv_task_runner(new UvTaskRunner(loop));
|
||||||
|
base::ThreadTaskRunnerHandle handle(uv_task_runner);
|
||||||
|
|
||||||
gin::V8Initializer::LoadV8Snapshot();
|
gin::V8Initializer::LoadV8Snapshot();
|
||||||
|
gin::V8Initializer::LoadV8Natives();
|
||||||
gin::IsolateHolder::Initialize(
|
gin::IsolateHolder::Initialize(
|
||||||
gin::IsolateHolder::kNonStrictMode,
|
gin::IsolateHolder::kNonStrictMode,
|
||||||
gin::ArrayBufferAllocator::SharedInstance());
|
gin::ArrayBufferAllocator::SharedInstance());
|
||||||
|
|
||||||
JavascriptEnvironment gin_env;
|
JavascriptEnvironment gin_env;
|
||||||
node::Environment* env = node::CreateEnvironment(
|
node::Environment* env = node::CreateEnvironment(
|
||||||
gin_env.isolate(), uv_default_loop(), gin_env.context(), argc, argv,
|
gin_env.isolate(), loop, gin_env.context(), argc, argv,
|
||||||
exec_argc, exec_argv);
|
exec_argc, exec_argv);
|
||||||
|
|
||||||
// Start our custom debugger implementation.
|
// Start our custom debugger implementation.
|
||||||
|
|
55
atom/app/uv_task_runner.cc
Normal file
55
atom/app/uv_task_runner.cc
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
// Copyright (c) 2015 GitHub, Inc.
|
||||||
|
// Use of this source code is governed by the MIT license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "atom/app/uv_task_runner.h"
|
||||||
|
|
||||||
|
#include "base/stl_util.h"
|
||||||
|
|
||||||
|
namespace atom {
|
||||||
|
|
||||||
|
UvTaskRunner::UvTaskRunner(uv_loop_t* loop) : loop_(loop) {
|
||||||
|
}
|
||||||
|
|
||||||
|
UvTaskRunner::~UvTaskRunner() {
|
||||||
|
for (auto& iter : tasks_) {
|
||||||
|
uv_unref(reinterpret_cast<uv_handle_t*>(iter.first));
|
||||||
|
delete iter.first;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UvTaskRunner::PostDelayedTask(const tracked_objects::Location& from_here,
|
||||||
|
const base::Closure& task,
|
||||||
|
base::TimeDelta delay) {
|
||||||
|
uv_timer_t* timer = new uv_timer_t;
|
||||||
|
timer->data = this;
|
||||||
|
uv_timer_init(loop_, timer);
|
||||||
|
uv_timer_start(timer, UvTaskRunner::OnTimeout, delay.InMilliseconds(), 0);
|
||||||
|
tasks_[timer] = task;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UvTaskRunner::RunsTasksOnCurrentThread() const {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UvTaskRunner::PostNonNestableDelayedTask(
|
||||||
|
const tracked_objects::Location& from_here,
|
||||||
|
const base::Closure& task,
|
||||||
|
base::TimeDelta delay) {
|
||||||
|
return PostDelayedTask(from_here, task, delay);;
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
void UvTaskRunner::OnTimeout(uv_timer_t* timer) {
|
||||||
|
UvTaskRunner* self = static_cast<UvTaskRunner*>(timer->data);
|
||||||
|
if (!ContainsKey(self->tasks_, timer))
|
||||||
|
return;
|
||||||
|
|
||||||
|
self->tasks_[timer].Run();
|
||||||
|
self->tasks_.erase(timer);
|
||||||
|
uv_unref(reinterpret_cast<uv_handle_t*>(timer));
|
||||||
|
delete timer;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace atom
|
44
atom/app/uv_task_runner.h
Normal file
44
atom/app/uv_task_runner.h
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
// Copyright (c) 2015 GitHub, Inc.
|
||||||
|
// Use of this source code is governed by the MIT license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef ATOM_APP_UV_TASK_RUNNER_H_
|
||||||
|
#define ATOM_APP_UV_TASK_RUNNER_H_
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
#include "base/callback.h"
|
||||||
|
#include "base/single_thread_task_runner.h"
|
||||||
|
#include "vendor/node/deps/uv/include/uv.h"
|
||||||
|
|
||||||
|
namespace atom {
|
||||||
|
|
||||||
|
// TaskRunner implementation that posts tasks into libuv's default loop.
|
||||||
|
class UvTaskRunner : public base::SingleThreadTaskRunner {
|
||||||
|
public:
|
||||||
|
explicit UvTaskRunner(uv_loop_t* loop);
|
||||||
|
~UvTaskRunner() override;
|
||||||
|
|
||||||
|
// base::SingleThreadTaskRunner:
|
||||||
|
bool PostDelayedTask(const tracked_objects::Location& from_here,
|
||||||
|
const base::Closure& task,
|
||||||
|
base::TimeDelta delay) override;
|
||||||
|
bool RunsTasksOnCurrentThread() const override;
|
||||||
|
bool PostNonNestableDelayedTask(
|
||||||
|
const tracked_objects::Location& from_here,
|
||||||
|
const base::Closure& task,
|
||||||
|
base::TimeDelta delay) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static void OnTimeout(uv_timer_t* timer);
|
||||||
|
|
||||||
|
uv_loop_t* loop_;
|
||||||
|
|
||||||
|
std::map<uv_timer_t*, base::Closure> tasks_;
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(UvTaskRunner);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace atom
|
||||||
|
|
||||||
|
#endif // ATOM_APP_UV_TASK_RUNNER_H_
|
|
@ -19,27 +19,19 @@ using content::TracingController;
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct Converter<base::trace_event::CategoryFilter> {
|
struct Converter<base::trace_event::TraceConfig> {
|
||||||
static bool FromV8(v8::Isolate* isolate,
|
static bool FromV8(v8::Isolate* isolate,
|
||||||
v8::Local<v8::Value> val,
|
v8::Local<v8::Value> val,
|
||||||
base::trace_event::CategoryFilter* out) {
|
base::trace_event::TraceConfig* out) {
|
||||||
std::string filter;
|
Dictionary options;
|
||||||
if (!ConvertFromV8(isolate, val, &filter))
|
|
||||||
return false;
|
|
||||||
*out = base::trace_event::CategoryFilter(filter);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<>
|
|
||||||
struct Converter<base::trace_event::TraceOptions> {
|
|
||||||
static bool FromV8(v8::Isolate* isolate,
|
|
||||||
v8::Local<v8::Value> val,
|
|
||||||
base::trace_event::TraceOptions* out) {
|
|
||||||
std::string options;
|
|
||||||
if (!ConvertFromV8(isolate, val, &options))
|
if (!ConvertFromV8(isolate, val, &options))
|
||||||
return false;
|
return false;
|
||||||
return out->SetFromString(options);
|
std::string category_filter, trace_options;
|
||||||
|
if (!options.Get("categoryFilter", &category_filter) ||
|
||||||
|
!options.Get("traceOptions", &trace_options))
|
||||||
|
return false;
|
||||||
|
*out = base::trace_event::TraceConfig(category_filter, trace_options);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -217,7 +217,7 @@ bool WebContents::ShouldCreateWebContents(
|
||||||
int route_id,
|
int route_id,
|
||||||
int main_frame_route_id,
|
int main_frame_route_id,
|
||||||
WindowContainerType window_container_type,
|
WindowContainerType window_container_type,
|
||||||
const base::string16& frame_name,
|
const std::string& frame_name,
|
||||||
const GURL& target_url,
|
const GURL& target_url,
|
||||||
const std::string& partition_id,
|
const std::string& partition_id,
|
||||||
content::SessionStorageNamespace* session_storage_namespace) {
|
content::SessionStorageNamespace* session_storage_namespace) {
|
||||||
|
@ -362,14 +362,16 @@ void WebContents::DidFailProvisionalLoad(
|
||||||
content::RenderFrameHost* render_frame_host,
|
content::RenderFrameHost* render_frame_host,
|
||||||
const GURL& validated_url,
|
const GURL& validated_url,
|
||||||
int error_code,
|
int error_code,
|
||||||
const base::string16& error_description) {
|
const base::string16& error_description,
|
||||||
|
bool was_ignored_by_handler) {
|
||||||
Emit("did-fail-load", error_code, error_description);
|
Emit("did-fail-load", error_code, error_description);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
|
void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
|
||||||
const GURL& validated_url,
|
const GURL& validated_url,
|
||||||
int error_code,
|
int error_code,
|
||||||
const base::string16& error_description) {
|
const base::string16& error_description,
|
||||||
|
bool was_ignored_by_handler) {
|
||||||
Emit("did-fail-load", error_code, error_description);
|
Emit("did-fail-load", error_code, error_description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
int route_id,
|
int route_id,
|
||||||
int main_frame_route_id,
|
int main_frame_route_id,
|
||||||
WindowContainerType window_container_type,
|
WindowContainerType window_container_type,
|
||||||
const base::string16& frame_name,
|
const std::string& frame_name,
|
||||||
const GURL& target_url,
|
const GURL& target_url,
|
||||||
const std::string& partition_id,
|
const std::string& partition_id,
|
||||||
content::SessionStorageNamespace* session_storage_namespace) override;
|
content::SessionStorageNamespace* session_storage_namespace) override;
|
||||||
|
@ -170,11 +170,13 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
void DidFailLoad(content::RenderFrameHost* render_frame_host,
|
void DidFailLoad(content::RenderFrameHost* render_frame_host,
|
||||||
const GURL& validated_url,
|
const GURL& validated_url,
|
||||||
int error_code,
|
int error_code,
|
||||||
const base::string16& error_description) override;
|
const base::string16& error_description,
|
||||||
|
bool was_ignored_by_handler) override;
|
||||||
void DidFailProvisionalLoad(content::RenderFrameHost* render_frame_host,
|
void DidFailProvisionalLoad(content::RenderFrameHost* render_frame_host,
|
||||||
const GURL& validated_url,
|
const GURL& validated_url,
|
||||||
int error_code,
|
int error_code,
|
||||||
const base::string16& error_description) override;
|
const base::string16& error_description,
|
||||||
|
bool was_ignored_by_handler) override;
|
||||||
void DidStartLoading() override;
|
void DidStartLoading() override;
|
||||||
void DidStopLoading() override;
|
void DidStopLoading() override;
|
||||||
void DidGetResourceResponseStart(
|
void DidGetResourceResponseStart(
|
||||||
|
|
|
@ -7,12 +7,14 @@
|
||||||
#include "atom/browser/api/trackable_object.h"
|
#include "atom/browser/api/trackable_object.h"
|
||||||
#include "atom/browser/atom_browser_client.h"
|
#include "atom/browser/atom_browser_client.h"
|
||||||
#include "atom/browser/atom_browser_context.h"
|
#include "atom/browser/atom_browser_context.h"
|
||||||
|
#include "atom/browser/bridge_task_runner.h"
|
||||||
#include "atom/browser/browser.h"
|
#include "atom/browser/browser.h"
|
||||||
#include "atom/browser/javascript_environment.h"
|
#include "atom/browser/javascript_environment.h"
|
||||||
#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 "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
|
#include "base/thread_task_runner_handle.h"
|
||||||
#include "chrome/browser/browser_process.h"
|
#include "chrome/browser/browser_process.h"
|
||||||
#include "v8/include/v8-debug.h"
|
#include "v8/include/v8-debug.h"
|
||||||
|
|
||||||
|
@ -64,9 +66,17 @@ void AtomBrowserMainParts::PostEarlyInitialization() {
|
||||||
SetDPIFromGSettings();
|
SetDPIFromGSettings();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The ProxyResolverV8 has setup a complete V8 environment, in order to avoid
|
{
|
||||||
// conflicts we only initialize our V8 environment after that.
|
// Temporary set the bridge_task_runner_ as current thread's task runner,
|
||||||
|
// so we can fool gin::PerIsolateData to use it as its task runner, instead
|
||||||
|
// of getting current message loop's task runner, which is null for now.
|
||||||
|
bridge_task_runner_ = new BridgeTaskRunner;
|
||||||
|
base::ThreadTaskRunnerHandle handle(bridge_task_runner_);
|
||||||
|
|
||||||
|
// The ProxyResolverV8 has setup a complete V8 environment, in order to
|
||||||
|
// avoid conflicts we only initialize our V8 environment after that.
|
||||||
js_env_.reset(new JavascriptEnvironment);
|
js_env_.reset(new JavascriptEnvironment);
|
||||||
|
}
|
||||||
|
|
||||||
node_bindings_->Initialize();
|
node_bindings_->Initialize();
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ class Browser;
|
||||||
class JavascriptEnvironment;
|
class JavascriptEnvironment;
|
||||||
class NodeBindings;
|
class NodeBindings;
|
||||||
class NodeDebugger;
|
class NodeDebugger;
|
||||||
|
class BridgeTaskRunner;
|
||||||
|
|
||||||
class AtomBrowserMainParts : public brightray::BrowserMainParts {
|
class AtomBrowserMainParts : public brightray::BrowserMainParts {
|
||||||
public:
|
public:
|
||||||
|
@ -54,6 +55,10 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
|
||||||
// A fake BrowserProcess object that used to feed the source code from chrome.
|
// A fake BrowserProcess object that used to feed the source code from chrome.
|
||||||
scoped_ptr<BrowserProcess> fake_browser_process_;
|
scoped_ptr<BrowserProcess> fake_browser_process_;
|
||||||
|
|
||||||
|
// The gin::PerIsolateData requires a task runner to create, so we feed it
|
||||||
|
// with a task runner that will post all work to main loop.
|
||||||
|
scoped_refptr<BridgeTaskRunner> bridge_task_runner_;
|
||||||
|
|
||||||
scoped_ptr<Browser> browser_;
|
scoped_ptr<Browser> browser_;
|
||||||
scoped_ptr<JavascriptEnvironment> js_env_;
|
scoped_ptr<JavascriptEnvironment> js_env_;
|
||||||
scoped_ptr<NodeBindings> node_bindings_;
|
scoped_ptr<NodeBindings> node_bindings_;
|
||||||
|
|
42
atom/browser/bridge_task_runner.cc
Normal file
42
atom/browser/bridge_task_runner.cc
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
// Copyright (c) 2015 GitHub, Inc.
|
||||||
|
// Use of this source code is governed by the MIT license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "atom/browser/bridge_task_runner.h"
|
||||||
|
|
||||||
|
#include "base/message_loop/message_loop.h"
|
||||||
|
|
||||||
|
namespace atom {
|
||||||
|
|
||||||
|
bool BridgeTaskRunner::PostDelayedTask(
|
||||||
|
const tracked_objects::Location& from_here,
|
||||||
|
const base::Closure& task,
|
||||||
|
base::TimeDelta delay) {
|
||||||
|
auto message_loop = base::MessageLoop::current();
|
||||||
|
if (!message_loop)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return message_loop->task_runner()->PostDelayedTask(from_here, task, delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BridgeTaskRunner::RunsTasksOnCurrentThread() const {
|
||||||
|
auto message_loop = base::MessageLoop::current();
|
||||||
|
if (!message_loop)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return message_loop->task_runner()->RunsTasksOnCurrentThread();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BridgeTaskRunner::PostNonNestableDelayedTask(
|
||||||
|
const tracked_objects::Location& from_here,
|
||||||
|
const base::Closure& task,
|
||||||
|
base::TimeDelta delay) {
|
||||||
|
auto message_loop = base::MessageLoop::current();
|
||||||
|
if (!message_loop)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return message_loop->task_runner()->PostNonNestableDelayedTask(
|
||||||
|
from_here, task, delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace atom
|
35
atom/browser/bridge_task_runner.h
Normal file
35
atom/browser/bridge_task_runner.h
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
// Copyright (c) 2015 GitHub, Inc.
|
||||||
|
// Use of this source code is governed by the MIT license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef ATOM_BROWSER_BRIDGE_TASK_RUNNER_H_
|
||||||
|
#define ATOM_BROWSER_BRIDGE_TASK_RUNNER_H_
|
||||||
|
|
||||||
|
#include "base/single_thread_task_runner.h"
|
||||||
|
|
||||||
|
namespace atom {
|
||||||
|
|
||||||
|
// Post all tasks to the current message loop's task runner if available,
|
||||||
|
// otherwise fail silently.
|
||||||
|
class BridgeTaskRunner : public base::SingleThreadTaskRunner {
|
||||||
|
public:
|
||||||
|
BridgeTaskRunner() {}
|
||||||
|
~BridgeTaskRunner() override {}
|
||||||
|
|
||||||
|
// base::SingleThreadTaskRunner:
|
||||||
|
bool PostDelayedTask(const tracked_objects::Location& from_here,
|
||||||
|
const base::Closure& task,
|
||||||
|
base::TimeDelta delay) override;
|
||||||
|
bool RunsTasksOnCurrentThread() const override;
|
||||||
|
bool PostNonNestableDelayedTask(
|
||||||
|
const tracked_objects::Location& from_here,
|
||||||
|
const base::Closure& task,
|
||||||
|
base::TimeDelta delay) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(BridgeTaskRunner);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace atom
|
||||||
|
|
||||||
|
#endif // ATOM_BROWSER_BRIDGE_TASK_RUNNER_H_
|
|
@ -153,7 +153,7 @@ class Browser : public WindowListObserver {
|
||||||
void OnWindowAllClosed() override;
|
void OnWindowAllClosed() override;
|
||||||
|
|
||||||
// Observers of the browser.
|
// Observers of the browser.
|
||||||
ObserverList<BrowserObserver> observers_;
|
base::ObserverList<BrowserObserver> observers_;
|
||||||
|
|
||||||
// Whether "ready" event has been emitted.
|
// Whether "ready" event has been emitted.
|
||||||
bool is_ready_;
|
bool is_ready_;
|
||||||
|
|
|
@ -310,7 +310,7 @@ class NativeWindow : public content::WebContentsObserver,
|
||||||
brightray::InspectableWebContents* inspectable_web_contents_;
|
brightray::InspectableWebContents* inspectable_web_contents_;
|
||||||
|
|
||||||
// Observers of this window.
|
// Observers of this window.
|
||||||
ObserverList<NativeWindowObserver> observers_;
|
base::ObserverList<NativeWindowObserver> observers_;
|
||||||
|
|
||||||
base::WeakPtrFactory<NativeWindow> weak_factory_;
|
base::WeakPtrFactory<NativeWindow> weak_factory_;
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ bool URLRequestAsarJob::IsRedirectResponse(GURL* location,
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
// Follow a Windows shortcut.
|
// Follow a Windows shortcut.
|
||||||
// We just resolve .lnk file, ignore others.
|
// We just resolve .lnk file, ignore others.
|
||||||
if (!LowerCaseEqualsASCII(file_path_.Extension(), ".lnk"))
|
if (!base::LowerCaseEqualsASCII(file_path_.Extension(), ".lnk"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
base::FilePath new_path = file_path_;
|
base::FilePath new_path = file_path_;
|
||||||
|
@ -193,7 +193,7 @@ bool URLRequestAsarJob::IsRedirectResponse(GURL* location,
|
||||||
|
|
||||||
net::Filter* URLRequestAsarJob::SetupFilter() const {
|
net::Filter* URLRequestAsarJob::SetupFilter() const {
|
||||||
// Bug 9936 - .svgz files needs to be decompressed.
|
// Bug 9936 - .svgz files needs to be decompressed.
|
||||||
return LowerCaseEqualsASCII(file_path_.Extension(), ".svgz")
|
return base::LowerCaseEqualsASCII(file_path_.Extension(), ".svgz")
|
||||||
? net::Filter::GZipFactory() : NULL;
|
? net::Filter::GZipFactory() : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,8 +265,7 @@ void URLRequestAsarJob::DidOpen(int result) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type_ == TYPE_ASAR) {
|
if (type_ == TYPE_ASAR) {
|
||||||
int rv = stream_->Seek(base::File::FROM_BEGIN,
|
int rv = stream_->Seek(file_info_.offset,
|
||||||
file_info_.offset,
|
|
||||||
base::Bind(&URLRequestAsarJob::DidSeek,
|
base::Bind(&URLRequestAsarJob::DidSeek,
|
||||||
weak_ptr_factory_.GetWeakPtr()));
|
weak_ptr_factory_.GetWeakPtr()));
|
||||||
if (rv != net::ERR_IO_PENDING) {
|
if (rv != net::ERR_IO_PENDING) {
|
||||||
|
@ -285,8 +284,7 @@ void URLRequestAsarJob::DidOpen(int result) {
|
||||||
byte_range_.first_byte_position() + 1;
|
byte_range_.first_byte_position() + 1;
|
||||||
|
|
||||||
if (remaining_bytes_ > 0 && byte_range_.first_byte_position() != 0) {
|
if (remaining_bytes_ > 0 && byte_range_.first_byte_position() != 0) {
|
||||||
int rv = stream_->Seek(base::File::FROM_BEGIN,
|
int rv = stream_->Seek(byte_range_.first_byte_position(),
|
||||||
byte_range_.first_byte_position(),
|
|
||||||
base::Bind(&URLRequestAsarJob::DidSeek,
|
base::Bind(&URLRequestAsarJob::DidSeek,
|
||||||
weak_ptr_factory_.GetWeakPtr()));
|
weak_ptr_factory_.GetWeakPtr()));
|
||||||
if (rv != net::ERR_IO_PENDING) {
|
if (rv != net::ERR_IO_PENDING) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace {
|
||||||
|
|
||||||
// Convert string to RequestType.
|
// Convert string to RequestType.
|
||||||
net::URLFetcher::RequestType GetRequestType(const std::string& raw) {
|
net::URLFetcher::RequestType GetRequestType(const std::string& raw) {
|
||||||
std::string method = StringToUpperASCII(raw);
|
std::string method = base::StringToUpperASCII(raw);
|
||||||
if (method.empty() || method == "GET")
|
if (method.empty() || method == "GET")
|
||||||
return net::URLFetcher::GET;
|
return net::URLFetcher::GET;
|
||||||
else if (method == "POST")
|
else if (method == "POST")
|
||||||
|
|
|
@ -43,7 +43,7 @@ class AtomMenuModel : public ui::SimpleMenuModel {
|
||||||
Delegate* delegate_; // weak ref.
|
Delegate* delegate_; // weak ref.
|
||||||
|
|
||||||
std::map<int, base::string16> roles_;
|
std::map<int, base::string16> roles_;
|
||||||
ObserverList<Observer> observers_;
|
base::ObserverList<Observer> observers_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(AtomMenuModel);
|
DISALLOW_COPY_AND_ASSIGN(AtomMenuModel);
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,7 @@ gboolean FileFilterCaseInsensitive(const GtkFileFilterInfo* file_info,
|
||||||
// Makes .* file extension matches all file types.
|
// Makes .* file extension matches all file types.
|
||||||
if (*file_extension == ".*")
|
if (*file_extension == ".*")
|
||||||
return true;
|
return true;
|
||||||
return EndsWith(file_info->filename, *file_extension, false);
|
return base::EndsWith(file_info->filename, *file_extension, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deletes |data| when gtk_file_filter_add_custom() is done with it.
|
// Deletes |data| when gtk_file_filter_add_custom() is done with it.
|
||||||
|
|
|
@ -252,7 +252,7 @@ bool ShowSaveDialog(atom::NativeWindow* parent_window,
|
||||||
|
|
||||||
bool matched = false;
|
bool matched = false;
|
||||||
for (size_t i = 0; i < filter.second.size(); ++i) {
|
for (size_t i = 0; i < filter.second.size(); ++i) {
|
||||||
if (EndsWith(file_name, filter.second[i], false)) {
|
if (base::EndsWith(file_name, filter.second[i], false)) {
|
||||||
matched = true;
|
matched = true;
|
||||||
break;;
|
break;;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ class TrayIcon {
|
||||||
TrayIcon();
|
TrayIcon();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ObserverList<TrayIconObserver> observers_;
|
base::ObserverList<TrayIconObserver> observers_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TrayIcon);
|
DISALLOW_COPY_AND_ASSIGN(TrayIcon);
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,7 +41,7 @@ void SetWindowType(::Window xwindow, const std::string& type) {
|
||||||
XDisplay* xdisplay = gfx::GetXDisplay();
|
XDisplay* xdisplay = gfx::GetXDisplay();
|
||||||
std::string type_prefix = "_NET_WM_WINDOW_TYPE_";
|
std::string type_prefix = "_NET_WM_WINDOW_TYPE_";
|
||||||
::Atom window_type = XInternAtom(
|
::Atom window_type = XInternAtom(
|
||||||
xdisplay, (type_prefix + StringToUpperASCII(type)).c_str(), False);
|
xdisplay, (type_prefix + base::StringToUpperASCII(type)).c_str(), False);
|
||||||
XChangeProperty(xdisplay, xwindow,
|
XChangeProperty(xdisplay, xwindow,
|
||||||
XInternAtom(xdisplay, "_NET_WM_WINDOW_TYPE", False),
|
XInternAtom(xdisplay, "_NET_WM_WINDOW_TYPE", False),
|
||||||
XA_ATOM,
|
XA_ATOM,
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
// static
|
// static
|
||||||
base::LazyInstance<ObserverList<WindowListObserver>>::Leaky
|
base::LazyInstance<base::ObserverList<WindowListObserver>>::Leaky
|
||||||
WindowList::observers_ = LAZY_INSTANCE_INITIALIZER;
|
WindowList::observers_ = LAZY_INSTANCE_INITIALIZER;
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
|
@ -60,7 +60,8 @@ class WindowList {
|
||||||
|
|
||||||
// A list of observers which will be notified of every window addition and
|
// A list of observers which will be notified of every window addition and
|
||||||
// removal across all WindowLists.
|
// removal across all WindowLists.
|
||||||
static base::LazyInstance<ObserverList<WindowListObserver>>::Leaky observers_;
|
static base::LazyInstance<base::ObserverList<WindowListObserver>>::Leaky
|
||||||
|
observers_;
|
||||||
|
|
||||||
static WindowList* instance_;
|
static WindowList* instance_;
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "atom/common/node_includes.h"
|
#include "atom/common/node_includes.h"
|
||||||
#include "base/base64.h"
|
#include "base/base64.h"
|
||||||
#include "base/strings/string_util.h"
|
#include "base/strings/string_util.h"
|
||||||
|
#include "base/strings/pattern.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 "net/base/data_url.h"
|
#include "net/base/data_url.h"
|
||||||
|
@ -62,7 +63,7 @@ float GetScaleFactorFromPath(const base::FilePath& path) {
|
||||||
// We don't try to convert string to float here because it is very very
|
// We don't try to convert string to float here because it is very very
|
||||||
// expensive.
|
// expensive.
|
||||||
for (unsigned i = 0; i < arraysize(kScaleFactorPairs); ++i) {
|
for (unsigned i = 0; i < arraysize(kScaleFactorPairs); ++i) {
|
||||||
if (EndsWith(filename, kScaleFactorPairs[i].name, true))
|
if (base::EndsWith(filename, kScaleFactorPairs[i].name, true))
|
||||||
return kScaleFactorPairs[i].scale;
|
return kScaleFactorPairs[i].scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +105,7 @@ bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image,
|
||||||
const base::FilePath& path) {
|
const base::FilePath& path) {
|
||||||
bool succeed = false;
|
bool succeed = false;
|
||||||
std::string filename(path.BaseName().RemoveExtension().AsUTF8Unsafe());
|
std::string filename(path.BaseName().RemoveExtension().AsUTF8Unsafe());
|
||||||
if (MatchPattern(filename, "*@*x"))
|
if (base::MatchPattern(filename, "*@*x"))
|
||||||
// Don't search for other representations if the DPI has been specified.
|
// Don't search for other representations if the DPI has been specified.
|
||||||
return AddImageSkiaRep(image, path, GetScaleFactorFromPath(path));
|
return AddImageSkiaRep(image, path, GetScaleFactorFromPath(path));
|
||||||
else
|
else
|
||||||
|
@ -119,8 +120,8 @@ bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image,
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
bool IsTemplateFilename(const base::FilePath& path) {
|
bool IsTemplateFilename(const base::FilePath& path) {
|
||||||
return (MatchPattern(path.value(), "*Template.*") ||
|
return (base::MatchPattern(path.value(), "*Template.*") ||
|
||||||
MatchPattern(path.value(), "*Template@*x.*"));
|
base::MatchPattern(path.value(), "*Template@*x.*"));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,8 @@ bool Archive::Init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 size;
|
uint32 size;
|
||||||
if (!PickleIterator(Pickle(buf.data(), buf.size())).ReadUInt32(&size)) {
|
if (!base::PickleIterator(base::Pickle(buf.data(), buf.size())).ReadUInt32(
|
||||||
|
&size)) {
|
||||||
LOG(ERROR) << "Failed to parse header size from " << path_.value();
|
LOG(ERROR) << "Failed to parse header size from " << path_.value();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -149,7 +150,8 @@ bool Archive::Init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string header;
|
std::string header;
|
||||||
if (!PickleIterator(Pickle(buf.data(), buf.size())).ReadString(&header)) {
|
if (!base::PickleIterator(base::Pickle(buf.data(), buf.size())).ReadString(
|
||||||
|
&header)) {
|
||||||
LOG(ERROR) << "Failed to parse header from " << path_.value();
|
LOG(ERROR) << "Failed to parse header from " << path_.value();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#ifndef ATOM_COMMON_CHROME_VERSION_H_
|
#ifndef ATOM_COMMON_CHROME_VERSION_H_
|
||||||
#define ATOM_COMMON_CHROME_VERSION_H_
|
#define ATOM_COMMON_CHROME_VERSION_H_
|
||||||
|
|
||||||
#define CHROME_VERSION_STRING "44.0.2403.125"
|
#define CHROME_VERSION_STRING "45.0.2454.85"
|
||||||
#define CHROME_VERSION "v" CHROME_VERSION_STRING
|
#define CHROME_VERSION "v" CHROME_VERSION_STRING
|
||||||
|
|
||||||
#endif // ATOM_COMMON_CHROME_VERSION_H_
|
#endif // ATOM_COMMON_CHROME_VERSION_H_
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include "third_party/WebKit/public/web/WebPluginParams.h"
|
#include "third_party/WebKit/public/web/WebPluginParams.h"
|
||||||
#include "third_party/WebKit/public/web/WebKit.h"
|
#include "third_party/WebKit/public/web/WebKit.h"
|
||||||
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
|
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
|
||||||
#include "third_party/WebKit/Source/wtf/ArrayBufferContents.h"
|
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
#include "atom/common/node_includes.h"
|
||||||
|
|
||||||
|
@ -205,7 +204,7 @@ void AtomRendererClient::DidCreateScriptContext(
|
||||||
node_bindings_->LoadEnvironment(env);
|
node_bindings_->LoadEnvironment(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AtomRendererClient::ShouldFork(blink::WebFrame* frame,
|
bool AtomRendererClient::ShouldFork(blink::WebLocalFrame* frame,
|
||||||
const GURL& url,
|
const GURL& url,
|
||||||
const std::string& http_method,
|
const std::string& http_method,
|
||||||
bool is_initial_navigation,
|
bool is_initial_navigation,
|
||||||
|
|
|
@ -45,7 +45,7 @@ class AtomRendererClient : public content::ContentRendererClient,
|
||||||
blink::WebLocalFrame* frame,
|
blink::WebLocalFrame* frame,
|
||||||
const blink::WebPluginParams& params,
|
const blink::WebPluginParams& params,
|
||||||
blink::WebPlugin** plugin) override;
|
blink::WebPlugin** plugin) override;
|
||||||
bool ShouldFork(blink::WebFrame* frame,
|
bool ShouldFork(blink::WebLocalFrame* frame,
|
||||||
const GURL& url,
|
const GURL& url,
|
||||||
const std::string& http_method,
|
const std::string& http_method,
|
||||||
bool is_initial_navigation,
|
bool is_initial_navigation,
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
#include "base/bind.h"
|
||||||
#include "base/lazy_instance.h"
|
#include "base/lazy_instance.h"
|
||||||
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "ui/gfx/geometry/size.h"
|
#include "ui/gfx/geometry/size.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
@ -20,7 +22,8 @@ static base::LazyInstance<GuestViewContainerMap> g_guest_view_container_map =
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
GuestViewContainer::GuestViewContainer(content::RenderFrame* render_frame)
|
GuestViewContainer::GuestViewContainer(content::RenderFrame* render_frame)
|
||||||
: render_frame_(render_frame) {
|
: render_frame_(render_frame),
|
||||||
|
weak_ptr_factory_(this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
GuestViewContainer::~GuestViewContainer() {
|
GuestViewContainer::~GuestViewContainer() {
|
||||||
|
@ -55,4 +58,8 @@ void GuestViewContainer::DidResizeElement(const gfx::Size& new_size) {
|
||||||
FROM_HERE, base::Bind(element_resize_callback_, new_size));
|
FROM_HERE, base::Bind(element_resize_callback_, new_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
base::WeakPtr<content::BrowserPluginDelegate> GuestViewContainer::GetWeakPtr() {
|
||||||
|
return weak_ptr_factory_.GetWeakPtr();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -28,6 +28,7 @@ class GuestViewContainer : public content::BrowserPluginDelegate {
|
||||||
// content::BrowserPluginDelegate:
|
// content::BrowserPluginDelegate:
|
||||||
void SetElementInstanceID(int element_instance_id) final;
|
void SetElementInstanceID(int element_instance_id) final;
|
||||||
void DidResizeElement(const gfx::Size& new_size) final;
|
void DidResizeElement(const gfx::Size& new_size) final;
|
||||||
|
base::WeakPtr<BrowserPluginDelegate> GetWeakPtr() final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int element_instance_id_;
|
int element_instance_id_;
|
||||||
|
@ -35,6 +36,8 @@ class GuestViewContainer : public content::BrowserPluginDelegate {
|
||||||
|
|
||||||
ResizeCallback element_resize_callback_;
|
ResizeCallback element_resize_callback_;
|
||||||
|
|
||||||
|
base::WeakPtrFactory<GuestViewContainer> weak_ptr_factory_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(GuestViewContainer);
|
DISALLOW_COPY_AND_ASSIGN(GuestViewContainer);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
window.onload = ->
|
window.onload = ->
|
||||||
inspectorFrame = document.getElementById('inspector-app-iframe').contentWindow
|
|
||||||
|
|
||||||
# Use menu API to show context menu.
|
# Use menu API to show context menu.
|
||||||
inspectorFrame.eval 'InspectorFrontendHost.showContextMenuAtPoint = parent.createMenu'
|
InspectorFrontendHost.showContextMenuAtPoint = createMenu
|
||||||
|
|
||||||
# Use dialog API to override file chooser dialog.
|
# Use dialog API to override file chooser dialog.
|
||||||
inspectorFrame.eval 'WebInspector.createFileSelectorElement = parent.createFileSelectorElement'
|
WebInspector.createFileSelectorElement = createFileSelectorElement
|
||||||
|
|
||||||
convertToMenuTemplate = (items) ->
|
convertToMenuTemplate = (items) ->
|
||||||
template = []
|
template = []
|
||||||
|
@ -60,7 +58,3 @@ createFileSelectorElement = (callback) ->
|
||||||
fileSelectorElement.style.display = 'none'
|
fileSelectorElement.style.display = 'none'
|
||||||
fileSelectorElement.click = showFileChooserDialog.bind this, callback
|
fileSelectorElement.click = showFileChooserDialog.bind this, callback
|
||||||
return fileSelectorElement
|
return fileSelectorElement
|
||||||
|
|
||||||
# Exposed for iframe.
|
|
||||||
window.createMenu = createMenu
|
|
||||||
window.createFileSelectorElement = createFileSelectorElement
|
|
||||||
|
|
|
@ -296,8 +296,7 @@ void PdfToEmfUtilityProcessHostClient::Start(
|
||||||
// generate when sent to a metafile DC.
|
// generate when sent to a metafile DC.
|
||||||
utility_process_host_ =
|
utility_process_host_ =
|
||||||
content::UtilityProcessHost::Create(
|
content::UtilityProcessHost::Create(
|
||||||
this, base::MessageLoop::current()->message_loop_proxy())
|
this, base::MessageLoop::current()->task_runner())->AsWeakPtr();
|
||||||
->AsWeakPtr();
|
|
||||||
if (!utility_process_host_)
|
if (!utility_process_host_)
|
||||||
return OnFailed();
|
return OnFailed();
|
||||||
// Should reply with OnProcessStarted().
|
// Should reply with OnProcessStarted().
|
||||||
|
|
|
@ -46,7 +46,8 @@ ui::ClipboardType ConvertClipboardType(uint32_t type) {
|
||||||
// assume all data that is placed on the clipboard is UTF16 and pepper allows
|
// assume all data that is placed on the clipboard is UTF16 and pepper allows
|
||||||
// arbitrary data so this change would require some reworking of the chrome
|
// arbitrary data so this change would require some reworking of the chrome
|
||||||
// clipboard interface for custom data.
|
// clipboard interface for custom data.
|
||||||
bool JumpToFormatInPickle(const base::string16& format, PickleIterator* iter) {
|
bool JumpToFormatInPickle(const base::string16& format,
|
||||||
|
base::PickleIterator* iter) {
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
if (!iter->ReadSizeT(&size))
|
if (!iter->ReadSizeT(&size))
|
||||||
return false;
|
return false;
|
||||||
|
@ -66,22 +67,22 @@ bool JumpToFormatInPickle(const base::string16& format, PickleIterator* iter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsFormatAvailableInPickle(const base::string16& format,
|
bool IsFormatAvailableInPickle(const base::string16& format,
|
||||||
const Pickle& pickle) {
|
const base::Pickle& pickle) {
|
||||||
PickleIterator iter(pickle);
|
base::PickleIterator iter(pickle);
|
||||||
return JumpToFormatInPickle(format, &iter);
|
return JumpToFormatInPickle(format, &iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ReadDataFromPickle(const base::string16& format,
|
std::string ReadDataFromPickle(const base::string16& format,
|
||||||
const Pickle& pickle) {
|
const base::Pickle& pickle) {
|
||||||
std::string result;
|
std::string result;
|
||||||
PickleIterator iter(pickle);
|
base::PickleIterator iter(pickle);
|
||||||
if (!JumpToFormatInPickle(format, &iter) || !iter.ReadString(&result))
|
if (!JumpToFormatInPickle(format, &iter) || !iter.ReadString(&result))
|
||||||
return std::string();
|
return std::string();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WriteDataToPickle(const std::map<base::string16, std::string>& data,
|
bool WriteDataToPickle(const std::map<base::string16, std::string>& data,
|
||||||
Pickle* pickle) {
|
base::Pickle* pickle) {
|
||||||
pickle->WriteSizeT(data.size());
|
pickle->WriteSizeT(data.size());
|
||||||
for (std::map<base::string16, std::string>::const_iterator it = data.begin();
|
for (std::map<base::string16, std::string>::const_iterator it = data.begin();
|
||||||
it != data.end();
|
it != data.end();
|
||||||
|
@ -187,7 +188,7 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgIsFormatAvailable(
|
||||||
std::string clipboard_data;
|
std::string clipboard_data;
|
||||||
clipboard->ReadData(ui::Clipboard::GetPepperCustomDataFormatType(),
|
clipboard->ReadData(ui::Clipboard::GetPepperCustomDataFormatType(),
|
||||||
&clipboard_data);
|
&clipboard_data);
|
||||||
Pickle pickle(clipboard_data.data(), clipboard_data.size());
|
base::Pickle pickle(clipboard_data.data(), clipboard_data.size());
|
||||||
available =
|
available =
|
||||||
IsFormatAvailableInPickle(base::UTF8ToUTF16(format_name), pickle);
|
IsFormatAvailableInPickle(base::UTF8ToUTF16(format_name), pickle);
|
||||||
}
|
}
|
||||||
|
@ -265,7 +266,7 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgReadData(
|
||||||
std::string clipboard_data;
|
std::string clipboard_data;
|
||||||
clipboard->ReadData(ui::Clipboard::GetPepperCustomDataFormatType(),
|
clipboard->ReadData(ui::Clipboard::GetPepperCustomDataFormatType(),
|
||||||
&clipboard_data);
|
&clipboard_data);
|
||||||
Pickle pickle(clipboard_data.data(), clipboard_data.size());
|
base::Pickle pickle(clipboard_data.data(), clipboard_data.size());
|
||||||
if (IsFormatAvailableInPickle(format_name, pickle)) {
|
if (IsFormatAvailableInPickle(format_name, pickle)) {
|
||||||
result = PP_OK;
|
result = PP_OK;
|
||||||
clipboard_string = ReadDataFromPickle(format_name, pickle);
|
clipboard_string = ReadDataFromPickle(format_name, pickle);
|
||||||
|
@ -340,7 +341,7 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgWriteData(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (custom_data_map.size() > 0) {
|
if (custom_data_map.size() > 0) {
|
||||||
Pickle pickle;
|
base::Pickle pickle;
|
||||||
if (WriteDataToPickle(custom_data_map, &pickle)) {
|
if (WriteDataToPickle(custom_data_map, &pickle)) {
|
||||||
scw.WritePickledData(pickle,
|
scw.WritePickledData(pickle,
|
||||||
ui::Clipboard::GetPepperCustomDataFormatType());
|
ui::Clipboard::GetPepperCustomDataFormatType());
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
// A vector of filters, each being a Tuple containing a display string (i.e.
|
// A vector of filters, each being a Tuple containing a display string (i.e.
|
||||||
// "Text Files") and a filter pattern (i.e. "*.txt").
|
// "Text Files") and a filter pattern (i.e. "*.txt").
|
||||||
typedef std::vector<Tuple<base::string16, base::string16>>
|
typedef std::vector<base::Tuple<base::string16, base::string16>>
|
||||||
GetOpenFileNameFilter;
|
GetOpenFileNameFilter;
|
||||||
#endif // OS_WIN
|
#endif // OS_WIN
|
||||||
|
|
||||||
|
|
|
@ -56,17 +56,9 @@ void PepperSharedMemoryMessageFilter::OnHostMsgCreateSharedMemory(
|
||||||
->GetVarTracker()
|
->GetVarTracker()
|
||||||
->TrackSharedMemoryHandle(instance, host_shm_handle, size);
|
->TrackSharedMemoryHandle(instance, host_shm_handle, size);
|
||||||
|
|
||||||
base::PlatformFile host_handle =
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
host_shm_handle;
|
|
||||||
#elif defined(OS_POSIX)
|
|
||||||
host_shm_handle.fd;
|
|
||||||
#else
|
|
||||||
#error Not implemented.
|
|
||||||
#endif
|
|
||||||
// We set auto_close to false since we need our file descriptor to
|
// We set auto_close to false since we need our file descriptor to
|
||||||
// actually be duplicated on linux. The shared memory destructor will
|
// actually be duplicated on linux. The shared memory destructor will
|
||||||
// close the original handle for us.
|
// close the original handle for us.
|
||||||
plugin_handle->set_shmem(host_->ShareHandleWithRemote(host_handle, false),
|
plugin_handle->set_shmem(
|
||||||
size);
|
host_->ShareSharedMemoryHandleWithRemote(host_shm_handle), size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -427,9 +427,10 @@ class PrepareFrameAndViewForPrint : public blink::WebViewClient,
|
||||||
// blink::WebFrameClient override:
|
// blink::WebFrameClient override:
|
||||||
virtual blink::WebFrame* createChildFrame(
|
virtual blink::WebFrame* createChildFrame(
|
||||||
blink::WebLocalFrame* parent,
|
blink::WebLocalFrame* parent,
|
||||||
|
blink::WebTreeScopeType scope,
|
||||||
const blink::WebString& name,
|
const blink::WebString& name,
|
||||||
blink::WebSandboxFlags sandboxFlags);
|
blink::WebSandboxFlags sandboxFlags);
|
||||||
virtual void frameDetached(blink::WebFrame* frame);
|
virtual void frameDetached(blink::WebFrame* frame, DetachType type);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CallOnReady();
|
void CallOnReady();
|
||||||
|
@ -548,7 +549,8 @@ void PrepareFrameAndViewForPrint::CopySelection(
|
||||||
blink::WebView* web_view = blink::WebView::create(this);
|
blink::WebView* web_view = blink::WebView::create(this);
|
||||||
owns_web_view_ = true;
|
owns_web_view_ = true;
|
||||||
content::RenderView::ApplyWebPreferences(prefs, web_view);
|
content::RenderView::ApplyWebPreferences(prefs, web_view);
|
||||||
web_view->setMainFrame(blink::WebLocalFrame::create(this));
|
web_view->setMainFrame(
|
||||||
|
blink::WebLocalFrame::create(blink::WebTreeScopeType::Document, this));
|
||||||
frame_.Reset(web_view->mainFrame()->toWebLocalFrame());
|
frame_.Reset(web_view->mainFrame()->toWebLocalFrame());
|
||||||
node_to_print_.reset();
|
node_to_print_.reset();
|
||||||
|
|
||||||
|
@ -573,14 +575,17 @@ void PrepareFrameAndViewForPrint::didStopLoading() {
|
||||||
|
|
||||||
blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame(
|
blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame(
|
||||||
blink::WebLocalFrame* parent,
|
blink::WebLocalFrame* parent,
|
||||||
|
blink::WebTreeScopeType scope,
|
||||||
const blink::WebString& name,
|
const blink::WebString& name,
|
||||||
blink::WebSandboxFlags sandboxFlags) {
|
blink::WebSandboxFlags sandboxFlags) {
|
||||||
blink::WebFrame* frame = blink::WebLocalFrame::create(this);
|
blink::WebFrame* frame = blink::WebLocalFrame::create(scope, this);
|
||||||
parent->appendChild(frame);
|
parent->appendChild(frame);
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame) {
|
void PrepareFrameAndViewForPrint::frameDetached(blink::WebFrame* frame,
|
||||||
|
DetachType type) {
|
||||||
|
DCHECK(type == DetachType::Remove);
|
||||||
if (frame->parent())
|
if (frame->parent())
|
||||||
frame->parent()->removeChild(frame);
|
frame->parent()->removeChild(frame);
|
||||||
frame->close();
|
frame->close();
|
||||||
|
|
|
@ -85,6 +85,7 @@
|
||||||
'-Wno-deprecated-declarations',
|
'-Wno-deprecated-declarations',
|
||||||
'-Wno-return-type',
|
'-Wno-return-type',
|
||||||
'-Wno-gnu-folding-constant',
|
'-Wno-gnu-folding-constant',
|
||||||
|
'-Wno-shift-negative-value',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'conditions': [
|
'conditions': [
|
||||||
|
@ -99,6 +100,7 @@
|
||||||
'-Wno-unused-value',
|
'-Wno-unused-value',
|
||||||
'-Wno-deprecated-declarations',
|
'-Wno-deprecated-declarations',
|
||||||
'-Wno-return-type',
|
'-Wno-return-type',
|
||||||
|
'-Wno-shift-negative-value',
|
||||||
# Required when building as shared library.
|
# Required when building as shared library.
|
||||||
'-fPIC',
|
'-fPIC',
|
||||||
],
|
],
|
||||||
|
|
|
@ -33,8 +33,9 @@ are reached.
|
||||||
Once all child processes have acknowledged the `getCategories` request the
|
Once all child processes have acknowledged the `getCategories` request the
|
||||||
`callback` is invoked with an array of category groups.
|
`callback` is invoked with an array of category groups.
|
||||||
|
|
||||||
### `contentTracing.startRecording(categoryFilter, traceOptions, callback)`
|
### `contentTracing.startRecording(options, callback)`
|
||||||
|
|
||||||
|
* `options` Object
|
||||||
* `categoryFilter` String
|
* `categoryFilter` String
|
||||||
* `traceOptions` String
|
* `traceOptions` String
|
||||||
* `callback` Function
|
* `callback` Function
|
||||||
|
@ -94,8 +95,9 @@ Trace data will be written into `resultFilePath` if it is not empty or into a
|
||||||
temporary file. The actual file path will be passed to `callback` if it's not
|
temporary file. The actual file path will be passed to `callback` if it's not
|
||||||
`null`.
|
`null`.
|
||||||
|
|
||||||
### `contentTracing.startMonitoring(categoryFilter, traceOptions, callback)`
|
### `contentTracing.startMonitoring(options, callback)`
|
||||||
|
|
||||||
|
* `options` Object
|
||||||
* `categoryFilter` String
|
* `categoryFilter` String
|
||||||
* `traceOptions` String
|
* `traceOptions` String
|
||||||
* `callback` Function
|
* `callback` Function
|
||||||
|
|
|
@ -62,6 +62,8 @@
|
||||||
'atom/app/atom_main_delegate_mac.mm',
|
'atom/app/atom_main_delegate_mac.mm',
|
||||||
'atom/app/node_main.cc',
|
'atom/app/node_main.cc',
|
||||||
'atom/app/node_main.h',
|
'atom/app/node_main.h',
|
||||||
|
'atom/app/uv_task_runner.cc',
|
||||||
|
'atom/app/uv_task_runner.h',
|
||||||
'atom/browser/api/atom_api_app.cc',
|
'atom/browser/api/atom_api_app.cc',
|
||||||
'atom/browser/api/atom_api_app.h',
|
'atom/browser/api/atom_api_app.h',
|
||||||
'atom/browser/api/atom_api_auto_updater.cc',
|
'atom/browser/api/atom_api_auto_updater.cc',
|
||||||
|
@ -125,6 +127,8 @@
|
||||||
'atom/browser/atom_quota_permission_context.h',
|
'atom/browser/atom_quota_permission_context.h',
|
||||||
'atom/browser/atom_speech_recognition_manager_delegate.cc',
|
'atom/browser/atom_speech_recognition_manager_delegate.cc',
|
||||||
'atom/browser/atom_speech_recognition_manager_delegate.h',
|
'atom/browser/atom_speech_recognition_manager_delegate.h',
|
||||||
|
'atom/browser/bridge_task_runner.cc',
|
||||||
|
'atom/browser/bridge_task_runner.h',
|
||||||
'atom/browser/browser.cc',
|
'atom/browser/browser.cc',
|
||||||
'atom/browser/browser.h',
|
'atom/browser/browser.h',
|
||||||
'atom/browser/browser_linux.cc',
|
'atom/browser/browser_linux.cc',
|
||||||
|
|
|
@ -8,7 +8,7 @@ import sys
|
||||||
|
|
||||||
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
|
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
|
||||||
'http://github-janky-artifacts.s3.amazonaws.com/libchromiumcontent'
|
'http://github-janky-artifacts.s3.amazonaws.com/libchromiumcontent'
|
||||||
LIBCHROMIUMCONTENT_COMMIT = '42200d8ec0b77c7491d3a09611c23eb771e0862d'
|
LIBCHROMIUMCONTENT_COMMIT = 'f5489a774b719e9e979675c17b99ed45a05aacf7'
|
||||||
|
|
||||||
PLATFORM = {
|
PLATFORM = {
|
||||||
'cygwin': 'win32',
|
'cygwin': 'win32',
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# Do NOT CHANGE this if you don't know what you're doing -- see
|
# Do NOT CHANGE this if you don't know what you're doing -- see
|
||||||
# https://code.google.com/p/chromium/wiki/UpdatingClang
|
# https://code.google.com/p/chromium/wiki/UpdatingClang
|
||||||
# Reverting problematic clang rolls is safe, though.
|
# Reverting problematic clang rolls is safe, though.
|
||||||
CLANG_REVISION=233105
|
CLANG_REVISION=245965
|
||||||
|
|
||||||
# This is incremented when pushing a new build of Clang at the same revision.
|
# This is incremented when pushing a new build of Clang at the same revision.
|
||||||
CLANG_SUB_REVISION=1
|
CLANG_SUB_REVISION=1
|
||||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 0bf81275795b15eb361a1fd213ae9c7c1f60bdea
|
Subproject commit 4d8f5d879d484db54895c3456ded3a3d3246415d
|
Loading…
Add table
Add a link
Reference in a new issue