+++ /dev/null
-From: Yannick GICQUEL <yannick.gicquel@open.eurogiciel.org>
-Date: Wed, 29 Jan 2014 11:20:11 +0100
-
-Build is broken on x86_64 due to narrowing warning treated as an error.
-This patch is a workaround to avoid this warning. Correction should be
-placed in generated code V8DOMConfiguration::ConstantConfiguration::value
-
-BUG=https://crosswalk-project.org/jira/browse/XWALK-917
-
-Signed-off-by: Yannick GICQUEL <yannick.gicquel@open.eurogiciel.org>
---- src/third_party/WebKit/Source/config.gyp
-+++ src/third_party/WebKit/Source/config.gyp
-@@ -84,6 +84,11 @@
- # nullptr) conflict with upcoming c++0x types.
- 'cflags_cc': ['-Wno-c++0x-compat'],
- }],
-+ ['gcc_version>=47', {
-+ # Disable warnings about narrowing conversion due to C++11 std.
-+ # Jira: https://crosswalk-project.org/jira/browse/XWALK-917
-+ 'cflags_cc': ['-Wno-narrowing'],
-+ }],
- ['OS=="linux" and target_arch=="arm"', {
- # Due to a bug in gcc arm, we get warnings about uninitialized
- # timesNewRoman.unstatic.3258 and colorTransparent.unstatic.4879.
-
%define _binary_payload w3.gzdio
Name: crosswalk
-Version: 11.39.250.0
+Version: 11.39.252.0
Release: 0
Summary: Chromium-based app runtime
License: (BSD-3-Clause and LGPL-2.1+)
Source1001: crosswalk.manifest
Source1002: %{name}.xml.in
Source1003: %{name}.png
-Patch9: Blink-Add-GCC-flag-Wno-narrowing-fix-64bits-build.patch
Patch10: crosswalk-do-not-look-for-gtk-dependencies-on-x11.patch
+BuildRequires: binutils-gold
BuildRequires: bison
BuildRequires: bzip2-devel
BuildRequires: elfutils
cp -a src/LICENSE LICENSE.chromium
cp -a src/xwalk/LICENSE LICENSE.xwalk
-%patch9
-
# The profiles using Wayland (and thus Ozone) do not need this patch.
%if !%{with wayland}
%patch10
GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_nacl=%{_disable_nacl}"
-# Linking fails in Tizen Common when fatal ld warnings are enabled. XWALK-1379.
-%if "%{profile}" == "common" || "%{profile}" == "generic"
+# Linking fails when fatal ld warnings are enabled. See XWALK-1379.
GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_fatal_linker_warnings=1"
-%endif
# For building for arm in OBS, we need :
# -> to unset sysroot value.
# sysroot variable is automatically set for cross compilation to use arm-sysroot provided by Chromium project
-# -> to force system ld binary.
-# Indeed the build is made on Emulated / Virtualized environment that correspond
-# to the target.
-# gold ld used is avaible only for 32/64 bits Intel Arch.
# sysroot usage is not needed, we need to use arm libraries from the virtualized environment.
#
# Crosswalk build fails if the fpu selected in the gcc option is different from neon in case of arm7 compilation
# So force it.
%ifarch %{arm}
-GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Dsysroot= -Dlinux_use_gold_binary=0"
+GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Dsysroot= "
export CFLAGS=`echo $CFLAGS | sed s,-mfpu=vfpv3,-mfpu=neon,g`
export CXXFLAGS=`echo $CXXFLAGS | sed s,-mfpu=vfpv3,-mfpu=neon,g`
export FFLAGS=`echo $FFLAGS | sed s,-mfpu=vfpv3,-mfpu=neon,g`
${GYP_EXTRA_FLAGS} \
-Dchromeos=0 \
-Dclang=0 \
+-Dlinux_use_bundled_binutils=0 \
+-Dlinux_use_bundled_gold=0 \
+-Dlinux_use_gold_flags=1 \
-Dtizen=1 \
-Dpython_ver=2.7 \
-Duse_aura=1 \
%install
# Binaries.
-install -p -D %{SOURCE2} %{buildroot}%{_dbusservicedir}/org.crosswalkproject.Runtime1.service
-install -p -D xwalk.service %{buildroot}%{_systemduserservicedir}/xwalk.service
-install -p -D src/out/Release/xwalk %{buildroot}%{_libdir}/xwalk/xwalk
-install -p -D src/out/Release/xwalkctl %{buildroot}%{_bindir}/xwalkctl
-install -p -D src/out/Release/xwalk-launcher %{buildroot}%{_bindir}/xwalk-launcher
-install -p -D src/out/Release/xwalk_backend %{buildroot}%{_libdir}/xwalk/xwalk_backend
-install -p -D src/out/Release/lib/libxwalk_backend_lib.so %{buildroot}%{_libdir}/xwalk/libxwalk_backend_lib.so
+install -m 0755 -p -D src/out/Release/xwalk %{buildroot}%{_libdir}/xwalk/xwalk
+install -m 0755 -p -D src/out/Release/xwalkctl %{buildroot}%{_bindir}/xwalkctl
+install -m 0755 -p -D src/out/Release/xwalk-launcher %{buildroot}%{_bindir}/xwalk-launcher
+install -m 0755 -p -D src/out/Release/xwalk_backend %{buildroot}%{_libdir}/xwalk/xwalk_backend
# Supporting libraries and resources.
-install -p -D src/out/Release/icudtl.dat %{buildroot}%{_libdir}/xwalk/icudtl.dat
-install -p -D src/out/Release/libffmpegsumo.so %{buildroot}%{_libdir}/xwalk/libffmpegsumo.so
-install -p -D src/out/Release/xwalk.pak %{buildroot}%{_libdir}/xwalk/xwalk.pak
-mkdir -p %{buildroot}%{_datadir}/xwalk
-install -p -D src/xwalk/application/common/tizen/configuration/*.xsd %{buildroot}%{_datadir}/xwalk/
+install -m 0644 -p -D %{SOURCE2} %{buildroot}%{_dbusservicedir}/org.crosswalkproject.Runtime1.service
+install -m 0644 -p -D xwalk.service %{buildroot}%{_systemduserservicedir}/xwalk.service
+install -m 0644 -p -D src/out/Release/lib/libxwalk_backend_lib.so %{buildroot}%{_libdir}/xwalk/libxwalk_backend_lib.so
+install -m 0644 -p -D src/out/Release/icudtl.dat %{buildroot}%{_libdir}/xwalk/icudtl.dat
+install -m 0644 -p -D src/out/Release/libffmpegsumo.so %{buildroot}%{_libdir}/xwalk/libffmpegsumo.so
+install -m 0644 -p -D src/out/Release/xwalk.pak %{buildroot}%{_libdir}/xwalk/xwalk.pak
+install -d %{buildroot}%{_datadir}/xwalk
+install -m 0644 -p -D src/xwalk/application/common/tizen/configuration/*.xsd %{buildroot}%{_datadir}/xwalk
# PNaCl
%if ! %{_disable_nacl}
-install -p -D src/out/Release/nacl_bootstrap_raw %{buildroot}%{_libdir}/xwalk/nacl_bootstrap_raw
-install -p -D src/out/Release/nacl_helper %{buildroot}%{_libdir}/xwalk/nacl_helper
-install -p -D src/out/Release/nacl_helper_bootstrap %{buildroot}%{_libdir}/xwalk/nacl_helper_bootstrap
-install -p -D src/out/Release/nacl_irt_*.nexe %{buildroot}%{_libdir}/xwalk
-install -p -d %{buildroot}%{_libdir}/xwalk/pnacl
-install -m 0664 -p -D src/out/Release/pnacl/* %{buildroot}%{_libdir}/xwalk/pnacl
+install -m 0755 -p -D src/out/Release/nacl_bootstrap_raw %{buildroot}%{_libdir}/xwalk/nacl_bootstrap_raw
+install -m 0755 -p -D src/out/Release/nacl_helper %{buildroot}%{_libdir}/xwalk/nacl_helper
+install -m 0755 -p -D src/out/Release/nacl_helper_bootstrap %{buildroot}%{_libdir}/xwalk/nacl_helper_bootstrap
+install -m 0644 -p -D src/out/Release/nacl_irt_*.nexe %{buildroot}%{_libdir}/xwalk
+install -d %{buildroot}%{_libdir}/xwalk/pnacl
+install -m 0644 -p -D src/out/Release/pnacl/* %{buildroot}%{_libdir}/xwalk/pnacl
%endif
# Register xwalk to the package manager.
-install -p -D %{name}.xml %{buildroot}%{_manifestdir}/%{name}.xml
-install -p -D %{name}.png %{buildroot}%{_desktop_icondir}/%{name}.png
+install -m 0644 -p -D %{name}.xml %{buildroot}%{_manifestdir}/%{name}.xml
+install -m 0644 -p -D %{name}.png %{buildroot}%{_desktop_icondir}/%{name}.png
%post
mkdir -p %{_desktop_icondir_ro}
'keyboard_codes_ozone.h',
'keyboard_code_conversion_ozone.h',
'keyboard_code_conversion_ozone.cc',
+ 'keyboard_engine_xkb.h',
+ 'keyboard_engine_xkb.cc',
'output_change_observer.h',
'remote_event_dispatcher.h',
'remote_event_dispatcher.cc',
EventConverterInProcess::EventConverterInProcess()
: EventConverterOzoneWayland(),
observer_(NULL),
- output_observer_(NULL) {
+ output_observer_(NULL),
+ backend_(NULL) {
}
EventConverterInProcess::~EventConverterInProcess() {
+ delete backend_;
}
void EventConverterInProcess::MotionNotify(float x, float y) {
}
void EventConverterInProcess::KeyNotify(ui::EventType type,
- unsigned code,
- unsigned modifiers) {
+ unsigned code) {
+ unsigned converted_code = backend_->ConvertKeyCodeFromEvdev(code);
+ unsigned flags = backend_->GetKeyBoardModifiers();
+ ui::EventConverterOzoneWayland::PostTaskOnMainLoop(base::Bind(
+ &EventConverterInProcess::NotifyKeyEvent, this, type,
+ ui::KeyboardCodeFromNativeKeysym(converted_code),
+ ui::CharacterCodeFromNativeKeySym(converted_code, flags), flags));
+}
+
+void EventConverterInProcess::VirtualKeyNotify(ui::EventType type,
+ uint32_t key,
+ uint32_t modifiers) {
+ unsigned code = backend_->ConvertKeyCodeFromEvdev(key);
ui::EventConverterOzoneWayland::PostTaskOnMainLoop(base::Bind(
&EventConverterInProcess::NotifyKeyEvent, this, type,
ui::KeyboardCodeFromNativeKeysym(code),
ui::CharacterCodeFromNativeKeySym(code, modifiers), modifiers));
}
+void EventConverterInProcess::KeyModifiers(uint32_t mods_depressed,
+ uint32_t mods_latched,
+ uint32_t mods_locked,
+ uint32_t group) {
+ backend_->OnKeyModifiers(mods_depressed,
+ mods_latched,
+ mods_locked,
+ group);
+}
+
void EventConverterInProcess::TouchNotify(ui::EventType type,
float x,
float y,
&EventConverterInProcess::NotifyPreeditStart, this));
}
+void EventConverterInProcess::InitializeXKB(base::SharedMemoryHandle fd,
+ uint32_t size) {
+ if (backend_) {
+ delete backend_;
+ backend_ = NULL;
+ }
+
+ backend_ = new ui::KeyboardEngineXKB();
+ backend_->OnKeyboardKeymap(fd.fd, size);
+ close(fd.fd);
+}
+
void EventConverterInProcess::SetWindowChangeObserver(
ui::WindowChangeObserver* observer) {
observer_ = observer;
#include "base/memory/scoped_ptr.h"
#include "ozone/ui/events/event_converter_ozone_wayland.h"
#include "ozone/ui/events/keyboard_code_conversion_ozone.h"
+#include "ozone/ui/events/keyboard_engine_xkb.h"
#include "ui/events/event.h"
#include "ui/events/platform/platform_event_source.h"
virtual void PointerEnter(unsigned handle, float x, float y) OVERRIDE;
virtual void PointerLeave(unsigned handle, float x, float y) OVERRIDE;
virtual void KeyNotify(ui::EventType type,
- unsigned code,
- unsigned modifiers) OVERRIDE;
+ unsigned code) override;
+ virtual void VirtualKeyNotify(ui::EventType type,
+ uint32_t key,
+ uint32_t modifiers) override;
+ virtual void KeyModifiers(uint32_t mods_depressed,
+ uint32_t mods_latched,
+ uint32_t mods_locked,
+ uint32_t group) override;
virtual void TouchNotify(ui::EventType type,
float x,
float y,
virtual void Commit(unsigned handle, const std::string& text) OVERRIDE;
virtual void PreeditChanged(unsigned handle, const std::string& text,
- const std::string& commit) OVERRIDE;
- virtual void PreeditEnd() OVERRIDE;
- virtual void PreeditStart() OVERRIDE;
+ const std::string& commit) override;
+ virtual void PreeditEnd() override;
+ virtual void PreeditStart() override;
+ virtual void InitializeXKB(base::SharedMemoryHandle fd,
+ uint32_t size) override;
virtual void SetWindowChangeObserver(
ui::WindowChangeObserver* observer) OVERRIDE;
ui::WindowChangeObserver* observer_;
ui::OutputChangeObserver* output_observer_;
+ ui::KeyboardEngineXKB* backend_;
base::Callback<void(void*)> dispatch_callback_; // NOLINT(readability/
// function)
DISALLOW_COPY_AND_ASSIGN(EventConverterInProcess);
#include <string>
+#include "base/memory/shared_memory.h"
#include "base/message_loop/message_loop.h"
#include "ozone/platform/ozone_export_wayland.h"
#include "ui/events/event_constants.h"
virtual void PointerEnter(unsigned handle, float x, float y) = 0;
virtual void PointerLeave(unsigned handle, float x, float y) = 0;
virtual void KeyNotify(ui::EventType type,
- unsigned code,
- unsigned modifiers) = 0;
+ unsigned code) = 0;
+ virtual void VirtualKeyNotify(ui::EventType type,
+ uint32_t key,
+ uint32_t modifiers) = 0;
+ virtual void KeyModifiers(uint32_t mods_depressed,
+ uint32_t mods_latched,
+ uint32_t mods_locked,
+ uint32_t group) = 0;
virtual void TouchNotify(ui::EventType type,
float x,
float y,
const std::string& commit) = 0;
virtual void PreeditEnd() = 0;
virtual void PreeditStart() = 0;
+ virtual void InitializeXKB(base::SharedMemoryHandle fd,
+ uint32_t size) = 0;
+
// Sets the window change observer. Ownership is retained by the caller.
virtual void SetWindowChangeObserver(WindowChangeObserver* observer);
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ozone/wayland/input/keyboard_engine_xkb.h"
+#include "ozone/ui/events/keyboard_engine_xkb.h"
#include <sys/mman.h>
#include "ozone/ui/events/keyboard_codes_ozone.h"
#include "ui/events/event.h"
-namespace ozonewayland {
+namespace ui {
KeyboardEngineXKB::KeyboardEngineXKB() : keyboard_modifiers_(0),
mods_depressed_(0),
return cached_sym_;
}
-bool KeyboardEngineXKB::IgnoreKeyNotify(
- unsigned hardwarecode, bool pressed) {
- // If the key is pressed or it's a special modifier key i.e altgr, we cannot
- // ignore it.
- // TODO(kalyan): Handle all needed cases here.
- if (pressed || IsSpecialModifier(hardwarecode))
- return false;
-
- // No modifiers set, we don't have to deal with any special cases. Ignore the
- // release events.
- if (!keyboard_modifiers_ || IsOnlyCapsLocked())
- return true;
-
- return false;
-}
-
void KeyboardEngineXKB::InitXKB() {
if (context_)
return;
}
}
-bool KeyboardEngineXKB::IsSpecialModifier(unsigned hardwarecode) {
- switch (ConvertKeyCodeFromEvdev(hardwarecode)) {
- case XKB_KEY_ISO_Level3_Shift: // altgr
- return true;
- break;
- default:
- return false;
- }
-}
-
bool KeyboardEngineXKB::IsOnlyCapsLocked() const {
if ((keyboard_modifiers_ & ui::EF_CONTROL_DOWN) != 0)
return false;
}
}
-} // namespace ozonewayland
+} // namespace ui
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef OZONE_WAYLAND_INPUT_KEYBOARD_ENGINE_XKB_H_
-#define OZONE_WAYLAND_INPUT_KEYBOARD_ENGINE_XKB_H_
+#ifndef OZONE_UI_EVENTS_INPUT_KEYBOARD_ENGINE_XKB_H_
+#define OZONE_UI_EVENTS_INPUT_KEYBOARD_ENGINE_XKB_H_
#include <xkbcommon/xkbcommon.h>
#include "base/basictypes.h"
-namespace ozonewayland {
+namespace ui {
class KeyboardEngineXKB {
public:
uint32_t mods_locked,
uint32_t group);
unsigned ConvertKeyCodeFromEvdev(unsigned hardwarecode);
- bool IgnoreKeyNotify(unsigned hardwarecode, bool pressed);
uint32_t GetKeyBoardModifiers() const { return keyboard_modifiers_; }
private:
void InitXKB();
void FiniXKB();
- bool IsSpecialModifier(unsigned hardwarecode);
bool IsOnlyCapsLocked() const;
void NormalizeKey();
DISALLOW_COPY_AND_ASSIGN(KeyboardEngineXKB);
};
-} // namespace ozonewayland
+} // namespace ui
-#endif // OZONE_WAYLAND_INPUT_KEYBOARD_ENGINE_XKB_H_
+#endif // OZONE_UI_EVENTS_INPUT_KEYBOARD_ENGINE_XKB_H_
}
void RemoteEventDispatcher::KeyNotify(ui::EventType type,
- unsigned code,
- unsigned modifiers) {
- Dispatch(new WaylandInput_KeyNotify(type, code, modifiers));
+ unsigned code) {
+ Dispatch(new WaylandInput_KeyNotify(type, code));
+}
+
+void RemoteEventDispatcher::VirtualKeyNotify(ui::EventType type,
+ uint32_t key,
+ uint32_t modifiers) {
+ Dispatch(new WaylandInput_VirtualKeyNotify(type, key, modifiers));
+}
+
+void RemoteEventDispatcher::KeyModifiers(uint32_t mods_depressed,
+ uint32_t mods_latched,
+ uint32_t mods_locked,
+ uint32_t group) {
+ Dispatch(new WaylandInput_KeyModifiers(mods_depressed,
+ mods_latched,
+ mods_locked,
+ group));
}
void RemoteEventDispatcher::TouchNotify(ui::EventType type,
Dispatch(new WaylandInput_PreeditStart());
}
+void RemoteEventDispatcher::InitializeXKB(base::SharedMemoryHandle fd,
+ uint32_t size) {
+ Dispatch(new WaylandInput_InitializeXKB(fd, size));
+}
+
void RemoteEventDispatcher::Dispatch(IPC::Message* message) {
ui::EventConverterOzoneWayland::PostTaskOnMainLoop(
base::Bind(&RemoteEventDispatcher::Send, this, message));
virtual void PointerEnter(unsigned handle, float x, float y) OVERRIDE;
virtual void PointerLeave(unsigned handle, float x, float y) OVERRIDE;
virtual void KeyNotify(ui::EventType type,
- unsigned code,
- unsigned modifiers) OVERRIDE;
+ unsigned code) override;
+ virtual void VirtualKeyNotify(ui::EventType type,
+ uint32_t key,
+ uint32_t modifiers) override;
+ virtual void KeyModifiers(uint32_t mods_depressed,
+ uint32_t mods_latched,
+ uint32_t mods_locked,
+ uint32_t group) override;
virtual void TouchNotify(ui::EventType type,
float x,
float y,
virtual void Commit(unsigned handle, const std::string& text) OVERRIDE;
virtual void PreeditChanged(unsigned handle,
const std::string& text,
- const std::string& commit) OVERRIDE;
- virtual void PreeditEnd() OVERRIDE;
- virtual void PreeditStart() OVERRIDE;
+ const std::string& commit) override;
+ virtual void PreeditEnd() override;
+ virtual void PreeditStart() override;
+ virtual void InitializeXKB(base::SharedMemoryHandle fd,
+ uint32_t size) override;
private:
void Dispatch(IPC::Message* message);
#include <string>
#include "base/basictypes.h"
+#include "base/memory/shared_memory.h"
#include "base/strings/string16.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
IPC_ENUM_TRAITS_MAX_VALUE(ui::WidgetType,
ui::POPUP)
+IPC_MESSAGE_CONTROL2(WaylandInput_InitializeXKB, // NOLINT(readability/fn_size)
+ base::SharedMemoryHandle /*fd*/,
+ uint32_t /*size*/)
+
+IPC_MESSAGE_CONTROL2(WaylandInput_KeyNotify, // NOLINT(readability/fn_size)
+ ui::EventType /*type*/,
+ unsigned /*code*/)
+
+IPC_MESSAGE_CONTROL3(WaylandInput_VirtualKeyNotify, // NOLINT(readability/fn_size)
+ ui::EventType /*type*/,
+ uint32_t /*key*/,
+ uint32_t /*modifiers*/)
+
+IPC_MESSAGE_CONTROL4(WaylandInput_KeyModifiers, // NOLINT(readability/fn_size)
+ uint32_t /*mods_depressed*/,
+ uint32_t /*mods_latched*/,
+ uint32_t /*mods_locked*/,
+ uint32_t /*group*/)
+
IPC_MESSAGE_CONTROL2(WaylandInput_MotionNotify, // NOLINT(readability/fn_size)
float /*x*/,
float /*y*/)
float /*x*/,
float /*y*/)
-IPC_MESSAGE_CONTROL3(WaylandInput_KeyNotify, // NOLINT(readability/fn_size)
- ui::EventType /*type*/,
- unsigned /*code*/,
- unsigned /*modifiers*/)
-
IPC_MESSAGE_CONTROL2(WaylandInput_OutputSize, // NOLINT(readability/fn_size)
unsigned /*width*/,
unsigned /*height*/)
IPC_MESSAGE_HANDLER(WaylandInput_PointerEnter, OnPointerEnter)
IPC_MESSAGE_HANDLER(WaylandInput_PointerLeave, OnPointerLeave)
IPC_MESSAGE_HANDLER(WaylandInput_KeyNotify, OnKeyNotify)
+ IPC_MESSAGE_HANDLER(WaylandInput_VirtualKeyNotify, OnVirtualKeyNotify)
+ IPC_MESSAGE_HANDLER(WaylandInput_KeyModifiers, OnKeyModifiers)
IPC_MESSAGE_HANDLER(WaylandInput_OutputSize, OnOutputSizeChanged)
IPC_MESSAGE_HANDLER(WaylandInput_CloseWidget, OnCloseWidget)
IPC_MESSAGE_HANDLER(WaylandWindow_Resized, OnWindowResized)
IPC_MESSAGE_HANDLER(WaylandInput_PreeditChanged, OnPreeditChanged)
IPC_MESSAGE_HANDLER(WaylandInput_PreeditEnd, OnPreeditEnd)
IPC_MESSAGE_HANDLER(WaylandInput_PreeditStart, OnPreeditStart)
+ IPC_MESSAGE_HANDLER(WaylandInput_InitializeXKB, OnInitializeXKB)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
}
void OzoneChannelHost::OnKeyNotify(ui::EventType type,
- unsigned code,
- unsigned modifiers) {
- event_converter_->KeyNotify(type, code, modifiers);
+ unsigned code) {
+ event_converter_->KeyNotify(type, code);
+}
+
+void OzoneChannelHost::OnVirtualKeyNotify(ui::EventType type,
+ uint32_t key,
+ uint32_t modifiers) {
+ event_converter_->VirtualKeyNotify(type, key, modifiers);
+}
+
+void OzoneChannelHost::OnKeyModifiers(uint32_t mods_depressed,
+ uint32_t mods_latched,
+ uint32_t mods_locked,
+ uint32_t group) {
+ event_converter_->KeyModifiers(mods_depressed,
+ mods_latched,
+ mods_locked,
+ group);
}
void OzoneChannelHost::OnOutputSizeChanged(unsigned width,
void OzoneChannelHost::OnPreeditStart() {
}
+void OzoneChannelHost::OnInitializeXKB(base::SharedMemoryHandle fd,
+ uint32_t size) {
+ event_converter_->InitializeXKB(fd, size);
+}
+
} // namespace ui
#include <string>
+#include "base/memory/shared_memory.h"
#include "ui/events/event_constants.h"
#include "ui/ozone/public/gpu_platform_support_host.h"
void OnAxisNotify(float x, float y, int xoffset, int yoffset);
void OnPointerEnter(unsigned handle, float x, float y);
void OnPointerLeave(unsigned handle, float x, float y);
- void OnKeyNotify(ui::EventType type, unsigned code, unsigned modifiers);
+ void OnKeyNotify(ui::EventType type, unsigned code);
+ void OnVirtualKeyNotify(ui::EventType type,
+ uint32_t key,
+ uint32_t modifiers);
+ void OnKeyModifiers(uint32_t mods_depressed,
+ uint32_t mods_latched,
+ uint32_t mods_locked,
+ uint32_t group);
void OnOutputSizeChanged(unsigned width, unsigned height);
void OnCloseWidget(unsigned handle);
void OnWindowResized(unsigned handle,
void OnPreeditChanged(unsigned handle, std::string text, std::string commit);
void OnPreeditEnd();
void OnPreeditStart();
+ void OnInitializeXKB(base::SharedMemoryHandle fd, uint32_t size);
private:
RemoteStateChangeHandler* state_handler_;
} else if (strcmp(interface, "wl_shm") == 0) {
disp->shm_ = static_cast<wl_shm*>(
wl_registry_bind(registry, name, &wl_shm_interface, 1));
+ WaylandCursor::InitializeCursorData(disp->shm_);
} else if (strcmp(interface, "wl_text_input_manager") == 0) {
disp->text_input_manager_ = static_cast<wl_text_input_manager*>(
wl_registry_bind(registry, name, &wl_text_input_manager_interface, 1));
polling_(true, false),
stop_polling_(true, false) {
DCHECK(display_);
+ epoll_fd_ = osEpollCreateCloExec();
+ if (epoll_fd_ < 0)
+ LOG(ERROR) << "Epoll creation failed.";
}
WaylandDisplayPollThread::~WaylandDisplayPollThread() {
}
void WaylandDisplayPollThread::StartProcessingEvents() {
- DCHECK(!polling_.IsSignaled());
+ DCHECK(!polling_.IsSignaled() && epoll_fd_);
base::Thread::Options options;
options.message_loop_type = base::MessageLoop::TYPE_IO;
StartWithOptions(options);
void WaylandDisplayPollThread::CleanUp() {
SetThreadWasQuitProperly(true);
+ if (epoll_fd_)
+ close(epoll_fd_);
}
void WaylandDisplayPollThread::DisplayRun(WaylandDisplayPollThread* data) {
uint32_t event = 0;
bool epoll_err = false;
unsigned display_fd = wl_display_get_fd(data->display_);
- int epoll_fd = osEpollCreateCloExec();
- if (epoll_fd < 0) {
- LOG(ERROR) << "Epoll creation failed.";
- return;
- }
-
+ int epoll_fd = data->epoll_fd_;
ep[0].events = EPOLLIN;
ep[0].data.ptr = 0;
if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, display_fd, &ep[0]) < 0) {
close(epoll_fd);
+ data->epoll_fd_ = 0;
LOG(ERROR) << "epoll_ctl Add failed";
return;
}
break;
}
- close(epoll_fd);
data->polling_.Reset();
data->stop_polling_.Reset();
}
static void DisplayRun(WaylandDisplayPollThread* data);
base::WaitableEvent polling_; // Is set as long as the thread is polling.
base::WaitableEvent stop_polling_;
+ int epoll_fd_;
wl_display* display_;
DISALLOW_COPY_AND_ASSIGN(WaylandDisplayPollThread);
};
WaylandCursor::WaylandCursor(wl_shm* shm) : input_pointer_(NULL),
pointer_surface_(NULL),
current_cursor_(CURSOR_UNSET) {
- WaylandCursorData::InitializeCursorData(shm);
+ DCHECK(WaylandCursorData::GetInstance());
WaylandDisplay* display = WaylandDisplay::GetInstance();
pointer_surface_ = wl_compositor_create_surface(display->GetCompositor());
}
WaylandCursorData::DestroyCursorData();
}
+void WaylandCursor::InitializeCursorData(wl_shm* shm) {
+ WaylandCursorData::InitializeCursorData(shm);
+}
+
void WaylandCursor::Update(CursorType type, uint32_t serial) {
if (!input_pointer_)
return;
// needed. No other class should call this.
static void Clear();
+ // Initializes CursorData. WaylandDisplay is responsible for calling this as
+ // needed. No other class should call this. We do it this way to avoid
+ // initializing theme under sandbox.
+ static void InitializeCursorData(wl_shm* shm);
+
void Update(CursorType type, uint32_t serial);
wl_pointer* GetInputPointer() const { return input_pointer_; }
#include "ozone/wayland/input/keyboard.h"
#include "ozone/ui/events/event_factory_ozone_wayland.h"
-#include "ozone/wayland/input/keyboard_engine_xkb.h"
namespace ozonewayland {
WaylandKeyboard::WaylandKeyboard() : input_keyboard_(NULL),
- dispatcher_(NULL),
- backend_(NULL) {
+ dispatcher_(NULL) {
}
WaylandKeyboard::~WaylandKeyboard() {
- delete backend_;
-
if (input_keyboard_)
wl_keyboard_destroy(input_keyboard_);
}
dispatcher_ = ui::EventFactoryOzoneWayland::GetInstance()->EventConverter();
if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !input_keyboard_) {
- DCHECK(!backend_);
- backend_ = new KeyboardEngineXKB();
input_keyboard_ = wl_seat_get_keyboard(seat);
wl_keyboard_add_listener(input_keyboard_, &kInputKeyboardListener,
this);
} else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && input_keyboard_) {
- if (backend_) {
- delete backend_;
- backend_ = NULL;
- }
-
wl_keyboard_destroy(input_keyboard_);
input_keyboard_ = NULL;
}
if (state == WL_KEYBOARD_KEY_STATE_RELEASED)
type = ui::ET_KEY_RELEASED;
- // Check if we can ignore the KeyEvent notification, saves an IPC call.
- if (device->backend_->IgnoreKeyNotify(key, type == ui::ET_KEY_PRESSED))
- return;
-
- device->dispatcher_->KeyNotify(type,
- device->backend_->ConvertKeyCodeFromEvdev(key),
- device->backend_->GetKeyBoardModifiers());
+ device->dispatcher_->KeyNotify(type, key);
}
void WaylandKeyboard::OnKeyboardKeymap(void *data,
return;
}
- device->backend_->OnKeyboardKeymap(fd, size);
- close(fd);
+ base::SharedMemoryHandle section = base::FileDescriptor(fd, true);
+ device->dispatcher_->InitializeXKB(section, size);
}
void WaylandKeyboard::OnKeyboardEnter(void* data,
uint32_t mods_locked,
uint32_t group) {
WaylandKeyboard* device = static_cast<WaylandKeyboard*>(data);
- device->backend_->OnKeyModifiers(mods_depressed,
+ device->dispatcher_->KeyModifiers(mods_depressed,
mods_latched,
mods_locked,
group);
#ifndef OZONE_WAYLAND_INPUT_KEYBOARD_H_
#define OZONE_WAYLAND_INPUT_KEYBOARD_H_
-#include <xkbcommon/xkbcommon.h>
-
#include "ozone/wayland/display.h"
namespace ui {
namespace ozonewayland {
-class KeyboardEngineXKB;
-
class WaylandKeyboard {
public:
WaylandKeyboard();
~WaylandKeyboard();
- KeyboardEngineXKB* GetBackend() { return backend_;}
void OnSeatCapabilities(wl_seat *seat, uint32_t caps);
wl_keyboard* input_keyboard_;
ui::EventConverterOzoneWayland* dispatcher_;
- KeyboardEngineXKB* backend_;
DISALLOW_COPY_AND_ASSIGN(WaylandKeyboard);
};
#include "ozone/ui/events/keyboard_codes_ozone.h"
#include "ozone/wayland/display.h"
#include "ozone/wayland/input/keyboard.h"
-#include "ozone/wayland/input/keyboard_engine_xkb.h"
#include "ozone/wayland/input_device.h"
#include "ozone/wayland/shell/shell_surface.h"
#include "ozone/wayland/window.h"
uint32_t key,
uint32_t state,
uint32_t modifiers) {
- WaylandTextInput* textInuput = static_cast<WaylandTextInput*>(data);
-
// Copid from WaylandKeyboard::OnKeyNotify()
ui::EventType type = ui::ET_KEY_PRESSED;
WaylandDisplay::GetInstance()->SetSerial(serial);
if (state == WL_KEYBOARD_KEY_STATE_RELEASED)
type = ui::ET_KEY_RELEASED;
- // Check if we can ignore the KeyEvent notification, saves an IPC call.
- if (textInuput->getInputDevice()->GetKeyBoard()->GetBackend()->
- IgnoreKeyNotify(key, type == ui::ET_KEY_PRESSED))
- return;
-
ui::EventConverterOzoneWayland* dispatcher =
ui::EventFactoryOzoneWayland::GetInstance()->EventConverter();
-
- switch (key) {
- case XKB_KEY_KP_Enter:
- case XKB_KEY_Return:
- case XKB_KEY_ISO_Enter:
- dispatcher->KeyNotify(type, ui::OZONEACTIONKEY_RETURN, modifiers);
- break;
- case XKB_KEY_BackSpace: // FIXME: Back space is not handled.
- dispatcher->KeyNotify(type, ui::OZONEACTIONKEY_BACK, modifiers);
- break;
- case XKB_KEY_Left:
- case XKB_KEY_KP_Left:
- dispatcher->KeyNotify(type, ui::OZONEACTIONKEY_LEFT, modifiers);
- break;
- case XKB_KEY_Right:
- case XKB_KEY_KP_Right:
- dispatcher->KeyNotify(type, ui::OZONEACTIONKEY_RIGHT, modifiers);
- break;
- default:
- break;
- }
+ dispatcher->VirtualKeyNotify(type, key, modifiers);
}
void WaylandTextInput::OnEnter(void* data,
'input/cursor.h',
'input/keyboard.cc',
'input/keyboard.h',
- 'input/keyboard_engine_xkb.h',
- 'input/keyboard_engine_xkb.cc',
'input/pointer.cc',
'input/pointer.h',
'input/text_input.h',
chromium_crosswalk_rev = '35b73bc7d43d8dcab600c2afedcdcf21de0651ee'
v8_crosswalk_rev = '5b2efeab77f1cda6d70f98f20b393fe40ea6898a'
-ozone_wayland_rev = '8f3a1b59dd183087269400208947031cac5fcfcd'
+ozone_wayland_rev = '6379cd118da098b55a5934ce1a90b377a177ed40'
# |blink_crosswalk_rev| specifies the SHA1 hash of the blink-crosswalk commit
# we want to point to, very much like the variables above.
MAJOR=11
MINOR=39
-BUILD=250
+BUILD=252
PATCH=0
#if defined(OS_TIZEN)
if (data_->IsHostedApp()) {
std::string source;
- data_->GetManifest()->GetString(widget_keys::kLaunchLocalPathKey, &source);
- GURL url = GURL(source);
+ GURL url;
+ if (data_->GetManifest()->GetString(
+ widget_keys::kLaunchLocalPathKey, &source)) {
+ url = GURL(source);
+ }
if (url.is_valid() && url.SchemeIsHTTPOrHTTPS())
return url;
GURL Application::GetStartURL<Manifest::TYPE_MANIFEST>() {
if (data_->IsHostedApp()) {
std::string source;
- data_->GetManifest()->GetString(keys::kStartURLKey, &source);
// Not trying to get a relative path for the "fake" application.
- return GURL(source);
+ if (data_->GetManifest()->GetString(keys::kStartURLKey, &source))
+ return GURL(source);
+ return GURL();
}
GURL url = GetAbsoluteURLFromKey(keys::kStartURLKey);
void Application::InitSecurityPolicy() {
// CSP policy takes precedence over WARP.
if (data_->HasCSPDefined())
- security_policy_.reset(new SecurityPolicyCSP(this));
+ security_policy_.reset(new ApplicationSecurityPolicyCSP(this));
else if (data_->manifest_type() == Manifest::TYPE_WIDGET)
- security_policy_.reset(new SecurityPolicyWARP(this));
+ security_policy_.reset(new ApplicationSecurityPolicyWARP(this));
if (security_policy_)
security_policy_->Enforce();
#include "base/observer_list.h"
#include "content/public/browser/render_process_host_observer.h"
#include "ui/base/ui_base_types.h"
+#include "xwalk/application/browser/application_security_policy.h"
#include "xwalk/application/common/application_data.h"
-#include "xwalk/application/common/security_policy.h"
#include "xwalk/runtime/browser/runtime.h"
#include "xwalk/runtime/browser/runtime_ui_strategy.h"
class ApplicationHost;
class Manifest;
-class SecurityPolicy;
+class ApplicationSecurityPolicy;
// The Application class is representing an active (running) application.
// Application instances are owned by ApplicationService.
// Application's session permissions.
StoredPermissionMap permission_map_;
// Security policy.
- scoped_ptr<SecurityPolicy> security_policy_;
+ scoped_ptr<ApplicationSecurityPolicy> security_policy_;
// Remote debugging enabled or not for this Application
bool remote_debugging_enabled_;
// WeakPtrFactory should be always declared the last.
// Copyright (c) 2014 Intel Corporation. All rights reserved.
+// Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "xwalk/application/common/security_policy.h"
+#include "xwalk/application/browser/application_security_policy.h"
#include <map>
#include <string>
} // namespace
-SecurityPolicy::WhitelistEntry::WhitelistEntry(const GURL& url, bool subdomains)
- : url(url),
- subdomains(subdomains) {
+ApplicationSecurityPolicy::WhitelistEntry::WhitelistEntry(
+ const GURL& url, bool subdomains)
+ : url(url),
+ subdomains(subdomains) {
}
-SecurityPolicy::SecurityPolicy(Application* app)
- : app_(app),
- enabled_(false) {
+ApplicationSecurityPolicy::ApplicationSecurityPolicy(Application* app)
+ : app_(app),
+ enabled_(false) {
}
-SecurityPolicy::~SecurityPolicy() {
+ApplicationSecurityPolicy::~ApplicationSecurityPolicy() {
}
-bool SecurityPolicy::IsAccessAllowed(const GURL& url) const {
+bool ApplicationSecurityPolicy::IsAccessAllowed(const GURL& url) const {
if (!enabled_)
return true;
return false;
}
-void SecurityPolicy::Enforce() {
+void ApplicationSecurityPolicy::Enforce() {
}
-void SecurityPolicy::AddWhitelistEntry(const GURL& url, bool subdomains) {
+void ApplicationSecurityPolicy::AddWhitelistEntry(
+ const GURL& url, bool subdomains) {
GURL app_url = app_->data()->URL();
DCHECK(app_->render_process_host());
WhitelistEntry entry = WhitelistEntry(url, subdomains);
whitelist_entries_.push_back(entry);
}
-SecurityPolicyWARP::SecurityPolicyWARP(Application* app)
- : SecurityPolicy(app) {
+ApplicationSecurityPolicyWARP::ApplicationSecurityPolicyWARP(Application* app)
+ : ApplicationSecurityPolicy(app) {
}
-SecurityPolicyWARP::~SecurityPolicyWARP() {
+ApplicationSecurityPolicyWARP::~ApplicationSecurityPolicyWARP() {
}
-void SecurityPolicyWARP::Enforce() {
+void ApplicationSecurityPolicyWARP::Enforce() {
const WARPInfo* info = static_cast<WARPInfo*>(
app_->data()->GetManifestData(widget_keys::kAccessKey));
if (!info) {
app_->render_process_host()->Send(
new ViewMsg_EnableSecurityMode(
ApplicationData::GetBaseURLFromApplicationId(app_->id()),
- SecurityPolicy::WARP));
+ ApplicationSecurityPolicy::WARP));
return;
}
app_->render_process_host()->Send(
new ViewMsg_EnableSecurityMode(
ApplicationData::GetBaseURLFromApplicationId(app_->id()),
- SecurityPolicy::WARP));
+ ApplicationSecurityPolicy::WARP));
}
}
-SecurityPolicyCSP::SecurityPolicyCSP(Application* app)
- : SecurityPolicy(app) {
+ApplicationSecurityPolicyCSP::ApplicationSecurityPolicyCSP(Application* app)
+ : ApplicationSecurityPolicy(app) {
}
-SecurityPolicyCSP::~SecurityPolicyCSP() {
+ApplicationSecurityPolicyCSP::~ApplicationSecurityPolicyCSP() {
}
-void SecurityPolicyCSP::Enforce() {
+void ApplicationSecurityPolicyCSP::Enforce() {
Manifest::Type manifest_type = app_->data()->manifest_type();
const char* scp_key = GetCSPKey(manifest_type);
CSPInfo* csp_info =
app_->render_process_host()->Send(
new ViewMsg_EnableSecurityMode(
ApplicationData::GetBaseURLFromApplicationId(app_->id()),
- SecurityPolicy::CSP));
+ ApplicationSecurityPolicy::CSP));
}
}
// Copyright (c) 2014 Intel Corporation. All rights reserved.
+// Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef XWALK_APPLICATION_COMMON_SECURITY_POLICY_H_
-#define XWALK_APPLICATION_COMMON_SECURITY_POLICY_H_
+#ifndef XWALK_APPLICATION_BROWSER_APPLICATION_SECURITY_POLICY_H_
+#define XWALK_APPLICATION_BROWSER_APPLICATION_SECURITY_POLICY_H_
#include <vector>
class Application;
-// FIXME(Mikhail): Move to application/browser folder.
-// Rename to ApplicationSecurityPolicy.
-class SecurityPolicy {
+class ApplicationSecurityPolicy {
public:
enum SecurityMode {
NoSecurity,
WARP
};
- explicit SecurityPolicy(Application* app);
- virtual ~SecurityPolicy();
+ explicit ApplicationSecurityPolicy(Application* app);
+ virtual ~ApplicationSecurityPolicy();
bool IsAccessAllowed(const GURL& url) const;
bool enabled_;
};
-class SecurityPolicyWARP : public SecurityPolicy {
+class ApplicationSecurityPolicyWARP : public ApplicationSecurityPolicy {
public:
- explicit SecurityPolicyWARP(Application* app);
- virtual ~SecurityPolicyWARP();
+ explicit ApplicationSecurityPolicyWARP(Application* app);
+ virtual ~ApplicationSecurityPolicyWARP();
virtual void Enforce() OVERRIDE;
};
-class SecurityPolicyCSP : public SecurityPolicy {
+class ApplicationSecurityPolicyCSP : public ApplicationSecurityPolicy {
public:
- explicit SecurityPolicyCSP(Application* app);
- virtual ~SecurityPolicyCSP();
+ explicit ApplicationSecurityPolicyCSP(Application* app);
+ virtual ~ApplicationSecurityPolicyCSP();
virtual void Enforce() OVERRIDE;
};
} // namespace application
} // namespace xwalk
-#endif // XWALK_APPLICATION_COMMON_SECURITY_POLICY_H_
+#endif // XWALK_APPLICATION_BROWSER_APPLICATION_SECURITY_POLICY_H_
Application::LaunchParams launch_params(
const base::CommandLine& cmd_line) {
- Application::LaunchParams params;
- params.force_fullscreen = cmd_line.HasSwitch(switches::kFullscreen);
- params.remote_debugging =
- cmd_line.HasSwitch(switches::kRemoteDebuggingPort);
+ Application::LaunchParams params = {
+ 0,
+ cmd_line.HasSwitch(switches::kFullscreen),
+ cmd_line.HasSwitch(switches::kRemoteDebuggingPort)};
return params;
}
const char* kSingletonElements[] = {
"allow-navigation",
+ "author",
"content-security-policy-report-only",
"content-security-policy",
"content"
for (KeyMapIterator iter = map.begin(); iter != map.end(); ++iter) {
std::string string;
- manifest->GetString(iter->first, &string);
- widget_info->SetString(iter->second, string);
+ bool result = manifest->GetString(iter->first, &string);
+ widget_info->SetString(iter->second, result ? string : "");
}
base::Value* pref_value = NULL;
namespace xwalk {
namespace application {
-Package::Package(const base::FilePath& source_path)
+Package::Package(const base::FilePath& source_path,
+ Manifest::Type manifest_type)
: source_path_(source_path),
is_extracted_(false),
is_valid_(false),
- name_(source_path_.BaseName().AsUTF8Unsafe()) {
+ name_(source_path_.BaseName().AsUTF8Unsafe()),
+ manifest_type_(manifest_type) {
}
Package::~Package() {
virtual bool ExtractTo(const base::FilePath& target_path);
protected:
- explicit Package(const base::FilePath& source_path);
+ Package(const base::FilePath& source_path, Manifest::Type manifest_type);
// Unzipping of the zipped file happens in a temporary directory
bool CreateTempDirectory();
scoped_ptr<base::ScopedFILE> file_;
}
WGTPackage::WGTPackage(const base::FilePath& path)
- : Package(path) {
+ : Package(path, Manifest::TYPE_WIDGET) {
if (!base::PathExists(path))
return;
- manifest_type_ = Manifest::TYPE_WIDGET;
base::FilePath extracted_path;
// FIXME : we should not call 'extract' here!
if (!ExtractToTemporaryDir(&extracted_path))
}
XPKPackage::XPKPackage(const base::FilePath& path)
- : Package(path) {
+ : Package(path, Manifest::TYPE_MANIFEST),
+ zip_addr_(0) {
if (!base::PathExists(path))
return;
- manifest_type_ = Manifest::TYPE_MANIFEST;
scoped_ptr<base::ScopedFILE> file(
new base::ScopedFILE(base::OpenFile(path, "rb")));
file_ = file.Pass();
header_.signature_size <= XPKPackage::kMaxSignatureKeySize) {
is_valid_ = true;
zip_addr_ = sizeof(header_) + header_.key_size + header_.signature_size;
- fseek(file_->get(), sizeof(header_), SEEK_SET);
+ if (fseek(file_->get(), sizeof(header_), SEEK_SET)) {
+ is_valid_ = false;
+ return;
+ }
key_.resize(header_.key_size);
size_t len = fread(&key_.front(), sizeof(uint8), header_.key_size,
file_->get());
bool XPKPackage::VerifySignature() {
// Set the file read position to the beginning of compressed resource file,
// which is behind the magic header, public key and signature key.
- fseek(file_->get(), zip_addr_, SEEK_SET);
+ if (fseek(file_->get(), zip_addr_, SEEK_SET))
+ return false;
crypto::SignatureVerifier verifier;
if (!verifier.VerifyInit(kSignatureAlgorithm,
sizeof(kSignatureAlgorithm),
std::string key;
std::string value;
bool read_only = false;
- dict->GetString(kPreferencesName, &key);
- dict->GetString(kPreferencesValue, &value);
- dict->GetBoolean(kPreferencesReadonly, &read_only);
- return AddEntry(key, value, read_only);
+ if (dict->GetString(kPreferencesName, &key) &&
+ dict->GetString(kPreferencesValue, &value) &&
+ dict->GetBoolean(kPreferencesReadonly, &read_only))
+ return AddEntry(key, value, read_only);
+ return false;
}
bool AppWidgetStorage::SaveConfigInfoInDB() {
'browser/application.h',
'browser/application_protocols.cc',
'browser/application_protocols.h',
+ 'browser/application_security_policy.cc',
+ 'browser/application_security_policy.h',
'browser/application_service.cc',
'browser/application_service.h',
'browser/application_system.cc',
'browser/application_system.h',
- 'common/security_policy.cc',
- 'common/security_policy.h',
-
'extension/application_runtime_extension.cc',
'extension/application_runtime_extension.h',
'extension/application_widget_extension.cc',
void XWalkExtensionAndroidInstance::HandleSyncMessage(
scoped_ptr<base::Value> msg) {
- base::StringValue* ret_val = new base::StringValue("");
+ scoped_ptr<base::Value> ret_val(new base::StringValue(""));
std::string value;
if (!msg->GetAsString(&value)) {
- SendSyncReplyToJS(scoped_ptr<base::Value>(ret_val));
+ SendSyncReplyToJS(ret_val.Pass());
return;
}
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null()) {
LOG(ERROR) << "No valid Java object is referenced for sync message routing";
- SendSyncReplyToJS(scoped_ptr<base::Value>(ret_val));
+ SendSyncReplyToJS(ret_val.Pass());
return;
}
env, obj.obj(), getID(), buffer.obj());
const char *str = env->GetStringUTFChars(ret.obj(), 0);
- ret_val = new base::StringValue(str);
+ ret_val.reset(new base::StringValue(str));
env->ReleaseStringUTFChars(ret.obj(), str);
- SendSyncReplyToJS(scoped_ptr<base::Value>(ret_val));
+ SendSyncReplyToJS(ret_val.Pass());
}
static jlong GetOrCreateExtension(JNIEnv* env, jobject obj, jstring name,
return;
const base::Value* value;
- msg.Get(0, &value);
+ if (!msg.Get(0, &value))
+ return;
it->second->HandleMessageFromNative(*value);
}
CHECK(base::SharedMemory::IsHandleValid(handle));
base::SharedMemory shared_memory(handle, true);
- shared_memory.Map(size);
+ if (!shared_memory.Map(size))
+ return;
IPC::Message message(static_cast<char*>(shared_memory.memory()), size);
OnMessageReceived(message);
+++ /dev/null
-From: Yannick GICQUEL <yannick.gicquel@open.eurogiciel.org>
-Date: Wed, 29 Jan 2014 11:20:11 +0100
-
-Build is broken on x86_64 due to narrowing warning treated as an error.
-This patch is a workaround to avoid this warning. Correction should be
-placed in generated code V8DOMConfiguration::ConstantConfiguration::value
-
-BUG=https://crosswalk-project.org/jira/browse/XWALK-917
-
-Signed-off-by: Yannick GICQUEL <yannick.gicquel@open.eurogiciel.org>
---- src/third_party/WebKit/Source/config.gyp
-+++ src/third_party/WebKit/Source/config.gyp
-@@ -84,6 +84,11 @@
- # nullptr) conflict with upcoming c++0x types.
- 'cflags_cc': ['-Wno-c++0x-compat'],
- }],
-+ ['gcc_version>=47', {
-+ # Disable warnings about narrowing conversion due to C++11 std.
-+ # Jira: https://crosswalk-project.org/jira/browse/XWALK-917
-+ 'cflags_cc': ['-Wno-narrowing'],
-+ }],
- ['OS=="linux" and target_arch=="arm"', {
- # Due to a bug in gcc arm, we get warnings about uninitialized
- # timesNewRoman.unstatic.3258 and colorTransparent.unstatic.4879.
-
%define _binary_payload w3.gzdio
Name: crosswalk
-Version: 11.39.250.0
+Version: 11.39.252.0
Release: 0
Summary: Chromium-based app runtime
License: (BSD-3-Clause and LGPL-2.1+)
Source1001: crosswalk.manifest
Source1002: %{name}.xml.in
Source1003: %{name}.png
-Patch9: Blink-Add-GCC-flag-Wno-narrowing-fix-64bits-build.patch
Patch10: crosswalk-do-not-look-for-gtk-dependencies-on-x11.patch
+BuildRequires: binutils-gold
BuildRequires: bison
BuildRequires: bzip2-devel
BuildRequires: elfutils
cp -a src/LICENSE LICENSE.chromium
cp -a src/xwalk/LICENSE LICENSE.xwalk
-%patch9
-
# The profiles using Wayland (and thus Ozone) do not need this patch.
%if !%{with wayland}
%patch10
GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_nacl=%{_disable_nacl}"
-# Linking fails in Tizen Common when fatal ld warnings are enabled. XWALK-1379.
-%if "%{profile}" == "common" || "%{profile}" == "generic"
+# Linking fails when fatal ld warnings are enabled. See XWALK-1379.
GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Ddisable_fatal_linker_warnings=1"
-%endif
# For building for arm in OBS, we need :
# -> to unset sysroot value.
# sysroot variable is automatically set for cross compilation to use arm-sysroot provided by Chromium project
-# -> to force system ld binary.
-# Indeed the build is made on Emulated / Virtualized environment that correspond
-# to the target.
-# gold ld used is avaible only for 32/64 bits Intel Arch.
# sysroot usage is not needed, we need to use arm libraries from the virtualized environment.
#
# Crosswalk build fails if the fpu selected in the gcc option is different from neon in case of arm7 compilation
# So force it.
%ifarch %{arm}
-GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Dsysroot= -Dlinux_use_gold_binary=0"
+GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Dsysroot= "
export CFLAGS=`echo $CFLAGS | sed s,-mfpu=vfpv3,-mfpu=neon,g`
export CXXFLAGS=`echo $CXXFLAGS | sed s,-mfpu=vfpv3,-mfpu=neon,g`
export FFLAGS=`echo $FFLAGS | sed s,-mfpu=vfpv3,-mfpu=neon,g`
${GYP_EXTRA_FLAGS} \
-Dchromeos=0 \
-Dclang=0 \
+-Dlinux_use_bundled_binutils=0 \
+-Dlinux_use_bundled_gold=0 \
+-Dlinux_use_gold_flags=1 \
-Dtizen=1 \
-Dpython_ver=2.7 \
-Duse_aura=1 \
%install
# Binaries.
-install -p -D %{SOURCE2} %{buildroot}%{_dbusservicedir}/org.crosswalkproject.Runtime1.service
-install -p -D xwalk.service %{buildroot}%{_systemduserservicedir}/xwalk.service
-install -p -D src/out/Release/xwalk %{buildroot}%{_libdir}/xwalk/xwalk
-install -p -D src/out/Release/xwalkctl %{buildroot}%{_bindir}/xwalkctl
-install -p -D src/out/Release/xwalk-launcher %{buildroot}%{_bindir}/xwalk-launcher
-install -p -D src/out/Release/xwalk_backend %{buildroot}%{_libdir}/xwalk/xwalk_backend
-install -p -D src/out/Release/lib/libxwalk_backend_lib.so %{buildroot}%{_libdir}/xwalk/libxwalk_backend_lib.so
+install -m 0755 -p -D src/out/Release/xwalk %{buildroot}%{_libdir}/xwalk/xwalk
+install -m 0755 -p -D src/out/Release/xwalkctl %{buildroot}%{_bindir}/xwalkctl
+install -m 0755 -p -D src/out/Release/xwalk-launcher %{buildroot}%{_bindir}/xwalk-launcher
+install -m 0755 -p -D src/out/Release/xwalk_backend %{buildroot}%{_libdir}/xwalk/xwalk_backend
# Supporting libraries and resources.
-install -p -D src/out/Release/icudtl.dat %{buildroot}%{_libdir}/xwalk/icudtl.dat
-install -p -D src/out/Release/libffmpegsumo.so %{buildroot}%{_libdir}/xwalk/libffmpegsumo.so
-install -p -D src/out/Release/xwalk.pak %{buildroot}%{_libdir}/xwalk/xwalk.pak
-mkdir -p %{buildroot}%{_datadir}/xwalk
-install -p -D src/xwalk/application/common/tizen/configuration/*.xsd %{buildroot}%{_datadir}/xwalk/
+install -m 0644 -p -D %{SOURCE2} %{buildroot}%{_dbusservicedir}/org.crosswalkproject.Runtime1.service
+install -m 0644 -p -D xwalk.service %{buildroot}%{_systemduserservicedir}/xwalk.service
+install -m 0644 -p -D src/out/Release/lib/libxwalk_backend_lib.so %{buildroot}%{_libdir}/xwalk/libxwalk_backend_lib.so
+install -m 0644 -p -D src/out/Release/icudtl.dat %{buildroot}%{_libdir}/xwalk/icudtl.dat
+install -m 0644 -p -D src/out/Release/libffmpegsumo.so %{buildroot}%{_libdir}/xwalk/libffmpegsumo.so
+install -m 0644 -p -D src/out/Release/xwalk.pak %{buildroot}%{_libdir}/xwalk/xwalk.pak
+install -d %{buildroot}%{_datadir}/xwalk
+install -m 0644 -p -D src/xwalk/application/common/tizen/configuration/*.xsd %{buildroot}%{_datadir}/xwalk
# PNaCl
%if ! %{_disable_nacl}
-install -p -D src/out/Release/nacl_bootstrap_raw %{buildroot}%{_libdir}/xwalk/nacl_bootstrap_raw
-install -p -D src/out/Release/nacl_helper %{buildroot}%{_libdir}/xwalk/nacl_helper
-install -p -D src/out/Release/nacl_helper_bootstrap %{buildroot}%{_libdir}/xwalk/nacl_helper_bootstrap
-install -p -D src/out/Release/nacl_irt_*.nexe %{buildroot}%{_libdir}/xwalk
-install -p -d %{buildroot}%{_libdir}/xwalk/pnacl
-install -m 0664 -p -D src/out/Release/pnacl/* %{buildroot}%{_libdir}/xwalk/pnacl
+install -m 0755 -p -D src/out/Release/nacl_bootstrap_raw %{buildroot}%{_libdir}/xwalk/nacl_bootstrap_raw
+install -m 0755 -p -D src/out/Release/nacl_helper %{buildroot}%{_libdir}/xwalk/nacl_helper
+install -m 0755 -p -D src/out/Release/nacl_helper_bootstrap %{buildroot}%{_libdir}/xwalk/nacl_helper_bootstrap
+install -m 0644 -p -D src/out/Release/nacl_irt_*.nexe %{buildroot}%{_libdir}/xwalk
+install -d %{buildroot}%{_libdir}/xwalk/pnacl
+install -m 0644 -p -D src/out/Release/pnacl/* %{buildroot}%{_libdir}/xwalk/pnacl
%endif
# Register xwalk to the package manager.
-install -p -D %{name}.xml %{buildroot}%{_manifestdir}/%{name}.xml
-install -p -D %{name}.png %{buildroot}%{_desktop_icondir}/%{name}.png
+install -m 0644 -p -D %{name}.xml %{buildroot}%{_manifestdir}/%{name}.xml
+install -m 0644 -p -D %{name}.png %{buildroot}%{_desktop_icondir}/%{name}.png
%post
mkdir -p %{_desktop_icondir_ro}
const base::FilePath& generated_name,
const base::FilePath& suggested_directory) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- if (!base::PathExists(suggested_directory))
- base::CreateDirectory(suggested_directory);
+ if (!base::CreateDirectory(suggested_directory)) {
+ LOG(ERROR) << "Failed to create directory: "
+ << suggested_directory.value();
+ return;
+ }
base::FilePath suggested_path(suggested_directory.Append(generated_name));
BrowserThread::PostTask(
#include "xwalk/runtime/browser/android/xwalk_download_resource_throttle.h"
#include "xwalk/runtime/browser/android/xwalk_login_delegate.h"
#include "xwalk/runtime/browser/xwalk_content_browser_client.h"
+#include "xwalk/runtime/common/xwalk_content_client.h"
using content::BrowserThread;
using navigation_interception::InterceptNavigationDelegate;
std::string mime_type;
int64 content_length = request->GetExpectedContentSize();
- request->extra_request_headers().GetHeader(
- net::HttpRequestHeaders::kUserAgent, &user_agent);
-
+ if (!request->extra_request_headers().GetHeader(
+ net::HttpRequestHeaders::kUserAgent, &user_agent))
+ user_agent = xwalk::GetUserAgent();
net::HttpResponseHeaders* response_headers = request->response_headers();
if (response_headers) {
XWalkBrowserMainParts::XWalkBrowserMainParts(
const content::MainFunctionParams& parameters)
: xwalk_runner_(XWalkRunner::GetInstance()),
+ extension_service_(NULL),
startup_url_(url::kAboutBlankURL),
parameters_(parameters),
run_default_message_loop_(true) {
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_platform_file.h"
#include "url/gurl.h"
-#include "xwalk/application/common/security_policy.h"
+#include "xwalk/application/browser/application_security_policy.h"
// Singly-included section for enums and custom IPC traits.
#ifndef XWALK_RUNTIME_COMMON_XWALK_COMMON_MESSAGES_H_
#define IPC_MESSAGE_START ViewMsgStart
-IPC_ENUM_TRAITS(xwalk::application::SecurityPolicy::SecurityMode)
+IPC_ENUM_TRAITS(xwalk::application::ApplicationSecurityPolicy::SecurityMode)
//-----------------------------------------------------------------------------
// RenderView messages
// These are messages sent from the browser to the renderer process.
IPC_MESSAGE_CONTROL2(ViewMsg_EnableSecurityMode, // NOLINT
GURL /* application url */,
- xwalk::application::SecurityPolicy::SecurityMode
+ xwalk::application::ApplicationSecurityPolicy::SecurityMode
/* security mode */)
IPC_MESSAGE_CONTROL1(ViewMsg_SuspendJSEngine, // NOLINT
}
XWalkRuntimeFeatures::XWalkRuntimeFeatures()
- : command_line_(0)
- , initialized_(false) {}
+ : command_line_(0),
+ initialized_(false),
+ experimental_features_enabled_(false) {}
void XWalkRuntimeFeatures::Initialize(const CommandLine* cmd) {
command_line_ = cmd;
feature.description = description;
feature.command_line_switch = command_line_switch;
feature.status = status;
+ feature.enabled = false;
if (experimental_features_enabled_) {
feature.enabled = true;
XWalkRenderProcessObserver::XWalkRenderProcessObserver()
: is_webkit_initialized_(false),
is_suspended_(false),
- security_mode_(application::SecurityPolicy::NoSecurity) {
+ security_mode_(application::ApplicationSecurityPolicy::NoSecurity) {
}
XWalkRenderProcessObserver::~XWalkRenderProcessObserver() {
}
void XWalkRenderProcessObserver::OnEnableSecurityMode(
- const GURL& url, application::SecurityPolicy::SecurityMode mode) {
+ const GURL& url,
+ application::ApplicationSecurityPolicy::SecurityMode mode) {
app_url_ = url;
security_mode_ = mode;
}
#include "content/public/renderer/render_process_observer.h"
#include "url/gurl.h"
#include "v8/include/v8.h"
-#include "xwalk/application/common/security_policy.h"
+#include "xwalk/application/browser/application_security_policy.h"
namespace blink {
class WebFrame;
virtual void OnRenderProcessShutdown() OVERRIDE;
bool IsWarpMode() const {
- return security_mode_ == application::SecurityPolicy::WARP;
+ return security_mode_ == application::ApplicationSecurityPolicy::WARP;
}
bool IsCSPMode() const {
- return security_mode_ == application::SecurityPolicy::CSP;
+ return security_mode_ == application::ApplicationSecurityPolicy::CSP;
}
const GURL& app_url() const { return app_url_; }
void OnSetAccessWhiteList(
const GURL& source, const GURL& dest, bool allow_subdomains);
void OnEnableSecurityMode(
- const GURL& url, application::SecurityPolicy::SecurityMode mode);
+ const GURL& url,
+ application::ApplicationSecurityPolicy::SecurityMode mode);
void OnSuspendJSEngine(bool is_pause);
#if defined(OS_TIZEN)
void OnUserAgentChanged(const std::string& userAgentString);
bool is_webkit_initialized_;
bool is_suspended_;
- application::SecurityPolicy::SecurityMode security_mode_;
+ application::ApplicationSecurityPolicy::SecurityMode security_mode_;
GURL app_url_;
};
} // namespace xwalk