Skip to content

Commit

Permalink
update with Chromium 35
Browse files Browse the repository at this point in the history
  • Loading branch information
GnorTech committed Jun 3, 2014
1 parent 103d857 commit 26ad78e
Show file tree
Hide file tree
Showing 73 changed files with 928 additions and 1,285 deletions.
21 changes: 12 additions & 9 deletions nw.gypi
Expand Up @@ -37,7 +37,7 @@
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'<(DEPTH)/components/components.gyp:autofill_content_renderer',
'<(DEPTH)/components/components.gyp:browser_context_keyed_service',
'<(DEPTH)/components/components.gyp:keyed_service_content',
'<(DEPTH)/content/content.gyp:content_app_browser',
'<(DEPTH)/content/content.gyp:content_browser',
'<(DEPTH)/content/content.gyp:content_common',
Expand All @@ -55,11 +55,10 @@
'<(DEPTH)/printing/printing.gyp:printing',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/third_party/node/node.gyp:node',
'<(DEPTH)/ui/ui.gyp:ui',
'<(DEPTH)/ui/ui.gyp:ui_resources',
'<(DEPTH)/ui/base/ui_base.gyp:ui_base',
'<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
'<(DEPTH)/url/url.gyp:url_lib',
'<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
'<(DEPTH)/webkit/glue/webkit_glue.gyp:glue',
'<(DEPTH)/third_party/zlib/zlib.gyp:minizip',
'<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
'nw_resources',
Expand All @@ -71,6 +70,7 @@
'<(DEPTH)/breakpad/src',
'<(SHARED_INTERMEDIATE_DIR)/blink',
'<(SHARED_INTERMEDIATE_DIR)/blink/bindings',
'<(SHARED_INTERMEDIATE_DIR)/chrome',
],
'cflags_cc': [
'-Wno-error=c++0x-compat',
Expand All @@ -83,7 +83,6 @@
#'<(DEPTH)/chrome/common/child_process_logging_posix.cc',
#'<(DEPTH)/chrome/common/child_process_logging_win.cc',
'<(DEPTH)/chrome/common/crash_keys.cc',
'<(DEPTH)/chrome/common/dump_without_crashing.cc',
'<(DEPTH)/chrome/common/env_vars.cc',
'<(DEPTH)/chrome/browser/crash_upload_list.cc',
'<(DEPTH)/chrome/browser/upload_list.cc',
Expand Down Expand Up @@ -274,8 +273,8 @@
'src/nw_version.h',
'src/paths_mac.h',
'src/paths_mac.mm',
'src/renderer/autofill_agent.cc',
'src/renderer/autofill_agent.h',
# 'src/renderer/autofill_agent.cc',
# 'src/renderer/autofill_agent.h',
'src/renderer/common/render_messages.cc',
'src/renderer/common/render_messages.h',
'src/renderer/prerenderer/prerenderer_client.cc',
Expand Down Expand Up @@ -378,7 +377,7 @@
'<(SHARED_INTERMEDIATE_DIR)/webkit',
],
'dependencies': [
'<(DEPTH)/ui/ui.gyp:ui_resources',
'<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
'<(DEPTH)/ui/views/controls/webview/webview.gyp:webview',
'<(DEPTH)/ui/views/views.gyp:views',
'<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
Expand Down Expand Up @@ -532,7 +531,7 @@
'type': 'none',
'dependencies': [
'<(DEPTH)/content/browser/devtools/devtools_resources.gyp:devtools_resources',
'<(DEPTH)/ui/ui.gyp:ui_resources',
'<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
'nw_resources',
],
'variables': {
Expand Down Expand Up @@ -680,6 +679,10 @@
},
},
}], # OS=="win"
['OS == "linux"', {
'ldflags': [
'-Wl,--whole-archive', 'obj/third_party/node/libnode.a', '-Wl,--no-whole-archive' ],
}],
['OS == "win" or toolkit_uses_gtk == 1', {
'dependencies': [
'<(DEPTH)/sandbox/sandbox.gyp:sandbox',
Expand Down
18 changes: 9 additions & 9 deletions src/api/api_messages.h
Expand Up @@ -36,7 +36,7 @@ IPC_STRUCT_TRAITS_END()
IPC_MESSAGE_ROUTED3(ShellViewHostMsg_Allocate_Object,
int /* object id */,
std::string /* type name */,
DictionaryValue /* option */)
base::DictionaryValue /* option */)

IPC_MESSAGE_ROUTED1(ShellViewHostMsg_Deallocate_Object,
int /* object id */)
Expand All @@ -45,30 +45,30 @@ IPC_MESSAGE_ROUTED4(ShellViewHostMsg_Call_Object_Method,
int /* object id */,
std::string /* type name */,
std::string /* method name */,
ListValue /* arguments */)
base::ListValue /* arguments */)

IPC_SYNC_MESSAGE_ROUTED4_1(ShellViewHostMsg_Call_Object_Method_Sync,
int /* object id */,
std::string /* type name */,
std::string /* method name */,
ListValue /* arguments */,
ListValue /* result */)
base::ListValue /* arguments */,
base::ListValue /* result */)

IPC_MESSAGE_ROUTED3(ShellViewHostMsg_Call_Static_Method,
std::string /* type name */,
std::string /* method name */,
ListValue /* arguments */)
base::ListValue /* arguments */)

IPC_SYNC_MESSAGE_ROUTED3_1(ShellViewHostMsg_Call_Static_Method_Sync,
std::string /* type name */,
std::string /* method name */,
ListValue /* arguments */,
ListValue /* result */)
base::ListValue /* arguments */,
base::ListValue /* result */)

IPC_MESSAGE_ROUTED3(ShellViewMsg_Object_On_Event,
int /* object id */,
std::string /* event name */,
ListValue /* arguments */)
base::ListValue /* arguments */)

// Request Shell's id for current render_view_host.
IPC_SYNC_MESSAGE_ROUTED0_1(ShellViewHostMsg_GetShellId,
Expand All @@ -77,7 +77,7 @@ IPC_SYNC_MESSAGE_ROUTED0_1(ShellViewHostMsg_GetShellId,
// Create a Shell and returns its routing id.
IPC_SYNC_MESSAGE_ROUTED2_1(ShellViewHostMsg_CreateShell,
std::string /* url */,
DictionaryValue /* manifest */,
base::DictionaryValue /* manifest */,
int /* result */)

// Tell browser we have an uncaughtException from node.
Expand Down
41 changes: 24 additions & 17 deletions src/api/bindings_common.cc
Expand Up @@ -33,8 +33,8 @@
using content::RenderView;
using content::RenderThread;
using content::V8ValueConverter;
using WebKit::WebFrame;
using WebKit::WebView;
using blink::WebFrame;
using blink::WebView;

namespace {
RenderView* GetRenderView(v8::Handle<v8::Context> ctx) {
Expand All @@ -53,12 +53,14 @@ RenderView* GetRenderView(v8::Handle<v8::Context> ctx) {
}

RenderView* GetCurrentRenderView() {
v8::Local<v8::Context> ctx = v8::Context::GetCurrent();
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::Local<v8::Context> ctx = isolate->GetCurrentContext();
return GetRenderView(ctx);
}

RenderView* GetEnteredRenderView() {
v8::Local<v8::Context> ctx = v8::Context::GetEntered();
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::Local<v8::Context> ctx = isolate->GetEnteredContext();
return GetRenderView(ctx);
}

Expand All @@ -69,29 +71,31 @@ base::StringPiece GetStringResource(int resource_id) {
namespace remote {

v8::Handle<v8::Value> AllocateId(int routing_id) {
v8::HandleScope scope;
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::EscapableHandleScope scope(isolate);

int result = 0;
RenderThread::Get()->Send(new ShellViewHostMsg_AllocateId(
routing_id,
&result));
return scope.Close(v8::Integer::New(result));
return scope.Escape(v8::Integer::New(isolate, result));
}

v8::Handle<v8::Value> AllocateObject(int routing_id,
int object_id,
const std::string& type,
v8::Handle<v8::Value> options) {
v8::HandleScope handle_scope;
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::EscapableHandleScope handle_scope(isolate);

scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
converter->SetStripNullFromObjects(true);

scoped_ptr<base::Value> value_option(
converter->FromV8Value(options, v8::Context::GetCurrent()));
converter->FromV8Value(options, isolate->GetCurrentContext()));
if (!value_option.get() ||
!value_option->IsType(base::Value::TYPE_DICTIONARY))
return v8::ThrowException(v8::Exception::Error(v8::String::New(
return isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate,
"Unable to convert 'option' passed to AllocateObject")));

DVLOG(1) << "remote::AllocateObject(routing_id=" << routing_id << ", object_id=" << object_id << ")";
Expand All @@ -101,28 +105,30 @@ v8::Handle<v8::Value> AllocateObject(int routing_id,
object_id,
type,
*static_cast<base::DictionaryValue*>(value_option.get())));
return v8::Undefined();
return v8::Undefined(isolate);
}

v8::Handle<v8::Value> DeallocateObject(int routing_id,
int object_id) {
RenderThread::Get()->Send(new ShellViewHostMsg_Deallocate_Object(
routing_id, object_id));
return v8::Undefined();
v8::Isolate* isolate = v8::Isolate::GetCurrent();
return v8::Undefined(isolate);
}

v8::Handle<v8::Value> CallObjectMethod(int routing_id,
int object_id,
const std::string& type,
const std::string& method,
v8::Handle<v8::Value> args) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());

scoped_ptr<base::Value> value_args(
converter->FromV8Value(args, v8::Context::GetCurrent()));
converter->FromV8Value(args, isolate->GetCurrentContext()));
if (!value_args.get() ||
!value_args->IsType(base::Value::TYPE_LIST))
return v8::ThrowException(v8::Exception::Error(v8::String::New(
return isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate,
"Unable to convert 'args' passed to CallObjectMethod")));

RenderThread::Get()->Send(new ShellViewHostMsg_Call_Object_Method(
Expand All @@ -131,21 +137,22 @@ v8::Handle<v8::Value> CallObjectMethod(int routing_id,
type,
method,
*static_cast<base::ListValue*>(value_args.get())));
return v8::Undefined();
return v8::Undefined(isolate);
}

v8::Handle<v8::Value> CallObjectMethodSync(int routing_id,
int object_id,
const std::string& type,
const std::string& method,
v8::Handle<v8::Value> args) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());

scoped_ptr<base::Value> value_args(
converter->FromV8Value(args, v8::Context::GetCurrent()));
converter->FromV8Value(args, isolate->GetCurrentContext()));
if (!value_args.get() ||
!value_args->IsType(base::Value::TYPE_LIST))
return v8::ThrowException(v8::Exception::Error(v8::String::New(
return isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate,
"Unable to convert 'args' passed to CallObjectMethodSync")));

base::ListValue result;
Expand All @@ -156,7 +163,7 @@ v8::Handle<v8::Value> CallObjectMethodSync(int routing_id,
method,
*static_cast<base::ListValue*>(value_args.get()),
&result));
return converter->ToV8Value(&result, v8::Context::GetCurrent());
return converter->ToV8Value(&result, isolate->GetCurrentContext());
}

} // namespace remote
Expand Down
2 changes: 1 addition & 1 deletion src/api/clipboard/clipboard.cc
Expand Up @@ -73,7 +73,7 @@ void Clipboard::SetText(std::string& text) {

std::string Clipboard::GetText() {
ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
string16 text;
base::string16 text;
clipboard->ReadText(ui::CLIPBOARD_TYPE_COPY_PASTE, &text);
return UTF16ToUTF8(text);
}
Expand Down

0 comments on commit 26ad78e

Please sign in to comment.