Upstream version 5.34.97.0 64/17664/1
authorEurogiciel-BOT <eurogiciel.tizen@gmail.com>
Fri, 7 Mar 2014 09:48:17 +0000 (09:48 +0000)
committerEurogiciel-BOT <eurogiciel.tizen@gmail.com>
Fri, 7 Mar 2014 09:48:17 +0000 (09:48 +0000)
Upstream commit-id 13c061898000367aafcad2541a282b8c22929a33

Change-Id: I7502d3e0c446fa06d629e37c22cde36bebfde454
Signed-off-by: Eurogiciel-BOT <eurogiciel.tizen@gmail.com>
188 files changed:
packaging/crosswalk.spec
src/components/storage_monitor.gypi
src/content/child/runtime_features.cc
src/content/public/android/java/src/org/chromium/content/browser/ResourceExtractor.java
src/ozone/.gbp.conf [new file with mode: 0644]
src/ozone/README.md
src/ozone/RELEASE-NOTES.txt
src/ozone/impl/window_tree_host_delegate_wayland.cc
src/ozone/packaging/rpm/README [new file with mode: 0644]
src/ozone/packaging/rpm/chromium-browser.sh [new file with mode: 0755]
src/ozone/packaging/rpm/chromium-do-not-look-for-gtk2-when-using-aura.patch [new file with mode: 0644]
src/ozone/packaging/rpm/chromium-do-not-run-gn.patch [new file with mode: 0644]
src/ozone/packaging/rpm/chromium.manifest [new file with mode: 0644]
src/ozone/packaging/rpm/chromium.spec [new file with mode: 0644]
src/ozone/packaging/rpm/chromium.xml.in [new file with mode: 0644]
src/ozone/packaging/rpm/gbp-flat-tree.sh [new file with mode: 0755]
src/ozone/ui/events/event_converter_in_process.cc
src/ozone/wayland/wayland.gyp
src/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
src/xwalk/DEPS.xwalk
src/xwalk/VERSION
src/xwalk/app/android/app_hello_world/AndroidManifest.xml
src/xwalk/app/android/app_template/AndroidManifest.xml
src/xwalk/app/android/runtime_client/src/org/xwalk/app/runtime/extension/XWalkExtensionClient.java
src/xwalk/app/android/runtime_client/src/org/xwalk/app/runtime/extension/XWalkExtensionContextClient.java
src/xwalk/app/android/runtime_client_embedded_shell/AndroidManifest.xml
src/xwalk/app/android/runtime_client_shell/AndroidManifest.xml
src/xwalk/app/tools/android/customize.py
src/xwalk/app/tools/android/make_apk.py
src/xwalk/app/tools/android/manifest_json_parser.py
src/xwalk/application/browser/application.cc
src/xwalk/application/browser/application_service.cc
src/xwalk/application/common/application_data.cc
src/xwalk/application/common/application_data.h
src/xwalk/application/common/manifest.h
src/xwalk/application/test/application_browsertest.cc
src/xwalk/application/test/application_browsertest.h
src/xwalk/application/test/application_multi_app_test.cc
src/xwalk/build/android/generate_app_packaging_tool.py
src/xwalk/build/android/generate_xwalk_core_library.py
src/xwalk/build/android/xwalkcore_library_template/AndroidManifest.xml
src/xwalk/build/android/xwalkcore_library_template/project.properties
src/xwalk/build/system.gyp
src/xwalk/dbus/dbus_manager_tizen.cc
src/xwalk/extensions/browser/xwalk_extension_process_host.cc
src/xwalk/extensions/browser/xwalk_extension_process_host.h
src/xwalk/extensions/browser/xwalk_extension_service.cc
src/xwalk/extensions/browser/xwalk_extension_service.h
src/xwalk/extensions/common/xwalk_extension.cc
src/xwalk/extensions/common/xwalk_extension.h
src/xwalk/extensions/common/xwalk_extension_server.cc
src/xwalk/extensions/common/xwalk_external_extension.cc
src/xwalk/extensions/common/xwalk_external_extension.h
src/xwalk/extensions/extension_process/xwalk_extension_process.cc
src/xwalk/extensions/extension_process/xwalk_extension_process.h
src/xwalk/packaging/crosswalk.spec
src/xwalk/runtime/android/core/res/values/strings.xml [moved from src/xwalk/runtime/android/java/res/values/strings.xml with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/AndroidProtocolHandler.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/AndroidProtocolHandler.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/DownloadListener.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/DownloadListener.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/HttpAuthDatabase.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/HttpAuthDatabase.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/InMemorySharedPreferences.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/InMemorySharedPreferences.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/InterceptedRequestData.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/InterceptedRequestData.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/JsPromptResult.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/JsPromptResult.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/JsResult.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/JsResult.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/JsResultHandler.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/JsResultHandler.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/PageLoadListener.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/PageLoadListener.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/SslErrorHandler.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/SslErrorHandler.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/WebBackForwardList.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/WebBackForwardList.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/WebHistoryItem.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/WebHistoryItem.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkClient.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkClient.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkContent.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkContent.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkContentVideoViewClient.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkContentVideoViewClient.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkContentsClient.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkContentsClient.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkContentsClientBridge.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkContentsClientBridge.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkContentsClientCallbackHelper.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkContentsClientCallbackHelper.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkContentsIoThreadClient.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkContentsIoThreadClient.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkCookieManager.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkCookieManager.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkDevToolsServer.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkDevToolsServer.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkGeolocationPermissions.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkGeolocationPermissions.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkHttpAuthHandler.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkHttpAuthHandler.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkInternalResources.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkInternalResources.java with 95% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkLaunchScreenManager.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkLaunchScreenManager.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkMediaPlayerResourceLoadingFilter.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkMediaPlayerResourceLoadingFilter.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkNavigationHandler.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkNavigationHandler.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkNotificationService.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkNotificationService.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkSettings.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkSettings.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkView.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkView.java with 94% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkViewDelegate.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkViewDelegate.java with 98% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkWebChromeClient.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkWebChromeClient.java with 96% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkWebContentsDelegate.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkWebContentsDelegate.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/XWalkWebContentsDelegateAdapter.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/XWalkWebContentsDelegateAdapter.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/client/XWalkDefaultClient.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/client/XWalkDefaultClient.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/client/XWalkDefaultDownloadListener.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/client/XWalkDefaultDownloadListener.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/client/XWalkDefaultNavigationHandler.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/client/XWalkDefaultNavigationHandler.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/client/XWalkDefaultNotificationService.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/client/XWalkDefaultNotificationService.java with 93% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/client/XWalkDefaultWebChromeClient.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/core/client/XWalkDefaultWebChromeClient.java with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/XWalkCoreExtensionBridge.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/XWalkCoreExtensionBridge.java with 95% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/XWalkExtension.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/XWalkExtension.java with 99% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/XWalkExtensionBridge.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/XWalkExtensionBridge.java with 98% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/XWalkExtensionBridgeFactory.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/XWalkExtensionBridgeFactory.java with 93% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/XWalkExtensionClientImpl.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/XWalkExtensionClientImpl.java with 98% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/XWalkExtensionContext.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/XWalkExtensionContext.java with 97% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/XWalkExtensionContextWrapper.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/XWalkExtensionContextWrapper.java with 97% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/XWalkExtensionManager.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/XWalkExtensionManager.java with 79% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/DisplayManagerJBMR1.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/DisplayManagerJBMR1.java with 97% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/DisplayManagerNull.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/DisplayManagerNull.java with 94% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/OWNERS [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/OWNERS with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/XWalkDisplayManager.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/XWalkDisplayManager.java with 98% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/contacts/ContactConstants.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/contacts/ContactConstants.java with 99% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/contacts/ContactEventListener.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/contacts/ContactEventListener.java with 99% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/contacts/ContactFinder.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/contacts/ContactFinder.java with 99% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/contacts/ContactJson.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/contacts/ContactJson.java with 98% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/contacts/ContactSaver.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/contacts/ContactSaver.java with 99% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/contacts/ContactUtils.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/contacts/ContactUtils.java with 99% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/contacts/Contacts.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/contacts/Contacts.java with 96% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/contacts/contacts_api.js [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/contacts/contacts_api.js with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/device_capabilities/DeviceCapabilities.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/device_capabilities/DeviceCapabilities.java with 95% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/device_capabilities/DeviceCapabilitiesCPU.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/device_capabilities/DeviceCapabilitiesCPU.java with 96% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/device_capabilities/DeviceCapabilitiesCodecs.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/device_capabilities/DeviceCapabilitiesCodecs.java with 82% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/device_capabilities/DeviceCapabilitiesDisplay.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/device_capabilities/DeviceCapabilitiesDisplay.java with 97% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/device_capabilities/DeviceCapabilitiesMemory.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/device_capabilities/DeviceCapabilitiesMemory.java with 95% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/device_capabilities/DeviceCapabilitiesStorage.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/device_capabilities/DeviceCapabilitiesStorage.java with 92% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/device_capabilities/MediaCodec.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/device_capabilities/MediaCodec.java with 98% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/device_capabilities/MediaCodecNull.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/device_capabilities/MediaCodecNull.java with 86% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/device_capabilities/XWalkMediaCodec.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/device_capabilities/XWalkMediaCodec.java with 98% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/device_capabilities/device_capabilities_api.js [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/device_capabilities/device_capabilities_api.js with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/launchscreen/LaunchScreenExtension.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/launchscreen/LaunchScreenExtension.java with 90% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/messaging/Messaging.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/messaging/Messaging.java with 94% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/messaging/MessagingHelpers.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/messaging/MessagingHelpers.java with 96% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/messaging/MessagingManager.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/messaging/MessagingManager.java with 96% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/messaging/MessagingSmsConstMaps.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/messaging/MessagingSmsConstMaps.java with 95% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/messaging/MessagingSmsConsts.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/messaging/MessagingSmsConsts.java with 97% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/messaging/MessagingSmsManager.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/messaging/MessagingSmsManager.java with 99% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/messaging/messaging_api.js [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/messaging/messaging_api.js with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/presentation/OWNERS [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/presentation/OWNERS with 100% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/presentation/PresentationExtension.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/presentation/PresentationExtension.java with 98% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/presentation/PresentationView.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/presentation/PresentationView.java with 97% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/presentation/PresentationViewJBMR1.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/presentation/PresentationViewJBMR1.java with 97% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/presentation/PresentationViewNull.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/presentation/PresentationViewNull.java with 92% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/presentation/XWalkPresentationContent.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/presentation/XWalkPresentationContent.java with 98% similarity]
src/xwalk/runtime/android/core/src/org/xwalk/core/extension/api/screenorientation/ScreenOrientationExtension.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/extension/api/screenorientation/ScreenOrientationExtension.java with 96% similarity]
src/xwalk/runtime/android/core/strings/android_xwalk_strings.grd [moved from src/xwalk/runtime/android/java/strings/android_xwalk_strings.grd with 100% similarity]
src/xwalk/runtime/android/core_shell/AndroidManifest.xml
src/xwalk/runtime/android/java/src/org/xwalk/runtime/XWalkRuntimeViewProviderBase.java [deleted file]
src/xwalk/runtime/android/runtime/res/values/strings.xml [new file with mode: 0644]
src/xwalk/runtime/android/runtime/src/org/xwalk/runtime/MixedContext.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/MixContext.java with 86% similarity]
src/xwalk/runtime/android/runtime/src/org/xwalk/runtime/XWalkClientForTest.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/XWalkClientForTest.java with 100% similarity]
src/xwalk/runtime/android/runtime/src/org/xwalk/runtime/XWalkCoreProviderImpl.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/XWalkCoreProviderImpl.java with 89% similarity]
src/xwalk/runtime/android/runtime/src/org/xwalk/runtime/XWalkManifestReader.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/XWalkManifestReader.java with 100% similarity]
src/xwalk/runtime/android/runtime/src/org/xwalk/runtime/XWalkRuntimeView.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/XWalkRuntimeView.java with 97% similarity]
src/xwalk/runtime/android/runtime/src/org/xwalk/runtime/XWalkRuntimeViewProvider.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/XWalkRuntimeViewProvider.java with 100% similarity]
src/xwalk/runtime/android/runtime/src/org/xwalk/runtime/XWalkRuntimeViewProviderFactory.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/XWalkRuntimeViewProviderFactory.java with 100% similarity]
src/xwalk/runtime/android/runtime/src/org/xwalk/runtime/XWalkWebChromeClientForTest.java [moved from src/xwalk/runtime/android/java/src/org/xwalk/runtime/XWalkWebChromeClientForTest.java with 100% similarity]
src/xwalk/runtime/android/runtime_lib/AndroidManifest.xml [moved from src/xwalk/runtime/android/runtimelib/AndroidManifest.xml with 98% similarity]
src/xwalk/runtime/android/runtime_lib/res/drawable-hdpi/crosswalk.png [moved from src/xwalk/runtime/android/runtimelib/res/drawable-hdpi/crosswalk.png with 100% similarity]
src/xwalk/runtime/android/runtime_lib/res/drawable-ldpi/crosswalk.png [moved from src/xwalk/runtime/android/runtimelib/res/drawable-ldpi/crosswalk.png with 100% similarity]
src/xwalk/runtime/android/runtime_lib/res/drawable-mdpi/crosswalk.png [moved from src/xwalk/runtime/android/runtimelib/res/drawable-mdpi/crosswalk.png with 100% similarity]
src/xwalk/runtime/android/runtime_lib/res/drawable-xhdpi/crosswalk.png [moved from src/xwalk/runtime/android/runtimelib/res/drawable-xhdpi/crosswalk.png with 100% similarity]
src/xwalk/runtime/android/runtime_lib/src/org/xwalk/runtime/lib/RuntimeLibApplication.java [moved from src/xwalk/runtime/android/runtimelib/src/org/xwalk/runtime/lib/RuntimeLibApplication.java with 100% similarity]
src/xwalk/runtime/android/runtime_shell/AndroidManifest.xml
src/xwalk/runtime/browser/android/xwalk_contents_io_thread_client.h
src/xwalk/runtime/browser/android/xwalk_contents_io_thread_client_impl.cc
src/xwalk/runtime/browser/android/xwalk_login_delegate.cc
src/xwalk/runtime/browser/android/xwalk_login_delegate.h
src/xwalk/runtime/browser/runtime.cc
src/xwalk/runtime/browser/xwalk_app_extension_bridge.cc
src/xwalk/runtime/browser/xwalk_app_extension_bridge.h
src/xwalk/runtime/browser/xwalk_browser_main_parts.cc
src/xwalk/runtime/browser/xwalk_browser_main_parts_android.cc
src/xwalk/runtime/common/xwalk_paths.cc
src/xwalk/sysapps/device_capabilities/storage_info_provider_chromium.h
src/xwalk/sysapps/sysapps_tests.gyp
src/xwalk/test/android/core/javatests/AndroidManifest.xml
src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/XWalkClientShouldInterceptRequestTest.java [new file with mode: 0644]
src/xwalk/test/android/data/index.html
src/xwalk/test/android/runtime/javatests/AndroidManifest.xml
src/xwalk/test/android/runtime_client/javatests/AndroidManifest.xml
src/xwalk/test/android/runtime_client_embedded/javatests/AndroidManifest.xml
src/xwalk/test/base/in_process_browser_test.cc
src/xwalk/test/base/in_process_browser_test.h
src/xwalk/test/base/xwalk_test_utils.cc
src/xwalk/tizen/appcore_context.cc [deleted file]
src/xwalk/tizen/appcore_context.h [deleted file]
src/xwalk/tizen/xwalk_tizen.gypi
src/xwalk/tools/fetch_deps.py
src/xwalk/xwalk_android.gypi
src/xwalk/xwalk_android_app.gypi
src/xwalk/xwalk_android_tests.gypi

index 2aebc90..146cb99 100644 (file)
@@ -1,9 +1,11 @@
+%bcond_with x
+%bcond_with wayland
+
 Name:           crosswalk
-Version:        5.34.92.0
+Version:        5.34.97.0
 Release:        0
 Summary:        Crosswalk is an app runtime based on Chromium
-# License:        (BSD-3-Clause and LGPL-2.1+)
-License:        BSD-3-Clause
+License:        (BSD-3-Clause and LGPL-2.1+)
 Group:          Web Framework/Web Run Time
 Url:            https://github.com/otcshare/crosswalk
 Source:         %{name}.tar
@@ -30,11 +32,8 @@ BuildRequires:  perl
 BuildRequires:  which
 BuildRequires:  pkgconfig(alsa)
 BuildRequires:  pkgconfig(appcore-common)
-BuildRequires:  pkgconfig(appcore-efl)
-BuildRequires:  pkgconfig(aul)
 BuildRequires:  pkgconfig(audio-session-mgr)
 BuildRequires:  pkgconfig(cairo)
-BuildRequires:  pkgconfig(capi-appfw-application)
 BuildRequires:  pkgconfig(capi-location-manager)
 BuildRequires:  pkgconfig(dbus-1)
 BuildRequires:  pkgconfig(fontconfig)
@@ -57,6 +56,7 @@ BuildRequires:  pkgconfig(nspr)
 BuildRequires:  pkgconfig(nss)
 BuildRequires:  pkgconfig(sensor)
 BuildRequires:  pkgconfig(vconf)
+%if %{with x}
 BuildRequires:  pkgconfig(x11)
 BuildRequires:  pkgconfig(xcomposite)
 BuildRequires:  pkgconfig(xcursor)
@@ -69,13 +69,7 @@ BuildRequires:  pkgconfig(xrender)
 BuildRequires:  pkgconfig(xscrnsaver)
 BuildRequires:  pkgconfig(xt)
 BuildRequires:  pkgconfig(xtst)
-
-# Depending on the Tizen version and profile we are building for, we have
-# different dependencies, patches and gyp options to pass. Checking for
-# specific profiles is not very future-proof. We therefore try to check for
-# either specific features that may be enabled in the current profile (such as
-# Wayland support).
-%bcond_with wayland
+%endif
 
 %if %{with wayland}
 BuildRequires:  pkgconfig(wayland-client)
@@ -91,8 +85,7 @@ Crosswalk is an app runtime based on Chromium. It is an open source project star
 
 %package emulator-support
 Summary:        Support files necessary for running Crosswalk on the Tizen emulator
-# License:        (BSD-3-Clause and LGPL-2.1+)
-License:        BSD-3-Clause
+License:        (BSD-3-Clause and LGPL-2.1+)
 Group:          Web Framework/Web Run Time
 Url:            https://github.com/otcshare/crosswalk
 
@@ -244,7 +237,7 @@ install -p -D ../%{name}.png %{buildroot}%{_desktop_icondir}/%{name}.png
 
 %files
 %manifest %{name}.manifest
-%license AUTHORS.chromium LICENSE.chromium LICENSE.xwalk
+%license AUTHORS.chromium LICENSE.chromium LICENSE.xwalk
 %{_bindir}/xwalk
 %{_bindir}/xwalkctl
 %{_bindir}/xwalk-launcher
index 9b6c3d4..2da2152 100644 (file)
         '../chrome/browser/storage_monitor/volume_mount_watcher_win.h',
       ],
       'conditions': [
+        ['OS == "mac"', {
+          'link_settings': {
+            'libraries': [
+              '$(SDKROOT)/System/Library/Frameworks/DiskArbitration.framework',
+              '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
+              '$(SDKROOT)/System/Library/Frameworks/ImageCaptureCore.framework',
+            ],
+          },
+        }],
         ['OS=="linux"', {
           'dependencies': [
             '../build/linux/system.gyp:udev',
index 796f684..f6d797c 100644 (file)
@@ -11,7 +11,6 @@
 
 #if defined(OS_ANDROID)
 #include <cpu-features.h>
-#include "base/android/build_info.h"
 #include "media/base/android/media_codec_bridge.h"
 #endif
 
@@ -30,7 +29,8 @@ static void SetRuntimeFeatureDefaultsForPlatform() {
   // WebAudio is enabled by default only on ARM and only when the
   // MediaCodec API is available.
   WebRuntimeFeatures::enableWebAudio(
-    media::MediaCodecBridge::IsAvailable());
+      media::MediaCodecBridge::IsAvailable() &&
+      (android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM));
   // Android does not support the Gamepad API.
   WebRuntimeFeatures::enableGamepad(false);
   // Android does not have support for PagePopup
index 856c69d..17ad025 100644 (file)
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.HashSet;
+import java.util.Set;
 import java.util.concurrent.CancellationException;
 import java.util.concurrent.ExecutionException;
 import java.util.regex.Pattern;
@@ -38,12 +39,18 @@ public class ResourceExtractor {
     private static final String PAK_FILENAMES = "Pak filenames";
 
     private static String[] sMandatoryPaks = null;
+    private static ResourceIntercepter sIntercepter = null;
 
     // By default, we attempt to extract a pak file for the users
     // current device locale. Use setExtractImplicitLocale() to
     // change this behavior.
     private static boolean sExtractImplicitLocalePak = true;
 
+    public interface ResourceIntercepter {
+        Set<String> getInterceptableResourceList();
+        InputStream interceptLoadingForResource(String resource);
+    }
+
     private class ExtractTask extends AsyncTask<Void, Void, Void> {
         private static final int BUFFER_SIZE = 16 * 1024;
 
@@ -106,6 +113,18 @@ public class ResourceExtractor {
                 // created above.
                 byte[] buffer = null;
                 String[] files = manager.list("");
+                if (sIntercepter != null) {
+                    Set<String> filesIncludingInterceptableFiles =
+                            sIntercepter.getInterceptableResourceList();
+                    if (filesIncludingInterceptableFiles != null &&
+                            !filesIncludingInterceptableFiles.isEmpty()) {
+                        for (String file : files) {
+                            filesIncludingInterceptableFiles.add(file);
+                        }
+                        files = new String[filesIncludingInterceptableFiles.size()];
+                        filesIncludingInterceptableFiles.toArray(files);
+                    }
+                }
                 for (String file : files) {
                     if (!paksToInstall.matcher(file).matches()) {
                         continue;
@@ -118,7 +137,10 @@ public class ResourceExtractor {
                     InputStream is = null;
                     OutputStream os = null;
                     try {
-                        is = manager.open(file);
+                        if (sIntercepter != null) {
+                            is = sIntercepter.interceptLoadingForResource(file);
+                        }
+                        if (is == null) is = manager.open(file);
                         os = new FileOutputStream(output);
                         Log.i(LOGTAG, "Extracting resource " + file);
                         if (buffer == null) {
@@ -249,6 +271,19 @@ public class ResourceExtractor {
     }
 
     /**
+     * Allow embedders to intercept the resource loading process. Embedders may
+     * want to load paks from res/raw instead of assets, since assets are not
+     * supported in Android library project.
+     * @param intercepter The instance of intercepter which provides the files list
+     * to intercept and the inputstream for the files it wants to intercept with.
+     */
+    public static void setResourceIntercepter(ResourceIntercepter intercepter) {
+        assert (sInstance == null || sInstance.mExtractTask == null)
+                : "Must be called before startExtractingResources is called";
+        sIntercepter = intercepter;
+    }
+
+    /**
      * By default the ResourceExtractor will attempt to extract a pak resource for the users
      * currently specified locale. This behavior can be changed with this function and is
      * only needed by tests.
diff --git a/src/ozone/.gbp.conf b/src/ozone/.gbp.conf
new file mode 100644 (file)
index 0000000..f8d2952
--- /dev/null
@@ -0,0 +1,12 @@
+# For more information about this file, see git-buildpackage's documentation.
+# It is used by gbs in order to build Chromium packages for Tizen.
+
+[DEFAULT]
+# This postexport hook is used to replace the default chromium.tar file
+# generated with `git archive' (and which only contains the contents of
+# chromium.git) with a full-blown tar file that contains all source code
+# required to build Chromium. Additionally, the new tar file's members all
+# contain their original mtimes, which is helpful if one wants to try an
+# incremental Tizen build. The script is run from the temporary directory
+# containing the contents of packaging/ that are used by git-buildpackage.
+postexport = ./gbp-flat-tree.sh
index 44af198..c369c47 100644 (file)
@@ -82,6 +82,10 @@ That's all. At this point you should be able to connect Chromium on Weston using
   $ ~/git/weston/src/weston &
   $ ./out/Debug/chrome --no-sandbox
   ```
+  
+###Working with Ozone-Wayland Release branch:
+
+Instructions can be found here: https://github.com/01org/ozone-wayland/wiki/Releasing#wiki-releasebranch
 
 ## Gardening
 
index f3ab813..cfa414d 100644 (file)
@@ -6,6 +6,7 @@ Release Date: 17 Feb 2014.
 Based on Chromium-
 Version: 34.0.1809.2.
 Channel: Beta.
+Branch: 1809.
 Revision: f9d72a2c6700e0e4a4fb7d17ca5b9203f5500bcd.
 
 ---------------------------------------------------------------------
index 1a39693..cb6a505 100644 (file)
@@ -87,7 +87,7 @@ void WindowTreeHostDelegateWayland::SetActiveWindow(
   unsigned window_handle = current_active_window_->window_;
   if (windows.front() != window_handle) {
     windows.remove(window_handle);
-    windows.insert(open_windows().begin(), window_handle);
+    windows.insert(windows.begin(), window_handle);
   }
 
   current_active_window_->Activate();
diff --git a/src/ozone/packaging/rpm/README b/src/ozone/packaging/rpm/README
new file mode 100644 (file)
index 0000000..0f6b63f
--- /dev/null
@@ -0,0 +1,82 @@
+This directory contains a collection of tools and RPM-related files used to
+build Chromium browser RPMs for Tizen IVI.
+
+BUILD INSTRUCTIONS
+------------------
+
+In the simplest case, a call to `gbs build' from the ozone/ directory suffices.
+It should create a Tizen chroot and launch a build from there, requiring no
+further interaction and producing a few RPMs at the end of the process.
+
+For more information on which other parameters one is normally expected to pass
+to `gbs build' (including "-A" to specify the Tizen architecture) and also on
+gbs' configuration file, please consult gbs' documentation.
+
+A very important thing to notice is that, due to the way the integration with
+gbs is implemented, _anything_ currently present in your source tree will be
+built, regardless of whether "--include-all" is passed to `gbs build' or not.
+
+INCREMENTAL BUILDS
+------------------
+
+By default, Chromium browser is built inside src/out/Release inside the Chromium's
+directory. Also by default, each call to `gbs build' will erase the RPM build
+root in the Tizen chroot, which means your previous build will be lost.
+
+To avoid that, you need to specify a different build directory, one located
+outside the build root. The new directory should be passed as a macro called
+BUILDDIR_NAME:
+
+  $ cd /path/to/src/ozone
+  $ gbs build -A i586 --define 'BUILDDIR_NAME /var/tmp/chromium-build'
+
+  (Note `/var/tmp/chromium-build` is still a directory inside the chroot, so to
+  the host system this is actually something like
+  `/home/user/GBSROOT/local/BUILD-ROOTS/scratch.i586.0/var/tmp/chromium-build`).
+
+In case the build gets broken somehow, one can then just remove whatever is
+faulty in the build directory (or the whole directory).
+
+It is important to note that depending on what the .spec file looks like, an
+incremental build may still rebuild some files even if nothing has changed: for
+example, if patches are applied as part of the %prep stage and they modify some
+source files, these ones will always be rebuilt.
+
+This method is not completely fail-proof, though, and a full rebuild may end up
+being triggered if:
+
+- Some problem happens in the `gbs build' call and the whole chroot (not only
+  the RPM build root) ends up being erased.
+
+- You use `gbs chroot' to call `make' yourself, as a simple change in the
+  original CFLAGS or CXXFLAGS triggers a rebuild of all files.
+
+- You change your source directory name for some reason. This is why
+  the generated source tarball does not contain a version number, for
+  example.
+
+FURTHER DETAILS
+---------------
+
+gbs, the tool used to generate RPM packages for Tizen, expects a single git
+tree with all the necessary sources available so that it can run `git archive',
+produce a tarball, extract it into a chroot and build from there.
+
+Chromium, on the other hand, is made of many independent git and Subversion
+repositories put together in a single directory structure. Additionally,
+Chromium is checked out as a subdirectory of Chromium itself. This all is
+unusual and does not work with gbs by default.
+
+The whole problem is worked around by having using git-buildpackage's hooks
+mechanism: the original tarball generated by git-buildpackage's call to `git
+archive' is replaced by a new one generated with the gbp-flat-tree.sh script
+located in packaging/. This new tarball contains everything in src/, except for
+a few files we exclude by default (version control files and directories, for
+example).
+
+The gbp-flat-tree.sh script also helps us with incremental builds: since the
+new tarball is generated with `tar' itself, all the files in the archive have
+their correct mtimes (which is not the case with `git archive'). This, together
+with an external build directory, allows one to avoid rebuilding all files
+every time, since the source files with the right modification times _and_ the
+build directory are preserved across builds.
diff --git a/src/ozone/packaging/rpm/chromium-browser.sh b/src/ozone/packaging/rpm/chromium-browser.sh
new file mode 100755 (executable)
index 0000000..b7357a6
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+/usr/lib/chromium/chrome --no-sandbox
diff --git a/src/ozone/packaging/rpm/chromium-do-not-look-for-gtk2-when-using-aura.patch b/src/ozone/packaging/rpm/chromium-do-not-look-for-gtk2-when-using-aura.patch
new file mode 100644 (file)
index 0000000..be49464
--- /dev/null
@@ -0,0 +1,22 @@
+Author: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+
+Since there is no GTK+2 package for Tizen 2.1 Mobile and we already use Aura
+instead of GTK+2 directly, there should be no need to look for GTK+2 at all.
+
+Upstreaming this patch depends on a hard GTK+2 dependency on
+remoting/remoting.gyp being removed in chromium. It does not affect crosswalk
+because we do not have any dependency on remoting.gyp.
+
+Upstream patch: https://codereview.chromium.org/19531008
+Depends on:     https://code.google.com/p/chromium/issues/detail?id=247213
+--- src/build/linux/system.gyp
++++ src/build/linux/system.gyp
+@@ -18,7 +18,7 @@
+     'linux_link_libbrlapi%': 0,
+   },
+   'conditions': [
+-    [ 'chromeos==0', {
++    [ 'chromeos==0 and toolkit_uses_gtk==1', {
+       # Hide GTK and related dependencies for Chrome OS, so they won't get
+       # added back to Chrome OS. Don't try to use GTK on Chrome OS.
+       'targets': [
diff --git a/src/ozone/packaging/rpm/chromium-do-not-run-gn.patch b/src/ozone/packaging/rpm/chromium-do-not-run-gn.patch
new file mode 100644 (file)
index 0000000..1eee908
--- /dev/null
@@ -0,0 +1,34 @@
+Author: Joone Hur <joone.hur@intel.com>
+
+Make is used to build chromium instead of ninja when creating rpm packages using gbs
+because depot_tools needs to be copied manually to chroot environment. However,
+gyp_chromium still runs GN even if we do not use ninja, which requires Gtk+2, but
+Tizen IVI does not provide Gtk+2 packages.
+
+This patch allows only to run GN when ninja is used.
+
+For your information, GN is a meta-build system that generates ninja files.
+
+--- src/build/gyp_chromium
++++ src/build/gyp_chromium
+@@ -39,7 +39,8 @@ sys.path.insert(1, os.path.join(chrome_src, 'third_party', 'liblouis'))
+ sys.path.insert(1, os.path.join(chrome_src, 'third_party', 'WebKit',
+     'Source', 'build', 'scripts'))
+
+-import find_depot_tools
++if os.environ.get('GYP_GENERATORS') != 'make':
++  import find_depot_tools
+
+ # On Windows, Psyco shortens warm runs of build/gyp_chromium by about
+ # 20 seconds on a z600 machine with 12 GB of RAM, from 90 down to 70
+@@ -475,8 +476,9 @@ if __name__ == '__main__':
+     args.append('--check')
+
+   supplemental_includes = GetSupplementalFiles()
+-  if not RunGN(supplemental_includes):
+-    sys.exit(1)
++  if os.environ.get('GYP_GENERATORS') != 'make':
++    if not RunGN(supplemental_includes):
++      sys.exit(1)
+   args.extend(
+       ['-I' + i for i in additional_include_files(supplemental_includes, args)])
diff --git a/src/ozone/packaging/rpm/chromium.manifest b/src/ozone/packaging/rpm/chromium.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/src/ozone/packaging/rpm/chromium.spec b/src/ozone/packaging/rpm/chromium.spec
new file mode 100644 (file)
index 0000000..2d59985
--- /dev/null
@@ -0,0 +1,212 @@
+Name:           chromium
+Version:        34.0.1829.0
+Release:        0
+Summary:        Chromium ozone-wayland
+License:        BSD-3-Clause
+Group:          Web Framework/chromium
+Url:            https://01.org/ozone-wayland
+Source:         %{name}.tar
+Source1:        chromium-browser.sh
+Source1001:     chromium.manifest
+Patch1:         %{name}-do-not-look-for-gtk2-when-using-aura.patch
+Patch2:         %{name}-do-not-run-gn.patch
+
+BuildRequires:  bison
+BuildRequires:  bzip2-devel
+BuildRequires:  expat-devel
+BuildRequires:  flex
+BuildRequires:  gperf
+BuildRequires:  libcap-devel
+BuildRequires:  python
+BuildRequires:  python-xml
+BuildRequires:  perl
+BuildRequires:  which
+BuildRequires:  pkgconfig(alsa)
+BuildRequires:  pkgconfig(aul)
+BuildRequires:  pkgconfig(audio-session-mgr)
+BuildRequires:  pkgconfig(cairo)
+BuildRequires:  pkgconfig(capi-appfw-application)
+BuildRequires:  pkgconfig(capi-location-manager)
+BuildRequires:  pkgconfig(dbus-1)
+BuildRequires:  pkgconfig(fontconfig)
+BuildRequires:  pkgconfig(freetype2)
+BuildRequires:  pkgconfig(gles20)
+BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires:  pkgconfig(haptic)
+BuildRequires:  pkgconfig(icu-i18n)
+BuildRequires:  pkgconfig(libdrm)
+BuildRequires:  pkgconfig(libexif)
+BuildRequires:  pkgconfig(libpci)
+BuildRequires:  pkgconfig(libpulse)
+BuildRequires:  pkgconfig(libudev)
+BuildRequires:  pkgconfig(libxml-2.0)
+BuildRequires:  pkgconfig(libxslt)
+BuildRequires:  pkgconfig(nss)
+BuildRequires:  pkgconfig(pango)
+BuildRequires:  pkgconfig(pkgmgr-info)
+BuildRequires:  pkgconfig(pkgmgr-parser)
+BuildRequires:  pkgconfig(nspr)
+BuildRequires:  pkgconfig(sensor)
+BuildRequires:  pkgconfig(vconf)
+BuildRequires:  pkgconfig(wayland-client)
+BuildRequires:  pkgconfig(wayland-cursor)
+BuildRequires:  pkgconfig(wayland-egl)
+BuildRequires:  pkgconfig(x11)
+BuildRequires:  pkgconfig(xcomposite)
+BuildRequires:  pkgconfig(xcursor)
+BuildRequires:  pkgconfig(xdamage)
+BuildRequires:  pkgconfig(xext)
+BuildRequires:  pkgconfig(xfixes)
+BuildRequires:  pkgconfig(xi)
+BuildRequires:  pkgconfig(xkbcommon)
+BuildRequires:  pkgconfig(xrandr)
+BuildRequires:  pkgconfig(xrender)
+BuildRequires:  pkgconfig(xscrnsaver)
+BuildRequires:  pkgconfig(xt)
+BuildRequires:  pkgconfig(xtst)
+
+%description
+# Ozone is a set of classes in Chromium for abstracting different window systems on Linux. It provides abstraction for the construction of accelerated surfaces underlying Aura UI framework, input devices assignment, and event handling.
+
+%prep
+%setup -q -n chromium
+
+cp %{SOURCE1001} .
+
+cp -a src/AUTHORS AUTHORS.chromium
+cp -a src/LICENSE LICENSE.chromium
+cp -a src/ozone/AUTHORS AUTHORS.ozone-wayland
+cp -a src/ozone/LICENSE LICENSE.ozone-wayland
+
+%patch1
+%patch2
+
+%build
+
+# For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
+# src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
+# CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
+export CFLAGS=`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`
+
+# Building the RPM in the GBS chroot fails with errors such as
+#   /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
+#       failed to set dynamic section sizes: Memory exhausted
+# For now, work around it by passing a GNU ld-specific flag that optimizes the
+# linker for memory usage.
+export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+# Support building in a non-standard directory, possibly outside %{_builddir}.
+# Since the build root is erased every time a new build is performed, one way
+# to avoid losing the build directory is to specify a location outside the
+# build root to the BUILDDIR_NAME definition, such as "/var/tmp/chromium-build"
+# (remember all paths are still inside the chroot):
+#    gbs build --define 'BUILDDIR_NAME /some/path'
+#
+# The --depth and --generator-output combo is used to put all the Makefiles
+# inside the build directory, and (this is the important part) keep file lists
+# (generatedwith <|() in gyp) in the build directory as well, otherwise they
+# will be in the source directory, erased every time and trigger an almost full
+# Blink rebuild (among other smaller targets).
+# We cannot always pass those flags, though, because gyp's make generator does
+# not work if the --generator-output is the top-level source directory.
+BUILDDIR_NAME="%{?BUILDDIR_NAME}"
+if [ -z "${BUILDDIR_NAME}" ]; then
+   BUILDDIR_NAME="."
+else
+   GYP_EXTRA_FLAGS="--depth=. --generator-output=${BUILDDIR_NAME}"
+fi
+
+# Change src/ so that we can pass "." to --depth below, otherwise we would need
+# to pass "src" to it, but this confuses the gyp make generator, that expects
+# to be called from the root source directory.
+cd src
+
+# --no-parallel is added because chroot does not mount a /dev/shm, this will
+# cause python multiprocessing.SemLock error.
+#https://github.com/01org/ozone-wayland/issues/147
+
+BUILD_TOOL="%{?BUILD_TOOL}"
+if [ -z "${BUILD_TOOL}" ]; then
+    BUILD_TOOL="make"
+else
+    BUILD_TOOL=${BUILD_TOOL}
+    PATH=$PATH:/home/abuild/depot_tools
+fi
+
+export GYP_GENERATORS=${BUILD_TOOL}
+./build/gyp_chromium \
+--no-parallel \
+-Duse_ash=0 \
+-Duse_ozone=1 \
+-Dchromeos=0 \
+-Ddisable_nacl=1 \
+-Dpython_ver=2.7 \
+-Duse_aura=1 \
+-Duse_cups=0 \
+-Duse_gconf=0 \
+-Duse_kerberos=0 \
+-Duse_system_bzip2=1 \
+-Duse_system_icu=0 \
+-Duse_system_libexif=1 \
+-Duse_system_libxml=1 \
+-Duse_system_nspr=1 \
+-Denable_xi21_mt=1 \
+-Duse_xi2_mt=0 \
+-Dtarget_arch=ia32 \
+-Duse_alsa=0 \
+-Dlogging_like_official_build=1 \
+-Dtracing_like_official_build=1 \
+-Drelease_unwind_tables=0 \
+-Dlinux_dump_symbols=1
+
+%if "${BUILD_TOOL}" == "ninja"
+ninja %{?_smp_mflags} -C "${BUILDDIR_NAME}" chrome
+%else
+make %{?_smp_mflags} -C "${BUILDDIR_NAME}" BUILDTYPE=Release chrome
+%endif
+
+%install
+# Support building in a non-standard directory, possibly outside %{_builddir}.
+# Since the build root is erased every time a new build is performed, one way
+# to avoid losing the build directory is to specify a location outside the
+# build root to the BUILDDIR_NAME definition, such as "/var/tmp/chromium-build"
+# (remember all paths are still inside the chroot):
+#    gbs build --define 'BUILDDIR_NAME /some/path'
+BUILDDIR_NAME="%{?BUILDDIR_NAME}"
+if [ -z "${BUILDDIR_NAME}" ]; then
+   BUILDDIR_NAME="."
+fi
+
+# Since BUILDDIR_NAME can be either a relative path or an absolute one, we need
+# to cd into src/ so that it means the same thing in the build and install
+# stages: during the former, a relative location refers to a place inside src/,
+# whereas during the latter a relative location by default would refer to a
+# place one directory above src/. If BUILDDIR_NAME is an absolute path, this is
+# irrelevant anyway.
+cd src
+
+# Binaries.
+install -p -D %{SOURCE1} %{buildroot}%{_bindir}/chromium-browser
+install -p -D ${BUILDDIR_NAME}/out/Release/chrome %{buildroot}%{_libdir}/chromium/chrome
+cp -R ${BUILDDIR_NAME}/out/Release/locales %{buildroot}%{_libdir}/chromium/
+
+# Workaround to avoid eu-strip error.
+strip %{buildroot}%{_libdir}/chromium/chrome
+
+# Supporting libraries and resources.
+install -p -D ${BUILDDIR_NAME}/out/Release/libffmpegsumo.so %{buildroot}%{_libdir}/chromium/libffmpegsumo.so
+strip %{buildroot}%{_libdir}/chromium/libffmpegsumo.so
+install -p -D ${BUILDDIR_NAME}/out/Release/resources.pak %{buildroot}%{_libdir}/chromium/resources.pak
+install -p -D ${BUILDDIR_NAME}/out/Release/chrome_100_percent.pak %{buildroot}%{_libdir}/chromium/chrome_100_percent.pak
+install -p -D ${BUILDDIR_NAME}/out/Release/icudtl.dat %{buildroot}%{_libdir}/chromium/icudtl.dat
+
+%files
+%manifest %{name}.manifest
+%license AUTHORS.chromium LICENSE.chromium AUTHORS.ozone-wayland LICENSE.ozone-wayland
+%{_bindir}/chromium-browser
+%{_libdir}/chromium/libffmpegsumo.so
+%{_libdir}/chromium/chrome
+%{_libdir}/chromium/resources.pak
+%{_libdir}/chromium/chrome_100_percent.pak
+%{_libdir}/chromium/icudtl.dat
+%{_libdir}/chromium/locales/*
diff --git a/src/ozone/packaging/rpm/chromium.xml.in b/src/ozone/packaging/rpm/chromium.xml.in
new file mode 100644 (file)
index 0000000..00abf18
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="chromium" version="@VERSION@" install-location="internal-only">
+       <label>Chromium Browser</label>
+       <author href="https://01.org/ozone-wayland">Ozone Wayland Authors</author>
+       <description>Chromium Browser</description>
+       <ui-application appid="chromium-browser" exec="/usr/lib/chromium/chrome" nodisplay="false" multiple="false" type="capp" taskmanage="true">
+               <label>Chromium Browser</label>
+               <icon>chromium.png</icon>
+       </ui-application>
+</manifest>
diff --git a/src/ozone/packaging/rpm/gbp-flat-tree.sh b/src/ozone/packaging/rpm/gbp-flat-tree.sh
new file mode 100755 (executable)
index 0000000..b269b22
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# Copyright (c) 2014 Intel Corporation. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This script is expected to be run by `git-buildpackage' (called by `gbs
+# build') as a postexport hook. Its purpose is to remove the tar file generated
+# by `gbs export' with `git archive' and create a new archive with tar itself.
+#
+# It is helpful in two ways:
+# - It automates the generation of a proper archive for RPM builds so that one
+#   does not need to create a separate git tree with all sources for `gbs
+#   build' to work.
+# - Since tar is used, the archive's members all have their actual mtimes as
+#   opposed to the time of the git tree-ish passed to `git archive'. This is
+#   part of the solution for incremental builds in Tizen: since we use actual
+#   file mtimes, they are not rebuilt by `make'.
+#
+# As a postexport hook, there are two additional environment variables
+# available: GBP_GIT_DIR is /path/to/src/chromium/.git, and GBP_TMP_DIR is the
+# temporary directory containing everything in /path/to/src/chromium/packaging
+# that will be copied to $GBSROOT/local/sources and used by `rpmbuild' to build
+# an RPM package.
+#
+# The script is run from GBP_TMP_DIR.
+
+# Fail early to avoid bigger problems later in the process.
+set -e
+
+TAR_FILE="${GBP_TMP_DIR}/chromium.tar"
+
+if [ ! -f "${TAR_FILE}" ]; then
+    echo "${TAR_FILE} does not exist. Aborting."
+    exit 1
+fi
+
+# The top-level directory that _contains_ src/.
+BASE_SRC_DIR=`readlink -f "${GBP_GIT_DIR}/../../.."`
+if [ $? -ne 0 ]; then
+    echo "${GBP_GIT_DIR}/../../.. does not seem to be a valid path. Aborting."
+    exit 1
+fi
+
+# Erase the archive generated with `git archive'.
+rm -v "${TAR_FILE}"
+
+echo "Creating a new ${TAR_FILE} from ${BASE_SRC_DIR}/src"
+
+# The --transform parameter is used to prepend all archive members with
+# chromium/ so they all share a common root. Note it is chromium/, without
+# any version numbers, so that any build files in an external directory
+# referring to a source file does not need to be updated just because of a
+# version bump.
+tar --update --file "${TAR_FILE}" \
+    --exclude-vcs --exclude=native_client --exclude=LayoutTests \
+    --exclude=src/out --directory="${BASE_SRC_DIR}" \
+    --transform="s:^:chromium/:S" \
+    src
index e065b19..fcb3ae9 100644 (file)
@@ -13,7 +13,8 @@ namespace ozonewayland {
 
 EventConverterInProcess::EventConverterInProcess()
     : EventConverterOzoneWayland(),
-      observer_(NULL) {
+      observer_(NULL),
+      output_observer_(NULL) {
 }
 
 EventConverterInProcess::~EventConverterInProcess() {
index ff0afbe..fa28201 100644 (file)
@@ -49,6 +49,7 @@
       ],
       'include_dirs': [
         '../..',
+        '../../third_party/mesa/src/include',
       ],
       'includes': [
         '../ui/ime/ime.gypi',
index a0b9d68..6dd6f76 100644 (file)
@@ -88,6 +88,9 @@ PassRefPtr<DrawingBuffer> DrawingBuffer::create(blink::WebGraphicsContext3D* con
         contextSupport->ensureExtensionEnabled("GL_ANGLE_framebuffer_multisample");
         contextSupport->ensureExtensionEnabled("GL_OES_rgb8_rgba8");
     }
+#if defined(OS_TIZEN) && CPU(X86)
+    multisampleSupported = false;
+#endif
     bool packedDepthStencilSupported = contextSupport->supportsExtension("GL_OES_packed_depth_stencil");
     if (packedDepthStencilSupported)
         contextSupport->ensureExtensionEnabled("GL_OES_packed_depth_stencil");
index 4b187cf..4c7f8e6 100644 (file)
@@ -7,14 +7,14 @@
 # Use 'Trunk' for trunk.
 # If using trunk, will use '.DEPS.git' for gclient.
 chromium_version = '34.0.1809.2'
-chromium_crosswalk_point = '9544260e66273a2089abd7c9911782ad2862f068'
-blink_crosswalk_point = '26982f43d2966dcb4e070dc63364b568f16829a3'
+chromium_crosswalk_point = '15cca626e89f5bf95ed8b188611c9e3391072a97'
+blink_crosswalk_point = '23bf1559a940e70973171b227f281a70387eb09d'
 deps_xwalk = {
   'src': 'https://github.com/crosswalk-project/chromium-crosswalk.git@%s' % chromium_crosswalk_point,
   'src/third_party/WebKit': 'https://github.com/crosswalk-project/blink-crosswalk.git@%s' % blink_crosswalk_point,
 
   # Ozone-Wayland is required for Wayland support in Chromium.
-  'src/ozone': 'https://github.com/01org/ozone-wayland.git@b2e17c52db443468a42a168dc91d873c7e707fca',
+  'src/ozone': 'https://github.com/01org/ozone-wayland.git@aea2c94041dd0fbf386182e66fd173b87a7862e6',
 }
 vars_xwalk = {
 }
index 6cd2314..b02a526 100644 (file)
@@ -1,4 +1,4 @@
 MAJOR=5
 MINOR=34
-BUILD=92
+BUILD=97
 PATCH=0
index 94ab111..7c39dde 100644 (file)
@@ -23,7 +23,7 @@
         </activity>
     </application>
 
-  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.CAMERA"/>
   <uses-permission android:name="android.permission.INTERNET"/>
index 0568d77..a573d8a 100644 (file)
@@ -24,7 +24,7 @@
         </activity>
     </application>
 
-  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.CAMERA"/>
   <uses-permission android:name="android.permission.INTERNET"/>
index a2f927d..5896f96 100644 (file)
@@ -25,7 +25,7 @@ import org.xwalk.app.runtime.CrossPackageWrapper;
  */
 public class XWalkExtensionClient extends CrossPackageWrapper {
 
-    private final static String EXTENSION_CLASS_NAME = "org.xwalk.runtime.extension.XWalkExtensionClientImpl";
+    private final static String EXTENSION_CLASS_NAME = "org.xwalk.core.extension.XWalkExtensionClientImpl";
     private Object mInstance;
     private Method mGetExtensionName;
     private Method mGetJsApi;
index b3bb934..9796466 100644 (file)
@@ -23,7 +23,7 @@ import org.xwalk.app.runtime.CrossPackageWrapper;
  */
 public final class XWalkExtensionContextClient extends CrossPackageWrapper {
     private final static String EXTENSION_CLASS_NAME =
-            "org.xwalk.runtime.extension.XWalkExtensionContextWrapper";
+            "org.xwalk.core.extension.XWalkExtensionContextWrapper";
     private Object mInstance;
     private Method mGetContext;
     private Method mGetActivity;
index b43370a..d68802e 100644 (file)
@@ -26,7 +26,7 @@
         </activity>
     </application>
 
-  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.CAMERA"/>
index fb961fc..1578ed6 100644 (file)
@@ -26,7 +26,7 @@
         </activity>
     </application>
 
-  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.CAMERA"/>
index 080c71d..e0074ff 100755 (executable)
@@ -72,7 +72,7 @@ def CustomizeStringXML(options, sanitized_name):
     AddElementAttributeAndText(xmldoc, 'string', 'name', 'description',
                                options.description)
     strings_file = open(strings_path, 'w')
-    xmldoc.writexml(strings_file)
+    xmldoc.writexml(strings_file, encoding='utf-8')
     strings_file.close()
 
 
@@ -108,8 +108,8 @@ def CustomizeThemeXML(options, sanitized_name):
     else:
       print('Error: Please make sure \"' + default_image + '\" exists!')
       sys.exit(6)
-  theme_file = open(theme_path, 'wb')
-  xmldoc.writexml(theme_file)
+  theme_file = open(theme_path, 'w')
+  xmldoc.writexml(theme_file, encoding='utf-8')
   theme_file.close()
 
 
@@ -156,7 +156,7 @@ def CustomizeXML(options, sanitized_name):
     sys.exit(6)
 
   file_handle = open(os.path.join(sanitized_name, 'AndroidManifest.xml'), 'w')
-  xmldoc.writexml(file_handle)
+  xmldoc.writexml(file_handle, encoding='utf-8')
   file_handle.close()
 
 
index e2ea28e..96e2544 100755 (executable)
@@ -425,7 +425,7 @@ def Execution(options, sanitized_name):
   input_jars = []
   if options.mode == 'embedded':
     input_jars.append(os.path.join(os.getcwd(), 'libs',
-                                   'xwalk_core_embedded.dex.jar'))
+                                   'xwalk_runtime_embedded.dex.jar'))
   dex_command_list = ['python', os.path.join('scripts', 'gyp', 'dex.py'),
                       dex_path,
                       '--android-sdk-root=%s' % sdk_root_path,
index e2b2998..3a1f281 100755 (executable)
@@ -141,11 +141,11 @@ class ManifestJsonParser(object):
     ret_dict['launch_screen_img'] = ''
     if 'launch_screen' in self.data_src:
       if 'default' not in self.data_src['launch_screen']:
-        print 'Error: no \'default\' field for \'launch_screen\'.'
+        print('Error: no \'default\' field for \'launch_screen\'.')
         sys.exit(1)
       default = self.data_src['launch_screen']['default']
       if 'image' not in default:
-        print 'Error: no \'image\' field for \'launch_screen.default\'.'
+        print('Error: no \'image\' field for \'launch_screen.default\'.')
         sys.exit(1)
       ret_dict['launch_screen_img'] = default['image']
     return ret_dict
@@ -164,7 +164,7 @@ class ManifestJsonParser(object):
     print("required_version: %s" % self.GetRequiredVersion())
     print("plugins: %s" % self.GetPlugins())
     print("fullscreen: %s" % self.GetFullScreenFlag())
-    print 'launch_screen.default.image: %s' % self.GetLaunchScreenImg()
+    print('launch_screen.default.image: %s' % self.GetLaunchScreenImg())
 
 
   def GetAppName(self):
index 7f11417..a1fe52e 100644 (file)
@@ -6,7 +6,9 @@
 
 #include <string>
 
+#include "base/files/file_enumerator.h"
 #include "base/json/json_reader.h"
+#include "base/macros.h"
 #include "base/message_loop/message_loop.h"
 #include "base/stl_util.h"
 #include "base/values.h"
@@ -30,6 +32,16 @@ namespace xwalk {
 namespace keys = application_manifest_keys;
 namespace widget_keys = application_widget_keys;
 
+namespace {
+const char* kDefaultWidgetEntryPage[] = {
+"index.html",
+"index.htm",
+"index.svg",
+"index.xhtml",
+"index.xht"};
+const char kWidgetEntryPagePattern[] = "index.*";
+}  // namespace
+
 namespace application {
 
 class FinishEventObserver : public EventObserver {
@@ -142,8 +154,28 @@ GURL Application::GetURLFromLocalPathKey() {
       application_data_->GetPackageType()));
 
   if (!manifest->GetString(key, &entry_page)
-      || entry_page.empty())
-    return GURL();
+      || entry_page.empty()) {
+    if (application_data_->GetPackageType() == Manifest::TYPE_XPK)
+      return GURL();
+
+    base::FileEnumerator iter(application_data_->Path(), true,
+                              base::FileEnumerator::FILES,
+                              FILE_PATH_LITERAL(kWidgetEntryPagePattern));
+    int priority = arraysize(kDefaultWidgetEntryPage);
+
+    for (base::FilePath file = iter.Next(); !file.empty(); file = iter.Next()) {
+      for (int i = 0; i < arraysize(kDefaultWidgetEntryPage); ++i) {
+        if (file.BaseName().MaybeAsASCII() == kDefaultWidgetEntryPage[i] &&
+            i < priority) {
+          entry_page = kDefaultWidgetEntryPage[i];
+          priority = i;
+        }
+      }
+    }
+
+    if (entry_page.empty())
+      return GURL();
+  }
 
   return application_data_->GetResourceURL(entry_page);
 }
index 7bda9f6..41af7b4 100644 (file)
@@ -29,7 +29,7 @@
 #include "xwalk/runtime/browser/runtime.h"
 #include "xwalk/runtime/browser/xwalk_runner.h"
 
-#if defined(OS_TIZEN)
+#if defined(OS_TIZEN_MOBILE)
 #include "xwalk/application/browser/installer/tizen/package_installer.h"
 #include "xwalk/application/browser/installer/tizen/service_package_installer.h"
 #endif
@@ -149,7 +149,7 @@ void SaveSystemEventsInfo(
   }
 }
 
-#if defined(OS_TIZEN)
+#if defined(OS_TIZEN_MOBILE)
 bool InstallPackageOnTizen(xwalk::application::ApplicationService* service,
                            xwalk::application::ApplicationStorage* storage,
                            xwalk::application::ApplicationData* application,
@@ -185,7 +185,7 @@ bool UninstallPackageOnTizen(xwalk::application::ApplicationService* service,
   }
   return true;
 }
-#endif  // OS_TIZEN
+#endif  // OS_TIZEN_MOBILE
 
 bool CopyDirectoryContents(const base::FilePath& from,
     const base::FilePath& to) {
@@ -293,7 +293,7 @@ bool ApplicationService::Install(const base::FilePath& path, std::string* id) {
     return false;
   }
 
-#if defined(OS_TIZEN)
+#if defined(OS_TIZEN_MOBILE)
   if (!InstallPackageOnTizen(this, application_storage_,
                              application_data.get(),
                              runtime_context_->GetPath())) {
@@ -382,8 +382,11 @@ bool ApplicationService::Update(const std::string& id,
   const base::FilePath tmp_dir(app_dir.value()
                                + FILE_PATH_LITERAL(".tmp"));
 
-  // FIXME: Need to terminate the application here if it's running, after
-  // shared runtime process mode has been implemented.
+  if (Application* app = GetApplicationByID(app_id)) {
+    LOG(INFO) << "Try to terminate the running application before update.";
+    app->Terminate(Application::Immediate);
+  }
+
   if (!base::Move(app_dir, tmp_dir) ||
       !base::Move(unpacked_dir, app_dir))
     return false;
@@ -399,7 +402,7 @@ bool ApplicationService::Update(const std::string& id,
     return false;
   }
 
-#if defined(OS_TIZEN)
+#if defined(OS_TIZEN_MOBILE)
   if (!UninstallPackageOnTizen(this, application_storage_,
                                old_application.get(),
                                runtime_context_->GetPath())) {
@@ -413,14 +416,14 @@ bool ApplicationService::Update(const std::string& id,
     LOG(ERROR) << "An Error occurred when updating the application.";
     base::DeleteFile(app_dir, true);
     base::Move(tmp_dir, app_dir);
-#if defined(OS_TIZEN)
+#if defined(OS_TIZEN_MOBILE)
     InstallPackageOnTizen(this, application_storage_,
                           old_application.get(),
                           runtime_context_->GetPath());
 #endif
     return false;
   }
-#if defined(OS_TIZEN)
+#if defined(OS_TIZEN_MOBILE)
   if (!InstallPackageOnTizen(this, application_storage_,
                              new_application.get(),
                              runtime_context_->GetPath()))
@@ -447,7 +450,12 @@ bool ApplicationService::Uninstall(const std::string& id) {
     return false;
   }
 
-#if defined(OS_TIZEN)
+  if (Application* app = GetApplicationByID(id)) {
+    LOG(INFO) << "Try to terminate the running application before uninstall.";
+    app->Terminate(Application::Immediate);
+  }
+
+#if defined(OS_TIZEN_MOBILE)
   if (!UninstallPackageOnTizen(this, application_storage_, application.get(),
                                runtime_context_->GetPath()))
     result = false;
index d37c75f..dea676d 100644 (file)
 #include "url/url_util.h"
 #include "ui/base/l10n/l10n_util.h"
 
-#if defined(OS_TIZEN)
-#include "xwalk/tizen/appcore_context.h"
-#endif
-
 namespace keys = xwalk::application_manifest_keys;
 namespace widget_keys = xwalk::application_widget_keys;
 namespace errors = xwalk::application_manifest_errors;
@@ -254,9 +250,6 @@ bool ApplicationData::Init(base::string16* error) {
     return false;
 
   finished_parsing_manifest_ = true;
-#if defined(OS_TIZEN)
-  appcore_context_ = tizen::AppcoreContext::Create();
-#endif
   return true;
 }
 
@@ -265,7 +258,8 @@ bool ApplicationData::LoadName(base::string16* error) {
   base::string16 localized_name;
   std::string name_key(GetNameKey(GetPackageType()));
 
-  if (!manifest_->GetString(name_key, &localized_name)) {
+  if (!manifest_->GetString(name_key, &localized_name) &&
+      manifest_->IsXPKPackaged()) {
     *error = base::ASCIIToUTF16(errors::kInvalidName);
     return false;
   }
@@ -280,12 +274,14 @@ bool ApplicationData::LoadVersion(base::string16* error) {
   std::string version_str;
   std::string version_key(GetVersionKey(GetPackageType()));
 
-  if (!manifest_->GetString(version_key, &version_str)) {
+  if (!manifest_->GetString(version_key, &version_str) &&
+      manifest_->IsXPKPackaged()) {
     *error = base::ASCIIToUTF16(errors::kInvalidVersion);
     return false;
   }
   version_.reset(new base::Version(version_str));
-  if (!version_->IsValid() || version_->components().size() > 4) {
+  if (manifest_->IsXPKPackaged() &&
+      (!version_->IsValid() || version_->components().size() > 4)) {
     *error = base::ASCIIToUTF16(errors::kInvalidVersion);
     return false;
   }
@@ -295,7 +291,8 @@ bool ApplicationData::LoadVersion(base::string16* error) {
 bool ApplicationData::LoadDescription(base::string16* error) {
   DCHECK(error);
   if (manifest_->HasKey(keys::kDescriptionKey) &&
-      !manifest_->GetString(keys::kDescriptionKey, &description_)) {
+      !manifest_->GetString(keys::kDescriptionKey, &description_) &&
+      manifest_->IsXPKPackaged()) {
     *error = base::ASCIIToUTF16(errors::kInvalidDescription);
     return false;
   }
@@ -310,8 +307,10 @@ bool ApplicationData::LoadManifestVersion(base::string16* error) {
     int manifest_version = 1;
     if (!manifest_->GetInteger(keys::kManifestVersionKey, &manifest_version) ||
         manifest_version < 1) {
-      *error = base::ASCIIToUTF16(errors::kInvalidManifestVersion);
-      return false;
+      if (manifest_->IsXPKPackaged()) {
+        *error = base::ASCIIToUTF16(errors::kInvalidManifestVersion);
+        return false;
+      }
     }
   }
 
index 488e280..34612ee 100644 (file)
@@ -32,12 +32,6 @@ class ListValue;
 class Version;
 }
 
-#if defined(OS_TIZEN)
-namespace tizen {
-class AppcoreContext;
-}
-#endif
-
 namespace xwalk {
 namespace application {
 
@@ -224,10 +218,6 @@ class ApplicationData : public base::RefCountedThreadSafe<ApplicationData> {
   // Application's persistent permissions.
   StoredPermissionMap permission_map_;
 
-#if defined(OS_TIZEN)
-  scoped_ptr<tizen::AppcoreContext> appcore_context_;
-#endif
-
   DISALLOW_COPY_AND_ASSIGN(ApplicationData);
 };
 
index b5fa144..8f14c28 100644 (file)
@@ -71,6 +71,7 @@ class Manifest {
   bool IsHosted() const { return type_ == TYPE_HOSTED_APP; }
 
   PackageType GetPackageType() const { return package_type_; }
+  bool IsXPKPackaged() const { return package_type_ == TYPE_XPK; }
 
   // These access the wrapped manifest value, returning false when the property
   // does not exist or if the manifest type can't access it.
index 21615bf..5a688d8 100644 (file)
@@ -38,6 +38,15 @@ void ApplicationBrowserTest::SetUp() {
   InProcessBrowserTest::SetUp();
 }
 
+void ApplicationBrowserTest::ProperMainThreadCleanup() {
+  const ScopedVector<Application>& apps =
+    application_sevice()->active_applications();
+
+  std::for_each(apps.begin(), apps.end(),
+    std::bind2nd(std::mem_fun(&Application::Terminate),
+                              Application::Immediate));
+}
+
 ApplicationService* ApplicationBrowserTest::application_sevice() const {
   return xwalk::XWalkRunner::GetInstance()->app_system()
       ->application_service();
index 9a2837b..8266928 100644 (file)
@@ -20,6 +20,8 @@ class ApplicationBrowserTest: public InProcessBrowserTest {
 
   virtual void SetUp() OVERRIDE;
 
+  virtual void ProperMainThreadCleanup() OVERRIDE;
+
   xwalk::application::ApplicationService* application_sevice() const;
 
   scoped_ptr<ApiTestRunner> test_runner_;
index 52c6e38..6ef78c9 100644 (file)
@@ -20,6 +20,7 @@ class ApplicationMultiAppTest : public ApplicationBrowserTest {
 
 IN_PROC_BROWSER_TEST_F(ApplicationMultiAppTest, TestMultiApp) {
   ApplicationService* service = application_sevice();
+  const size_t currently_running_count = service->active_applications().size();
   // Launch the first app.
   Application* app1 = service->Launch(
       test_data_dir_.Append(FILE_PATH_LITERAL("dummy_app1")));
@@ -31,7 +32,7 @@ IN_PROC_BROWSER_TEST_F(ApplicationMultiAppTest, TestMultiApp) {
   EXPECT_EQ(app1->runtimes().size(), 2);
   ASSERT_TRUE(app1->GetMainDocumentRuntime());
 
-  EXPECT_EQ(service->active_applications().size(), 1);
+  EXPECT_EQ(service->active_applications().size(), currently_running_count + 1);
   EXPECT_EQ(service->GetApplicationByID(app1->id()), app1);
 
   // Verify that no new App instance was created, if one exists
@@ -57,15 +58,15 @@ IN_PROC_BROWSER_TEST_F(ApplicationMultiAppTest, TestMultiApp) {
   EXPECT_NE(app1->id(), app2->id());
   EXPECT_NE(app1->GetRenderProcessHostID(), app2->GetRenderProcessHostID());
 
-  EXPECT_EQ(service->active_applications().size(), 2);
+  EXPECT_EQ(service->active_applications().size(), currently_running_count + 2);
   EXPECT_EQ(service->GetApplicationByID(app1->id()), app1);
   EXPECT_EQ(service->GetApplicationByID(app2->id()), app2);
 
   app1->Terminate();
   content::RunAllPendingInMessageLoop();
-  EXPECT_EQ(service->active_applications().size(), 1);
+  EXPECT_EQ(service->active_applications().size(), currently_running_count + 1);
 
   app2->Terminate();
   content::RunAllPendingInMessageLoop();
-  EXPECT_EQ(service->active_applications().size(), 0);
+  EXPECT_EQ(service->active_applications().size(), currently_running_count);
 }
index 848d9e8..ce224cc 100644 (file)
@@ -58,7 +58,8 @@ def PrepareFromXwalk(src_dir, target_dir):
 
     # This jar is needed for 'javac' compile.
     (os.path.join(jar_src_dir, 'xwalk_app_runtime_java.jar'), jar_target_dir),
-    (os.path.join(jar_src_dir, 'xwalk_core_embedded.dex.jar'), jar_target_dir),
+    (os.path.join(jar_src_dir, 'xwalk_runtime_embedded.dex.jar'),
+      jar_target_dir),
 
     # Native library, like libxwalkcore.so.
     (os.path.join(src_dir, 'xwalk_runtime_lib_apk/libs/x86'),
@@ -75,7 +76,7 @@ def PrepareFromXwalk(src_dir, target_dir):
      os.path.join(target_dir, 'libs_res/content')),
     (os.path.join(source_code_dir, 'ui/android/java/res'),
      os.path.join(target_dir, 'libs_res/ui')),
-    (os.path.join(source_code_dir, 'xwalk/runtime/android/java/res'),
+    (os.path.join(source_code_dir, 'xwalk/runtime/android/core/res'),
      os.path.join(target_dir, 'libs_res/runtime')),
 
     (os.path.join(gen_res_src_dir, 'ui_java/java_R'),
index 32b2ec2..fee3ee5 100755 (executable)
@@ -92,11 +92,8 @@ def CopyJavaSources(project_source, out_directory):
       'ui/android/java/resource_map/org/chromium/ui/R.java',
 
       # XWalk java sources.
-      'xwalk/runtime/android/java/src/org/xwalk/core',
+      'xwalk/runtime/android/core/src/org/xwalk/core',
       'xwalk/extensions/android/java/src/org/xwalk/core/extensions',
-      'xwalk/runtime/android/java/src/org/xwalk/runtime/extension',
-      'xwalk/runtime/android/java/'
-          'src/org/xwalk/core/XWalkCookieManager.java',
   ]
 
   for source in java_srcs_to_copy:
@@ -160,8 +157,8 @@ def CopyJSBindingFiles(project_source, out_directory):
   print 'Copying js binding files...'
   jsapi_directory = os.path.join(out_directory,
                                  LIBRARY_PROJECT_NAME,
-                                 'assets',
-                                 'jsapi')
+                                 'res',
+                                 'raw')
   if not os.path.exists(jsapi_directory):
     os.makedirs(jsapi_directory)
 
index fc97729..e5f9622 100644 (file)
@@ -5,5 +5,5 @@
 
     <uses-sdk
         android:minSdkVersion="14"
-        android:targetSdkVersion="17" />
+        android:targetSdkVersion="19" />
 </manifest>
index 2787da9..2dc267b 100644 (file)
           },
         },
         {
-          'target_name': 'tizen_appcore',
+          'target_name': 'tizen_sensor',
           'type': 'none',
           'variables': {
             'packages': [
-              'appcore-efl',
-              'aul',
-              'capi-appfw-application',
               'sensor',
               'vconf',
             ],
index e26ef06..5383e58 100644 (file)
@@ -31,12 +31,6 @@ scoped_refptr<dbus::Bus> DBusManager::session_bus() {
     dbus::Bus::Options options;
     options.dbus_task_runner = dbus_thread_->message_loop_proxy();
 
-    // On Tizen 2.x DBUS_SESSION_ADDRESS points to a wrong path, so we set
-    // the correct one here.
-    options.bus_type = dbus::Bus::CUSTOM_ADDRESS;
-    options.address = base::StringPrintf(
-        "unix:path=/run/user/%s/dbus/user_bus_socket", g_get_user_name());
-
     session_bus_ = new dbus::Bus(options);
   }
 
index afd8f9d..eb6e527 100644 (file)
@@ -90,6 +90,13 @@ class ExtensionSandboxedProcessLauncherDelegate
 };
 #endif
 
+bool XWalkExtensionProcessHost::Delegate::OnRegisterPermissions(
+    int render_process_id,
+    const std::string& extension_name,
+    const std::string& perm_table) {
+  return false;
+}
+
 XWalkExtensionProcessHost::XWalkExtensionProcessHost(
     content::RenderProcessHost* render_process_host,
     const base::FilePath& external_extensions_path,
@@ -241,7 +248,8 @@ void XWalkExtensionProcessHost::OnCheckAPIAccessControl(
     const std::string& extension_name,
     const std::string& api_name, IPC::Message* reply_msg) {
   CHECK(delegate_);
-  delegate_->OnCheckAPIAccessControl(extension_name, api_name,
+  delegate_->OnCheckAPIAccessControl(render_process_host_->GetID(),
+                                     extension_name, api_name,
       base::Bind(&XWalkExtensionProcessHost::ReplyAccessControlToExtension,
                  base::Unretained(this),
                  reply_msg));
@@ -251,7 +259,8 @@ void XWalkExtensionProcessHost::OnRegisterPermissions(
     const std::string& extension_name,
     const std::string& perm_table, bool* result) {
   CHECK(delegate_);
-  *result = delegate_->OnRegisterPermissions(extension_name, perm_table);
+  *result = delegate_->OnRegisterPermissions(
+      render_process_host_->GetID(), extension_name, perm_table);
 }
 
 bool XWalkExtensionProcessHost::Send(IPC::Message* msg) {
index 7593746..a686091 100644 (file)
@@ -36,10 +36,13 @@ class XWalkExtensionProcessHost
    public:
     virtual void OnExtensionProcessDied(XWalkExtensionProcessHost* eph,
         int render_process_id) {}
-    virtual void OnCheckAPIAccessControl(const std::string& extension_name,
-        const std::string& api_name, const PermissionCallback& callback) {}
-    virtual bool OnRegisterPermissions(const std::string& extension_name,
-        const std::string& perm_table) { return false; }
+    virtual void OnCheckAPIAccessControl(int render_process_id,
+                                         const std::string& extension_name,
+                                         const std::string& api_name,
+                                         const PermissionCallback& callback) {}
+    virtual bool OnRegisterPermissions(int render_process_id,
+                                       const std::string& extension_name,
+                                       const std::string& perm_table);
 
    protected:
     ~Delegate() {}
index 024bab3..d7bfd9a 100644 (file)
@@ -200,6 +200,13 @@ class ExtensionServerMessageFilter : public IPC::ChannelProxy::MessageFilter,
   std::set<int64_t> extension_thread_instances_ids_;
 };
 
+bool XWalkExtensionService::Delegate::RegisterPermissions(
+    int render_process_id,
+    const std::string& extension_name,
+    const std::string& perm_table) {
+  return false;
+}
+
 XWalkExtensionService::XWalkExtensionService(Delegate* delegate)
     : extension_thread_("XWalkExtensionThread"),
       delegate_(delegate) {
@@ -446,18 +453,22 @@ void XWalkExtensionService::OnRenderProcessDied(
 }
 
 void XWalkExtensionService::OnCheckAPIAccessControl(
+    int render_process_id,
     const std::string& extension_name,
     const std::string& api_name,
     const PermissionCallback& callback) {
   CHECK(delegate_);
-  delegate_->CheckAPIAccessControl(extension_name, api_name, callback);
+  delegate_->CheckAPIAccessControl(render_process_id, extension_name,
+                                   api_name, callback);
 }
 
 bool XWalkExtensionService::OnRegisterPermissions(
+    int render_process_id,
     const std::string& extension_name,
     const std::string& perm_table) {
   CHECK(delegate_);
-  return delegate_->RegisterPermissions(extension_name, perm_table);
+  return delegate_->RegisterPermissions(render_process_id,
+                                        extension_name, perm_table);
 }
 
 }  // namespace extensions
index 6b3980b..ad79672 100644 (file)
@@ -39,10 +39,15 @@ class XWalkExtensionService : public content::NotificationObserver,
  public:
   class Delegate {
    public:
-    virtual void CheckAPIAccessControl(const std::string& extension_name,
-        const std::string& api_name, const PermissionCallback& callback) {}
-    virtual bool RegisterPermissions(const std::string& extension_name,
-        const std::string& perm_table) { return false; }
+    virtual void CheckAPIAccessControl(
+        int render_process_id,
+        const std::string& extension_name,
+        const std::string& api_name,
+        const PermissionCallback& callback) {}
+    virtual bool RegisterPermissions(
+        int render_process_id,
+        const std::string& extension_name,
+        const std::string& perm_table);
 
    protected:
     ~Delegate() {}
@@ -92,10 +97,14 @@ class XWalkExtensionService : public content::NotificationObserver,
   virtual void OnExtensionProcessDied(XWalkExtensionProcessHost* eph,
       int render_process_id) OVERRIDE;
 
-  virtual void OnCheckAPIAccessControl(const std::string& extension_name,
-      const std::string& api_name, const PermissionCallback& callback) OVERRIDE;
-  virtual bool OnRegisterPermissions(const std::string& extension_name,
-      const std::string& perm_table) OVERRIDE;
+  virtual void OnCheckAPIAccessControl(
+      int render_process_id,
+      const std::string& extension_name,
+      const std::string& api_name,
+      const PermissionCallback& callback) OVERRIDE;
+  virtual bool OnRegisterPermissions(int render_process_id,
+                                     const std::string& extension_name,
+                                     const std::string& perm_table) OVERRIDE;
 
   // NotificationObserver implementation.
   virtual void Observe(int type, const content::NotificationSource& source,
index b65d5ac..00c2ef4 100644 (file)
 namespace xwalk {
 namespace extensions {
 
+bool XWalkExtension::PermissionsDelegate::CheckAPIAccessControl(
+    const std::string& extension_name, const std::string& api_name) {
+  return false;
+}
+
+bool XWalkExtension::PermissionsDelegate::RegisterPermissions(
+    const std::string& extension_name, const std::string& perm_table) {
+  return false;
+}
+
 XWalkExtension::XWalkExtension() : permissions_delegate_(NULL) {}
 
 XWalkExtension::~XWalkExtension() {}
index 9c038c3..d6b1ff4 100644 (file)
@@ -37,9 +37,9 @@ class XWalkExtension {
     // The delegate is responsible for caching the requests for the sake of
     // performance.
     virtual bool CheckAPIAccessControl(const std::string& extension_name,
-        const std::string& api_name) { return false; }
+        const std::string& api_name);
     virtual bool RegisterPermissions(const std::string& extension_name,
-        const std::string& perm_table) { return false; }
+        const std::string& perm_table);
 
     ~PermissionsDelegate() {}
   };
index bbe5ead..bbf4ad5 100644 (file)
@@ -366,12 +366,15 @@ std::vector<std::string> RegisterExternalExtensionsInDirectory(
         !extension_path.empty(); extension_path = libraries.Next()) {
     scoped_ptr<XWalkExternalExtension> extension(
         new XWalkExternalExtension(extension_path));
-    if (extension->is_valid()) {
+    extension->set_runtime_variables(runtime_variables);
+    if (server->permissions_delegate())
+      extension->set_permissions_delegate(server->permissions_delegate());
+    if (extension->Initialize()) {
       registered_extensions.push_back(extension->name());
-      extension->set_runtime_variables(runtime_variables);
-      if (server->permissions_delegate())
-        extension->set_permissions_delegate(server->permissions_delegate());
       server->RegisterExtension(extension.PassAs<XWalkExtension>());
+    } else {
+      LOG(WARNING) << "Failed to initialize extension: "
+                   << extension_path.AsUTF8Unsafe();
     }
   }
 
index f287d22..e5f5f19 100644 (file)
@@ -23,21 +23,41 @@ XWalkExternalExtension::XWalkExternalExtension(const base::FilePath& path)
       shutdown_callback_(NULL),
       handle_msg_callback_(NULL),
       handle_sync_msg_callback_(NULL),
-      initialized_(false) {
+      initialized_(false),
+      library_path_(path) {
+}
+
+XWalkExternalExtension::~XWalkExternalExtension() {
+  if (!initialized_)
+    return;
+
+  if (shutdown_callback_)
+    shutdown_callback_(xw_extension_);
+  XWalkExternalAdapter::GetInstance()->UnregisterExtension(this);
+}
+
+bool XWalkExternalExtension::Initialize() {
+  if (initialized_)
+    return true;
+
   std::string error;
-  base::ScopedNativeLibrary library(base::LoadNativeLibrary(path, &error));
+  base::ScopedNativeLibrary library(
+      base::LoadNativeLibrary(library_path_, &error));
   if (!library.is_valid()) {
-    LOG(WARNING) << "Error loading extension '" << path.AsUTF8Unsafe() << "': "
+    LOG(WARNING) << "Error loading extension '"
+                 << library_path_.AsUTF8Unsafe()
+                 << "': "
                  << error;
-    return;
+    return false;
   }
 
   XW_Initialize_Func initialize = reinterpret_cast<XW_Initialize_Func>(
       library.GetFunctionPointer("XW_Initialize"));
   if (!initialize) {
-    LOG(WARNING) << "Error loading extension '" << path.AsUTF8Unsafe() << "': "
+    LOG(WARNING) << "Error loading extension '"
+                 << library_path_.AsUTF8Unsafe() << "': "
                  << "couldn't get XW_Initialize function.";
-    return;
+    return false;
   }
 
   XWalkExternalAdapter* external_adapter = XWalkExternalAdapter::GetInstance();
@@ -45,26 +65,14 @@ XWalkExternalExtension::XWalkExternalExtension(const base::FilePath& path)
   external_adapter->RegisterExtension(this);
   int ret = initialize(xw_extension_, XWalkExternalAdapter::GetInterface);
   if (ret != XW_OK) {
-    LOG(WARNING) << "Error loading extension '" << path.AsUTF8Unsafe() << "': "
+    LOG(WARNING) << "Error loading extension '"
+                 << library_path_.AsUTF8Unsafe() << "': "
                  << "XW_Initialize function returned error value.";
-    return;
+    return false;
   }
-
   library_.Reset(library.Release());
   initialized_ = true;
-}
-
-XWalkExternalExtension::~XWalkExternalExtension() {
-  if (!initialized_)
-    return;
-
-  if (shutdown_callback_)
-    shutdown_callback_(xw_extension_);
-  XWalkExternalAdapter::GetInstance()->UnregisterExtension(this);
-}
-
-bool XWalkExternalExtension::is_valid() {
-  return initialized_;
+  return true;
 }
 
 XWalkExtensionInstance* XWalkExternalExtension::CreateInstance() {
index e2942c7..3037172 100644 (file)
@@ -6,6 +6,7 @@
 #define XWALK_EXTENSIONS_COMMON_XWALK_EXTERNAL_EXTENSION_H_
 
 #include <string>
+#include "base/files/file_path.h"
 #include "base/values.h"
 #include "base/scoped_native_library.h"
 #include "xwalk/extensions/common/xwalk_extension.h"
@@ -35,7 +36,7 @@ class XWalkExternalExtension : public XWalkExtension {
 
   virtual ~XWalkExternalExtension();
 
-  bool is_valid();
+  bool Initialize();
 
   void set_runtime_variables(const base::ValueMap& runtime_variables) {
     runtime_variables_ = runtime_variables;
@@ -70,6 +71,7 @@ class XWalkExternalExtension : public XWalkExtension {
   // XW_Internal_BrowserInterface_1 (from XW_Browser.h) implementation.
   void RuntimeGetStringVariable(const char* key, char* value, size_t value_len);
 
+  base::FilePath library_path_;
   base::ScopedNativeLibrary library_;
   XW_Extension xw_extension_;
 
index 2701d35..3f69cfd 100644 (file)
@@ -13,7 +13,6 @@
 #include "ipc/ipc_message_macros.h"
 #include "ipc/ipc_sync_channel.h"
 #include "xwalk/extensions/common/xwalk_extension_messages.h"
-#include "xwalk/extensions/common/xwalk_extension_permission_types.h"
 
 namespace xwalk {
 namespace extensions {
@@ -56,7 +55,8 @@ void ToValueMap(base::ListValue* lv, base::ValueMap* vm) {
     base::DictionaryValue* dv;
     if (!(*it)->GetAsDictionary(&dv))
       continue;
-    for (base::DictionaryValue::Iterator dit(*dv); !dit.IsAtEnd(); dit.Advance())
+    for (base::DictionaryValue::Iterator dit(*dv);
+        !dit.IsAtEnd(); dit.Advance())
       (*vm)[dit.key()] = dit.value().DeepCopy();
   }
 }
@@ -114,15 +114,26 @@ void XWalkExtensionProcess::CreateRenderProcessChannel() {
 bool XWalkExtensionProcess::CheckAPIAccessControl(
     const std::string& extension_name,
     const std::string& api_name) {
-  // TODO(Bai): Implement cache here.
+  PermissionCacheType::iterator iter =
+      permission_cache_.find(extension_name + api_name);
+  if (iter != permission_cache_.end())
+    return iter->second;
+
   RuntimePermission result = UNDEFINED_RUNTIME_PERM;
   browser_process_channel_->Send(
       new XWalkExtensionProcessHostMsg_CheckAPIAccessControl(
           extension_name, api_name, &result));
   DLOG(INFO) << extension_name << "." << api_name << "() --> " << result;
-  return (result == ALLOW_ONCE ||
-          result == ALLOW_SESSION ||
-          result == ALLOW_ALWAYS);
+  if (result == ALLOW_SESSION ||
+      result == ALLOW_ALWAYS ||
+      result == DENY_SESSION ||
+      result == DENY_ALWAYS) {
+    permission_cache_[extension_name+api_name] = result;
+    return (result == ALLOW_SESSION || result == ALLOW_ALWAYS);
+  }
+
+  // Could be allow/deny once or undefined here.
+  return (result == ALLOW_ONCE);
 }
 
 bool XWalkExtensionProcess::RegisterPermissions(
index b786aa3..3900e18 100644 (file)
@@ -5,6 +5,7 @@
 #ifndef XWALK_EXTENSIONS_EXTENSION_PROCESS_XWALK_EXTENSION_PROCESS_H_
 #define XWALK_EXTENSIONS_EXTENSION_PROCESS_XWALK_EXTENSION_PROCESS_H_
 
+#include <map>
 #include <string>
 
 #include "base/values.h"
@@ -12,6 +13,7 @@
 #include "base/threading/thread.h"
 #include "ipc/ipc_channel_handle.h"
 #include "ipc/ipc_listener.h"
+#include "xwalk/extensions/common/xwalk_extension_permission_types.h"
 #include "xwalk/extensions/common/xwalk_extension_server.h"
 
 namespace base {
@@ -41,9 +43,9 @@ class XWalkExtensionProcess : public IPC::Listener,
   XWalkExtensionProcess();
   virtual ~XWalkExtensionProcess();
   virtual bool CheckAPIAccessControl(const std::string& extension_name,
-      const std::string& api_name);
+      const std::string& api_name) OVERRIDE;
   virtual bool RegisterPermissions(const std::string& extension_name,
-      const std::string& perm_table);
+      const std::string& perm_table) OVERRIDE;
 
  private:
   // IPC::Listener implementation.
@@ -62,6 +64,8 @@ class XWalkExtensionProcess : public IPC::Listener,
   XWalkExtensionServer extensions_server_;
   scoped_ptr<IPC::SyncChannel> render_process_channel_;
   IPC::ChannelHandle rp_channel_handle_;
+  typedef std::map<std::string, RuntimePermission> PermissionCacheType;
+  PermissionCacheType permission_cache_;
 
   DISALLOW_COPY_AND_ASSIGN(XWalkExtensionProcess);
 };
index 2aebc90..146cb99 100644 (file)
@@ -1,9 +1,11 @@
+%bcond_with x
+%bcond_with wayland
+
 Name:           crosswalk
-Version:        5.34.92.0
+Version:        5.34.97.0
 Release:        0
 Summary:        Crosswalk is an app runtime based on Chromium
-# License:        (BSD-3-Clause and LGPL-2.1+)
-License:        BSD-3-Clause
+License:        (BSD-3-Clause and LGPL-2.1+)
 Group:          Web Framework/Web Run Time
 Url:            https://github.com/otcshare/crosswalk
 Source:         %{name}.tar
@@ -30,11 +32,8 @@ BuildRequires:  perl
 BuildRequires:  which
 BuildRequires:  pkgconfig(alsa)
 BuildRequires:  pkgconfig(appcore-common)
-BuildRequires:  pkgconfig(appcore-efl)
-BuildRequires:  pkgconfig(aul)
 BuildRequires:  pkgconfig(audio-session-mgr)
 BuildRequires:  pkgconfig(cairo)
-BuildRequires:  pkgconfig(capi-appfw-application)
 BuildRequires:  pkgconfig(capi-location-manager)
 BuildRequires:  pkgconfig(dbus-1)
 BuildRequires:  pkgconfig(fontconfig)
@@ -57,6 +56,7 @@ BuildRequires:  pkgconfig(nspr)
 BuildRequires:  pkgconfig(nss)
 BuildRequires:  pkgconfig(sensor)
 BuildRequires:  pkgconfig(vconf)
+%if %{with x}
 BuildRequires:  pkgconfig(x11)
 BuildRequires:  pkgconfig(xcomposite)
 BuildRequires:  pkgconfig(xcursor)
@@ -69,13 +69,7 @@ BuildRequires:  pkgconfig(xrender)
 BuildRequires:  pkgconfig(xscrnsaver)
 BuildRequires:  pkgconfig(xt)
 BuildRequires:  pkgconfig(xtst)
-
-# Depending on the Tizen version and profile we are building for, we have
-# different dependencies, patches and gyp options to pass. Checking for
-# specific profiles is not very future-proof. We therefore try to check for
-# either specific features that may be enabled in the current profile (such as
-# Wayland support).
-%bcond_with wayland
+%endif
 
 %if %{with wayland}
 BuildRequires:  pkgconfig(wayland-client)
@@ -91,8 +85,7 @@ Crosswalk is an app runtime based on Chromium. It is an open source project star
 
 %package emulator-support
 Summary:        Support files necessary for running Crosswalk on the Tizen emulator
-# License:        (BSD-3-Clause and LGPL-2.1+)
-License:        BSD-3-Clause
+License:        (BSD-3-Clause and LGPL-2.1+)
 Group:          Web Framework/Web Run Time
 Url:            https://github.com/otcshare/crosswalk
 
@@ -244,7 +237,7 @@ install -p -D ../%{name}.png %{buildroot}%{_desktop_icondir}/%{name}.png
 
 %files
 %manifest %{name}.manifest
-%license AUTHORS.chromium LICENSE.chromium LICENSE.xwalk
+%license AUTHORS.chromium LICENSE.chromium LICENSE.xwalk
 %{_bindir}/xwalk
 %{_bindir}/xwalkctl
 %{_bindir}/xwalk-launcher
@@ -39,6 +39,8 @@ public class XWalkInternalResources {
                     }
                     Field[] fields = innerClazz.getFields();
                     for (Field field : fields) {
+                        // It's final means we are probably not used as library project.
+                        if (!field.isAccessible()) continue;
                         try {
                             int value = generatedInnerClazz.getField(field.getName()).getInt(null);
                             field.setInt(null, value);
@@ -21,6 +21,7 @@ import org.xwalk.core.client.XWalkDefaultDownloadListener;
 import org.xwalk.core.client.XWalkDefaultNavigationHandler;
 import org.xwalk.core.client.XWalkDefaultNotificationService;
 import org.xwalk.core.client.XWalkDefaultWebChromeClient;
+import org.xwalk.core.extension.XWalkExtensionManager;
 
 public class XWalkView extends FrameLayout {
 
@@ -28,6 +29,7 @@ public class XWalkView extends FrameLayout {
     private XWalkDevToolsServer mDevToolsServer;
     private Activity mActivity;
     private Context mContext;
+    private XWalkExtensionManager mExtensionManager;
 
     public XWalkView(Context context, Activity activity) {
         super(context, null);
@@ -93,6 +95,11 @@ public class XWalkView extends FrameLayout {
         setDownloadListener(new XWalkDefaultDownloadListener(context));
         setNavigationHandler(new XWalkDefaultNavigationHandler(context));
         setNotificationService(new XWalkDefaultNotificationService(context, this));
+
+        // Enable xwalk extension mechanism and start load extensions here.
+        // Note that it has to be after above initialization.
+        mExtensionManager = new XWalkExtensionManager(context, getActivity());
+        mExtensionManager.loadExtensions();
     }
 
     public void loadUrl(String url) {
@@ -268,10 +275,12 @@ public class XWalkView extends FrameLayout {
     }
 
     public void onPause() {
+        mExtensionManager.onPause();
         mContent.onPause();
     }
 
     public void onResume() {
+        mExtensionManager.onResume();
         mContent.onResume();
     }
 
@@ -296,11 +305,13 @@ public class XWalkView extends FrameLayout {
     }
 
     public void destroy() {
+        mExtensionManager.onDestroy();
         mContent.destroy();
         disableRemoteDebugging();
     }
 
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        mExtensionManager.onActivityResult(requestCode, resultCode, data);
         mContent.onActivityResult(requestCode, resultCode, data);
     }
 
@@ -65,7 +65,7 @@ class XWalkViewDelegate {
 
         ResourceExtractor.setMandatoryPaksToExtract(MANDATORY_PAKS);
         ResourceExtractor.setExtractImplicitLocaleForTesting(false);
-        // Use MixContext to initialize the ResourceExtractor, as the pak file
+        // Use MixedContext to initialize the ResourceExtractor, as the pak file
         // is in the library apk if in shared apk mode.
         ResourceExtractor.get(context);
 
@@ -239,6 +239,12 @@ public class XWalkWebChromeClient {
     */
     // Note that the callback must always be executed at some point to ensure
     // that the sleeping WebCore thread is woken up.
+    // Since the parameter type WebStorage.QuotaUpdater and this API are
+    // deprecated in Android 4.4, while this parameter type and this API
+    // are still used before Android 4.4, no other API and parameter are
+    // to replace them, suppress the compiling warnings for Android 4.4
+    // due to deprecation.
+    @SuppressWarnings("deprecation")
     public void onExceededDatabaseQuota(String url, String databaseIdentifier,
             long quota, long estimatedDatabaseSize, long totalQuota,
             WebStorage.QuotaUpdater quotaUpdater) {
@@ -264,6 +270,12 @@ public class XWalkWebChromeClient {
     */
     // Note that the callback must always be executed at some point to ensure
     // that the sleeping WebCore thread is woken up.
+    // Since the parameter type WebStorage.QuotaUpdater and this API are
+    // deprecated in Android 4.4, while this parameter type and this API
+    // are still used before Android 4.4, no other API and parameter are
+    // to replace them, suppress the compiling warnings for Android 4.4
+    // due to deprecation.
+    @SuppressWarnings("deprecation")
     public void onReachedMaxAppCacheSize(long requiredStorage, long quota,
             WebStorage.QuotaUpdater quotaUpdater) {
         quotaUpdater.updateQuota(quota);
@@ -14,6 +14,8 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.graphics.Bitmap;
+import android.os.Build.VERSION;
+import android.os.Build.VERSION_CODES;
 import android.util.AndroidRuntimeException;
 import android.util.Log;
 
@@ -123,6 +125,7 @@ public class XWalkDefaultNotificationService implements XWalkNotificationService
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void updateNotificationIcon(int notificationId, Bitmap icon) {
         Notification.Builder builder = mExistNotificationIds.get(notificationId);
         if (builder != null) {
@@ -143,13 +146,19 @@ public class XWalkDefaultNotificationService implements XWalkNotificationService
             }
             builder.setLargeIcon(
                     Bitmap.createScaledBitmap(icon, targetWidth, targetHeight, true));
-            Notification notification = builder.getNotification();
+            Notification notification;
+            if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
+                notification = builder.build();
+            } else {
+                notification = builder.getNotification();
+            }
             doShowNotification(notificationId, notification);
-            mExistNotificationIds.put(notificationId, builder);            
+            mExistNotificationIds.put(notificationId, builder);
         }
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     public void showNotification(String title, String message,
             int notificationId, int processId, int routeId) {
         Context activity = mView.getActivity();
@@ -181,13 +190,18 @@ public class XWalkDefaultNotificationService implements XWalkNotificationService
                          .setContentTitle(title)
                          .setSmallIcon(iconRes)
                          .setAutoCancel(true);
-        Notification notification = builder.getNotification();
+        Notification notification;
+        if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
+            notification = builder.build();
+        } else {
+            notification = builder.getNotification();
+        }
         doShowNotification(notificationId, notification);
         mExistNotificationIds.put(notificationId, builder);
         notificationChanged();
         onNotificationShown(notificationId, processId, routeId);
     }
-    
+
     @Override
     public void cancelNotification(int notificationId, int processId, int routeId) {
         mNotificationManager.cancel(notificationId);
@@ -210,7 +224,7 @@ public class XWalkDefaultNotificationService implements XWalkNotificationService
             notificationChanged();
             if (mBridge != null) {
                 mBridge.notificationClicked(notificationId, processId, routeId);
-            } 
+            }
         }
     }
 
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension;
+package org.xwalk.core.extension;
 
 import android.content.Context;
 import android.content.Intent;
@@ -10,7 +10,7 @@ import android.content.Intent;
 import org.chromium.base.CalledByNative;
 
 import org.xwalk.core.extensions.XWalkExtensionAndroid;
-import org.xwalk.runtime.extension.XWalkExtension;
+import org.xwalk.core.extension.XWalkExtension;
 
 /**
  * The extension bridge for the implementation based on xwalk core.
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension;
+package org.xwalk.core.extension;
 
 import android.content.Context;
 import android.content.Intent;
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension;
+package org.xwalk.core.extension;
 
 import android.content.Context;
 import android.content.Intent;
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension;
+package org.xwalk.core.extension;
 
 import android.app.Activity;
 import android.content.Context;
@@ -2,31 +2,33 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension;
+package org.xwalk.core.extension;
 
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
 import android.content.res.AssetManager;
+import android.content.res.Resources;
+import android.content.res.Resources.NotFoundException;
 import android.util.Log;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.lang.Class;
 import java.util.HashMap;
 
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
-import org.xwalk.runtime.extension.api.contacts.Contacts;
-import org.xwalk.runtime.extension.api.device_capabilities.DeviceCapabilities;
-import org.xwalk.runtime.extension.api.launchscreen.LaunchScreenExtension;
-import org.xwalk.runtime.extension.api.messaging.Messaging;
-import org.xwalk.runtime.extension.api.presentation.PresentationExtension;
-import org.xwalk.runtime.extension.api.screenorientation.ScreenOrientationExtension;
+import org.xwalk.core.extension.api.contacts.Contacts;
+import org.xwalk.core.extension.api.device_capabilities.DeviceCapabilities;
+import org.xwalk.core.extension.api.launchscreen.LaunchScreenExtension;
+import org.xwalk.core.extension.api.messaging.Messaging;
+import org.xwalk.core.extension.api.presentation.PresentationExtension;
+import org.xwalk.core.extension.api.screenorientation.ScreenOrientationExtension;
 
 /**
  * This internal class acts a manager to manage extensions.
@@ -132,7 +134,7 @@ public class XWalkExtensionManager implements XWalkExtensionContext {
         // The following sample shows how to create an extension that named Device:
         //    String jsApiContent = "";
         //    try {
-        //        jsApiContent = getAssetsFileContent(mContext.getAssets(), Device.JS_API_PATH);
+        //        jsApiContent = getExtensionJSFileContent(mContext, Device.JS_API_PATH, true);
         //        new Device(jsApiContent, mExtensionContextImpl);
         //    } catch(IOException e) {
         //        Log.e(TAG, "Failed to read js API file of internal extension: Device");
@@ -140,8 +142,8 @@ public class XWalkExtensionManager implements XWalkExtensionContext {
         {
             String jsApiContent = "";
             try {
-                jsApiContent = getAssetsFileContent(mContext.getAssets(),
-                                                    PresentationExtension.JS_API_PATH);
+                jsApiContent = getExtensionJSFileContent(
+                        mContext, PresentationExtension.JS_API_PATH, true);
                 // Load PresentationExtension as an internal extension.
                 new PresentationExtension(PresentationExtension.NAME, jsApiContent, this);
             } catch (IOException e) {
@@ -152,8 +154,8 @@ public class XWalkExtensionManager implements XWalkExtensionContext {
         {
             String jsApiContent = ScreenOrientationExtension.getInsertedString();
             try {
-                jsApiContent += getAssetsFileContent(mContext.getAssets(),
-                                                     ScreenOrientationExtension.JS_API_PATH);
+                jsApiContent += getExtensionJSFileContent(
+                        mContext, ScreenOrientationExtension.JS_API_PATH, true);
                 new ScreenOrientationExtension(ScreenOrientationExtension.NAME, jsApiContent,
                                                ScreenOrientationExtension.JS_ENTRY_POINTS, this);
             } catch (IOException e) {
@@ -164,8 +166,8 @@ public class XWalkExtensionManager implements XWalkExtensionContext {
         {
             String jsApiContent = "";
             try {
-                jsApiContent = getAssetsFileContent(mContext.getAssets(),
-                                                    LaunchScreenExtension.JS_API_PATH);
+                jsApiContent = getExtensionJSFileContent(
+                        mContext, LaunchScreenExtension.JS_API_PATH, true);
                 // Load LaunchscreenExtension as an internal extension.
                 new LaunchScreenExtension(LaunchScreenExtension.NAME, jsApiContent,
                                           LaunchScreenExtension.JS_ENTRY_POINTS, this);
@@ -177,8 +179,8 @@ public class XWalkExtensionManager implements XWalkExtensionContext {
         {
             String jsApiContent = "";
             try {
-                jsApiContent = getAssetsFileContent(mContext.getAssets(),
-                                                    Contacts.JS_API_PATH);
+                jsApiContent = getExtensionJSFileContent(
+                        mContext, Contacts.JS_API_PATH, true);
                 new Contacts(jsApiContent, this);
             } catch(IOException e) {
                 Log.e(TAG, "Failed to read JS API file: " + Contacts.JS_API_PATH);
@@ -188,8 +190,8 @@ public class XWalkExtensionManager implements XWalkExtensionContext {
         {
             String jsApiContent = "";
             try {
-                jsApiContent = getAssetsFileContent(mContext.getAssets(),
-                                                    DeviceCapabilities.JS_API_PATH);
+                jsApiContent = getExtensionJSFileContent(
+                        mContext, DeviceCapabilities.JS_API_PATH, true);
                 new DeviceCapabilities(jsApiContent, this);
             } catch(IOException e) {
                 Log.e(TAG, "Failed to read JS API file: " + DeviceCapabilities.JS_API_PATH);
@@ -198,8 +200,8 @@ public class XWalkExtensionManager implements XWalkExtensionContext {
         {
             String jsApiContent = "";
             try {
-                jsApiContent = getAssetsFileContent(mContext.getAssets(),
-                                                    Messaging.JS_API_PATH);
+                jsApiContent = getExtensionJSFileContent(
+                        mContext, Messaging.JS_API_PATH, true);
                 new Messaging(jsApiContent, this);
             } catch(IOException e) {
                 Log.e(TAG, "Failed to read JS API file: " + Messaging.JS_API_PATH);
@@ -213,7 +215,7 @@ public class XWalkExtensionManager implements XWalkExtensionContext {
         // Read extensions-config.json and create external extensions.
         String configFileContent;
         try {
-            configFileContent = getAssetsFileContent(mActivity.getAssets(), EXTENSION_CONFIG_FILE);
+            configFileContent = getExtensionJSFileContent(mActivity, EXTENSION_CONFIG_FILE, false);
         } catch (IOException e) {
             Log.e(TAG, "Failed to read extensions-config.json");
             return;
@@ -236,7 +238,7 @@ public class XWalkExtensionManager implements XWalkExtensionContext {
                 // Load the content of the JavaScript file.
                 String jsApi;
                 try {
-                    jsApi = getAssetsFileContent(mActivity.getAssets(), jsApiFile);
+                    jsApi = getExtensionJSFileContent(mActivity, jsApiFile, false);
                 } catch (IOException e) {
                     Log.e(TAG, "Failed to read the file " + jsApiFile);
                     return;
@@ -251,11 +253,30 @@ public class XWalkExtensionManager implements XWalkExtensionContext {
         }
     }
 
-    private String getAssetsFileContent(AssetManager assetManager, String fileName) throws IOException {
+    private String getExtensionJSFileContent(Context context, String fileName, boolean fromRaw)
+            throws IOException {
         String result = "";
         InputStream inputStream = null;
         try {
-            inputStream = assetManager.open(fileName);
+            if (fromRaw) {
+                // If fromRaw is true, Try to find js file in res/raw first.
+                // And then try to get it from assets if failed.
+                Resources resource = context.getResources();
+                String resName = (new File(fileName).getName().split("\\."))[0];
+                int resId = resource.getIdentifier(resName, "raw", context.getPackageName());
+                if (resId > 0) {
+                    try {
+                        inputStream = resource.openRawResource(resId);
+                    } catch (NotFoundException e) {
+                        Log.w(TAG, "Inputstream failed to open for R.raw." + resName +
+                                   ", try to find it in assets");
+                    }
+                }
+            }
+            if (inputStream == null) {
+                AssetManager assetManager = context.getAssets();
+                inputStream = assetManager.open(fileName);
+            }
             int size = inputStream.available();
             byte[] buffer = new byte[size];
             inputStream.read(buffer);
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api;
+package org.xwalk.core.extension.api;
 
 import android.content.Context;
 import android.hardware.display.DisplayManager;
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api;
+package org.xwalk.core.extension.api;
 
 import android.os.Build;
 import android.content.Context;
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.contacts;
+package org.xwalk.core.extension.api.contacts;
 
 import android.provider.ContactsContract.CommonDataKinds.Email;
 import android.provider.ContactsContract.CommonDataKinds.Event;
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.contacts;
+package org.xwalk.core.extension.api.contacts;
 
 import android.content.ContentResolver;
 import android.database.ContentObserver;
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.contacts;
+package org.xwalk.core.extension.api.contacts;
 
 import android.content.ContentResolver;
 import android.database.Cursor;
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.contacts;
+package org.xwalk.core.extension.api.contacts;
 
 import android.content.ContentProviderOperation;
 import android.content.ContentProviderOperation.Builder;
@@ -28,7 +28,7 @@ import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
-import org.xwalk.runtime.extension.api.contacts.ContactConstants.ContactMap;
+import org.xwalk.core.extension.api.contacts.ContactConstants.ContactMap;
 
 /**
  * This class saves contacts according to a given JSONString.
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.contacts;
+package org.xwalk.core.extension.api.contacts;
 
 import android.content.ContentProviderOperation;
 import android.content.ContentProviderResult;
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.contacts;
+package org.xwalk.core.extension.api.contacts;
 
 import android.content.ContentProviderOperation;
 import android.content.ContentResolver;
@@ -21,8 +21,8 @@ import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
-import org.xwalk.runtime.extension.XWalkExtension;
-import org.xwalk.runtime.extension.XWalkExtensionContext;
+import org.xwalk.core.extension.XWalkExtension;
+import org.xwalk.core.extension.XWalkExtensionContext;
 
 public class Contacts extends XWalkExtension {
     public static final String NAME = "xwalk.experimental.contacts";
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.device_capabilities;
+package org.xwalk.core.extension.api.device_capabilities;
 
 import android.util.Log;
 
-import org.xwalk.runtime.extension.XWalkExtension;
-import org.xwalk.runtime.extension.XWalkExtensionContext;
+import org.xwalk.core.extension.XWalkExtension;
+import org.xwalk.core.extension.XWalkExtensionContext;
 
 import org.json.JSONException;
 import org.json.JSONObject;
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.device_capabilities;
+package org.xwalk.core.extension.api.device_capabilities;
 
 import android.util.Log;
 
@@ -11,7 +11,7 @@ import java.io.IOException;
 
 import org.json.JSONException;
 import org.json.JSONObject;
-import org.xwalk.runtime.extension.XWalkExtensionContext;
+import org.xwalk.core.extension.XWalkExtensionContext;
 
 class DeviceCapabilitiesCPU {
     private static final String SYSTEM_INFO_STAT_FILE = "/proc/stat";
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.device_capabilities;
+package org.xwalk.core.extension.api.device_capabilities;
 
 import org.json.JSONObject;
-import org.xwalk.runtime.extension.XWalkExtensionContext;
+import org.xwalk.core.extension.XWalkExtensionContext;
 
 class DeviceCapabilitiesCodecs {
     private static XWalkMediaCodec sMediaCodec;
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.device_capabilities;
+package org.xwalk.core.extension.api.device_capabilities;
 
 import android.content.Context;
 import android.graphics.Point;
@@ -14,8 +14,8 @@ import android.view.Display;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
-import org.xwalk.runtime.extension.api.XWalkDisplayManager;
-import org.xwalk.runtime.extension.XWalkExtensionContext;
+import org.xwalk.core.extension.api.XWalkDisplayManager;
+import org.xwalk.core.extension.XWalkExtensionContext;
 
 class DeviceCapabilitiesDisplay {
     private static final String TAG = "DeviceCapabilitiesDisplay";
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.device_capabilities;
+package org.xwalk.core.extension.api.device_capabilities;
 
 import android.app.ActivityManager;
 import android.app.ActivityManager.MemoryInfo;
@@ -15,7 +15,7 @@ import java.io.IOException;
 
 import org.json.JSONException;
 import org.json.JSONObject;
-import org.xwalk.runtime.extension.XWalkExtensionContext;
+import org.xwalk.core.extension.XWalkExtensionContext;
 
 class DeviceCapabilitiesMemory {
     private static final String MEM_INFO_FILE = "/proc/meminfo";
@@ -2,12 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.device_capabilities;
+package org.xwalk.core.extension.api.device_capabilities;
 
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.os.Build.VERSION;
+import android.os.Build.VERSION_CODES;
 import android.os.Environment;
 import android.os.StatFs;
 import android.util.Log;
@@ -18,7 +20,7 @@ import java.io.File;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
-import org.xwalk.runtime.extension.XWalkExtensionContext;
+import org.xwalk.core.extension.XWalkExtensionContext;
 
 class DeviceCapabilitiesStorage {
     private static final String TAG = "DeviceCapabilitiesStorage";
@@ -78,6 +80,7 @@ class DeviceCapabilitiesStorage {
             return file.canRead();
         }
 
+        @SuppressWarnings("deprecation")
         public void updateCapacity() {
             if (!isValid()) {
                 return;
@@ -86,9 +89,16 @@ class DeviceCapabilitiesStorage {
             StatFs stat = new StatFs(mPath);
             // FIXME(halton): After API level 18, use getTotalBytes() and
             // getAvailableBytes() instead
-            long blockSize = stat.getBlockSize();
-            mCapacity = blockSize * stat.getBlockCount();
-            mAvailCapacity = blockSize * stat.getAvailableBlocks();
+            long blockSize;
+            if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR2) {
+                blockSize = stat.getBlockSizeLong();
+                mCapacity = blockSize * stat.getBlockCountLong();
+                mAvailCapacity = blockSize * stat.getAvailableBlocksLong();
+            } else {
+                blockSize = stat.getBlockSize();
+                mCapacity = blockSize * stat.getBlockCount();
+                mAvailCapacity = blockSize * stat.getAvailableBlocks();
+            }
         }
 
         public JSONObject convertToJSON() {
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.launchscreen;
+package org.xwalk.core.extension.api.launchscreen;
 
 import android.content.Intent;
 import android.util.Log;
 
 import org.xwalk.core.XWalkLaunchScreenManager;
-import org.xwalk.runtime.extension.XWalkExtension;
-import org.xwalk.runtime.extension.XWalkExtensionContext;
+import org.xwalk.core.extension.XWalkExtension;
+import org.xwalk.core.extension.XWalkExtensionContext;
 
 /**
  * A XWalk extension for LaunchScreen API implementation on Android.
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.messaging;
+package org.xwalk.core.extension.api.messaging;
 
 import android.app.Activity;
 import android.content.ContentValues;
@@ -20,10 +20,10 @@ import java.util.Map;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
-import org.xwalk.runtime.extension.api.messaging.MessagingManager;
-import org.xwalk.runtime.extension.api.messaging.MessagingSmsManager;
-import org.xwalk.runtime.extension.XWalkExtension;
-import org.xwalk.runtime.extension.XWalkExtensionContext;
+import org.xwalk.core.extension.api.messaging.MessagingManager;
+import org.xwalk.core.extension.api.messaging.MessagingSmsManager;
+import org.xwalk.core.extension.XWalkExtension;
+import org.xwalk.core.extension.XWalkExtensionContext;
 
 interface Command {
     void runCommand(int instanceID, JSONObject jsonMsg);
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.messaging;
+package org.xwalk.core.extension.api.messaging;
 
 import android.database.Cursor;
 import java.text.SimpleDateFormat;
@@ -12,8 +12,8 @@ import java.util.Date;
 
 import org.json.JSONException;
 import org.json.JSONObject;
-import org.xwalk.runtime.extension.api.messaging.MessagingSmsConstMaps;
-import org.xwalk.runtime.extension.api.messaging.MessagingSmsConsts;
+import org.xwalk.core.extension.api.messaging.MessagingSmsConstMaps;
+import org.xwalk.core.extension.api.messaging.MessagingSmsConsts;
 
 public class MessagingHelpers {
     private static String buildSqlClause(boolean hasAnd, String condition, String column) {
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.messaging;
+package org.xwalk.core.extension.api.messaging;
 
 import android.app.Activity;
 import android.app.PendingIntent;
@@ -27,10 +27,10 @@ import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
-import org.xwalk.runtime.extension.api.messaging.Messaging;
-import org.xwalk.runtime.extension.api.messaging.MessagingHelpers;
-import org.xwalk.runtime.extension.api.messaging.MessagingSmsConstMaps;
-import org.xwalk.runtime.extension.api.messaging.MessagingSmsConsts;
+import org.xwalk.core.extension.api.messaging.Messaging;
+import org.xwalk.core.extension.api.messaging.MessagingHelpers;
+import org.xwalk.core.extension.api.messaging.MessagingSmsConstMaps;
+import org.xwalk.core.extension.api.messaging.MessagingSmsConsts;
 
 public class MessagingManager {
     private final static String TAG = "MessagingManager"; 
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.messaging;
+package org.xwalk.core.extension.api.messaging;
 
 import java.util.HashMap;
-import org.xwalk.runtime.extension.api.messaging.MessagingSmsConsts;
+import org.xwalk.core.extension.api.messaging.MessagingSmsConsts;
 
 public class MessagingSmsConstMaps {
     final public static HashMap<String, String> smsTableColumnDict = 
@@ -17,7 +17,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.xwalk.runtime.extension.api.messaging;
+package org.xwalk.core.extension.api.messaging;
 
 // Contains SMS content provider constants. These values are copied from
 // com.android.provider.telephony.*
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.messaging;
+package org.xwalk.core.extension.api.messaging;
 
 import android.app.Activity;
 import android.app.PendingIntent;
@@ -25,7 +25,7 @@ import java.util.ArrayList;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
-import org.xwalk.runtime.extension.api.messaging.Messaging;
+import org.xwalk.core.extension.api.messaging.Messaging;
 
 public class MessagingSmsManager {
     private final static String TAG = "MessagingSmsManager";
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.presentation;
+package org.xwalk.core.extension.api.presentation;
 
 import android.content.Context;
 import android.os.Build;
@@ -21,9 +21,9 @@ import java.net.URISyntaxException;
 
 import org.chromium.base.ThreadUtils;
 
-import org.xwalk.runtime.extension.api.XWalkDisplayManager;
-import org.xwalk.runtime.extension.XWalkExtension;
-import org.xwalk.runtime.extension.XWalkExtensionContext;
+import org.xwalk.core.extension.api.XWalkDisplayManager;
+import org.xwalk.core.extension.XWalkExtension;
+import org.xwalk.core.extension.XWalkExtensionContext;
 
 /**
  * A XWalk extension for Presentation API implementation on Android.
@@ -2,15 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-package org.xwalk.runtime.extension.api.screenorientation;
+package org.xwalk.core.extension.api.screenorientation;
 
 import android.app.Activity;
 import android.content.pm.ActivityInfo;
 import android.util.Log;
 
 import org.json.JSONObject;
-import org.xwalk.runtime.extension.XWalkExtension;
-import org.xwalk.runtime.extension.XWalkExtensionContext;
+import org.xwalk.core.extension.XWalkExtension;
+import org.xwalk.core.extension.XWalkExtensionContext;
 
 /**
  * XWalk extension for screen orientation api implementation on Android.
index 71afb07..953ecb4 100644 (file)
@@ -29,7 +29,7 @@
         </activity>
     </application>
 
-  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.CAMERA"/>
diff --git a/src/xwalk/runtime/android/java/src/org/xwalk/runtime/XWalkRuntimeViewProviderBase.java b/src/xwalk/runtime/android/java/src/org/xwalk/runtime/XWalkRuntimeViewProviderBase.java
deleted file mode 100644 (file)
index 7cf1ccf..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2013 Intel Corporation. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.xwalk.runtime;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-import android.view.View;
-
-import org.xwalk.runtime.extension.XWalkExtensionManager;
-
-/**
- * The abstract class to provide the common implementation for inherited classes.
- * Here is to use XWalkExtensionManager to manage extension system.
- */
-public abstract class XWalkRuntimeViewProviderBase implements XWalkRuntimeViewProvider {
-    private Context mContext;
-    private Activity mActivity;
-    protected XWalkExtensionManager mExtensionManager;
-
-    XWalkRuntimeViewProviderBase(Context context, Activity activity) {
-        mContext = context;
-        mActivity = activity;
-    }
-
-    @Override
-    public void onCreate() {
-    }
-
-    @Override
-    public void onResume() {
-        mExtensionManager.onResume();
-    }
-
-    @Override
-    public void onPause() {
-        mExtensionManager.onPause();
-    }
-
-    @Override
-    public void onDestroy() {
-        mExtensionManager.onDestroy();
-    }
-
-    @Override
-    public void onActivityResult(int requestCode, int resultCode, Intent data) {
-        mExtensionManager.onActivityResult(requestCode, resultCode, data);
-    }
-}
diff --git a/src/xwalk/runtime/android/runtime/res/values/strings.xml b/src/xwalk/runtime/android/runtime/res/values/strings.xml
new file mode 100644 (file)
index 0000000..e99ec05
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
+
+     Use of this source code is governed by a BSD-style license that can be
+     found in the LICENSE file.
+-->
+
+<!-- DO NOT ADD STRINGS HERE.
+
+    Android content strings now live in
+    xwalk/runtime/android/java/strings/android_xwalk_strings.grd
+
+    See http://www.chromium.org/developers/design-documents/ui-localization
+-->
+
+<resources/>
@@ -10,17 +10,17 @@ import android.content.Intent;
 import android.content.ServiceConnection;
 
 /**
- * MixContext provides ApplicationContext for the contextImpl object
+ * MixedContext provides ApplicationContext for the contextImpl object
  * created by Context.CreatePackageContext().
  *
  * For cross package usage, the library part need the possibility to
  * get both the application's context and the library itself's context.
  *
  */
-public class MixContext extends ContextWrapper {
+public class MixedContext extends ContextWrapper {
     private Context mActivityCtx;
 
-    public MixContext(Context base, Context activity) {
+    public MixedContext(Context base, Context activity) {
         super(base);
         mActivityCtx = activity;
     }
@@ -13,22 +13,19 @@ import android.widget.FrameLayout;
 
 import org.chromium.content.browser.LoadUrlParams;
 import org.xwalk.core.XWalkView;
-import org.xwalk.runtime.extension.XWalkExtensionManager;
 
 /**
  * The implementation class for runtime core. It calls the methods provided
  * by runtime core and customizes the behaviors for runtime.
  */
-class XWalkCoreProviderImpl extends XWalkRuntimeViewProviderBase {
+class XWalkCoreProviderImpl implements XWalkRuntimeViewProvider {
     private Context mContext;
     private Activity mActivity;
     private XWalkView mXwalkView;
 
     public XWalkCoreProviderImpl(Context context, Activity activity) {
-        super(context, activity);
         mContext = context;
         mActivity = activity;
-        mExtensionManager = new XWalkExtensionManager(context, activity);
         init(context, activity);
     }
 
@@ -36,7 +33,6 @@ class XWalkCoreProviderImpl extends XWalkRuntimeViewProviderBase {
         // TODO(yongsheng): do customizations for XWalkView. There will
         // be many callback classes which are needed to be implemented.
         mXwalkView = new XWalkView(context, activity);
-        mExtensionManager.loadExtensions();
     }
 
     @Override
@@ -59,30 +55,25 @@ class XWalkCoreProviderImpl extends XWalkRuntimeViewProviderBase {
 
     @Override
     public void onCreate() {
-        super.onCreate();
     }
 
     @Override
     public void onResume() {
-        super.onResume();
         mXwalkView.onResume();
     }
 
     @Override
     public void onPause() {
-        super.onPause();
         mXwalkView.onPause();
     }
 
     @Override
     public void onDestroy() {
-        super.onDestroy();
         mXwalkView.onDestroy();
     }
 
     @Override
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
-        super.onActivityResult(requestCode, resultCode, data);
         mXwalkView.onActivityResult(requestCode, resultCode, data);
     }
 
@@ -37,9 +37,9 @@ public class XWalkRuntimeView extends FrameLayout {
     public XWalkRuntimeView(Activity activity, Context libContext, AttributeSet attrs) {
         super(libContext, attrs);
 
-        // MixContext is needed for cross package because the application
+        // MixedContext is needed for cross package because the application
         // context is different.
-        init(new MixContext(libContext, activity), activity);
+        init(new MixedContext(libContext, activity), activity);
     }
 
     /**
@@ -13,5 +13,5 @@
         android:label="XWalkRuntimeLib" android:hardwareAccelerated="true" android:icon="@drawable/crosswalk">
     </application>
 
-  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
 </manifest>
index 8662a62..1148b92 100644 (file)
@@ -29,7 +29,7 @@
         </activity>
     </application>
 
-  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+  <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.CAMERA"/>
index 550bf9d..c18a79a 100644 (file)
@@ -56,11 +56,16 @@ class XWalkContentsIoThreadClient {
   virtual CacheMode GetCacheMode() const = 0;
 
   // This will attempt to fetch the XWalkContentsIoThreadClient for the given
-  // |render_process_id|, |render_view_id| pair.
+  // |render_process_id|, |render_frame_id| pair.
   // This method can be called from any thread.
   // An empty scoped_ptr is a valid return value.
   static scoped_ptr<XWalkContentsIoThreadClient> FromID(int render_process_id,
-                                                        int render_view_id);
+                                                        int render_frame_id);
+
+  // Called on the IO thread when a subframe is created.
+  static void SubFrameCreated(int render_process_id,
+                              int parent_render_frame_id,
+                              int child_render_frame_id);
 
   // This method is called on the IO thread only.
   virtual scoped_ptr<InterceptedRequestData> ShouldInterceptRequest(
index f8e1055..681d6f7 100644 (file)
@@ -15,6 +15,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/synchronization/lock.h"
 #include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_frame_host.h"
 #include "content/public/browser/render_process_host.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/resource_request_info.h"
@@ -31,7 +32,7 @@ using base::android::JavaRef;
 using base::android::ScopedJavaLocalRef;
 using base::LazyInstance;
 using content::BrowserThread;
-using content::RenderViewHost;
+using content::RenderFrameHost;
 using content::WebContents;
 using std::map;
 using std::pair;
@@ -50,56 +51,56 @@ struct IoThreadClientData {
 IoThreadClientData::IoThreadClientData() : pending_association(false) {}
 
 typedef map<pair<int, int>, IoThreadClientData>
-    RenderViewHostToIoThreadClientType;
+    RenderFrameHostToIoThreadClientType;
 
-static pair<int, int> GetRenderViewHostIdPair(RenderViewHost* rvh) {
-  return pair<int, int>(rvh->GetProcess()->GetID(), rvh->GetRoutingID());
+static pair<int, int> GetRenderFrameHostIdPair(RenderFrameHost* rfh) {
+  return pair<int, int>(rfh->GetProcess()->GetID(), rfh->GetRoutingID());
 }
 
-// RvhToIoThreadClientMap -----------------------------------------------------
-class RvhToIoThreadClientMap {
+// RfhToIoThreadClientMap -----------------------------------------------------
+class RfhToIoThreadClientMap {
  public:
-  static RvhToIoThreadClientMap* GetInstance();
-  void Set(pair<int, int> rvh_id, const IoThreadClientData& client);
-  bool Get(pair<int, int> rvh_id, IoThreadClientData* client);
-  void Erase(pair<int, int> rvh_id);
+  static RfhToIoThreadClientMap* GetInstance();
+  void Set(pair<int, int> rfh_id, const IoThreadClientData& client);
+  bool Get(pair<int, int> rfh_id, IoThreadClientData* client);
+  void Erase(pair<int, int> rfh_id);
 
  private:
-  static LazyInstance<RvhToIoThreadClientMap> g_instance_;
+  static LazyInstance<RfhToIoThreadClientMap> g_instance_;
   base::Lock map_lock_;
-  RenderViewHostToIoThreadClientType rvh_to_io_thread_client_;
+  RenderFrameHostToIoThreadClientType rfh_to_io_thread_client_;
 };
 
 // static
-LazyInstance<RvhToIoThreadClientMap> RvhToIoThreadClientMap::g_instance_ =
+LazyInstance<RfhToIoThreadClientMap> RfhToIoThreadClientMap::g_instance_ =
     LAZY_INSTANCE_INITIALIZER;
 
 // static
-RvhToIoThreadClientMap* RvhToIoThreadClientMap::GetInstance() {
+RfhToIoThreadClientMap* RfhToIoThreadClientMap::GetInstance() {
   return g_instance_.Pointer();
 }
 
-void RvhToIoThreadClientMap::Set(pair<int, int> rvh_id,
+void RfhToIoThreadClientMap::Set(pair<int, int> rfh_id,
                                  const IoThreadClientData& client) {
   base::AutoLock lock(map_lock_);
-  rvh_to_io_thread_client_[rvh_id] = client;
+  rfh_to_io_thread_client_[rfh_id] = client;
 }
 
-bool RvhToIoThreadClientMap::Get(
-    pair<int, int> rvh_id, IoThreadClientData* client) {
+bool RfhToIoThreadClientMap::Get(
+    pair<int, int> rfh_id, IoThreadClientData* client) {
   base::AutoLock lock(map_lock_);
-  RenderViewHostToIoThreadClientType::iterator iterator =
-      rvh_to_io_thread_client_.find(rvh_id);
-  if (iterator == rvh_to_io_thread_client_.end())
+  RenderFrameHostToIoThreadClientType::iterator iterator =
+      rfh_to_io_thread_client_.find(rfh_id);
+  if (iterator == rfh_to_io_thread_client_.end())
     return false;
 
   *client = iterator->second;
   return true;
 }
 
-void RvhToIoThreadClientMap::Erase(pair<int, int> rvh_id) {
+void RfhToIoThreadClientMap::Erase(pair<int, int> rfh_id) {
   base::AutoLock lock(map_lock_);
-  rvh_to_io_thread_client_.erase(rvh_id);
+  rfh_to_io_thread_client_.erase(rfh_id);
 }
 
 // ClientMapEntryUpdater ------------------------------------------------------
@@ -109,8 +110,8 @@ class ClientMapEntryUpdater : public content::WebContentsObserver {
   ClientMapEntryUpdater(JNIEnv* env, WebContents* web_contents,
                         jobject jdelegate);
 
-  virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE;
-  virtual void RenderViewDeleted(RenderViewHost* render_view_host) OVERRIDE;
+  virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) OVERRIDE;
+  virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) OVERRIDE;
   virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
 
  private:
@@ -125,21 +126,21 @@ ClientMapEntryUpdater::ClientMapEntryUpdater(JNIEnv* env,
   DCHECK(web_contents);
   DCHECK(jdelegate);
 
-  if (web_contents->GetRenderViewHost())
-    RenderViewCreated(web_contents->GetRenderViewHost());
+  if (web_contents->GetMainFrame())
+    RenderFrameCreated(web_contents->GetMainFrame());
 }
 
-void ClientMapEntryUpdater::RenderViewCreated(RenderViewHost* rvh) {
+void ClientMapEntryUpdater::RenderFrameCreated(RenderFrameHost* rfh) {
   IoThreadClientData client_data;
   client_data.io_thread_client = jdelegate_;
   client_data.pending_association = false;
-  RvhToIoThreadClientMap::GetInstance()->Set(
-      GetRenderViewHostIdPair(rvh), client_data);
+  RfhToIoThreadClientMap::GetInstance()->Set(
+      GetRenderFrameHostIdPair(rfh), client_data);
 }
 
 
-void ClientMapEntryUpdater::RenderViewDeleted(RenderViewHost* rvh) {
-  RvhToIoThreadClientMap::GetInstance()->Erase(GetRenderViewHostIdPair(rvh));
+void ClientMapEntryUpdater::RenderFrameDeleted(RenderFrameHost* rfh) {
+  RfhToIoThreadClientMap::GetInstance()->Erase(GetRenderFrameHostIdPair(rfh));
 }
 
 void ClientMapEntryUpdater::WebContentsDestroyed(WebContents* web_contents) {
@@ -152,10 +153,11 @@ void ClientMapEntryUpdater::WebContentsDestroyed(WebContents* web_contents) {
 
 // static
 scoped_ptr<XWalkContentsIoThreadClient>
-XWalkContentsIoThreadClient::FromID(int render_process_id, int render_view_id) {
-  pair<int, int> rvh_id(render_process_id, render_view_id);
+XWalkContentsIoThreadClient::FromID(int render_process_id,
+                                    int render_frame_id) {
+  pair<int, int> rfh_id(render_process_id, render_frame_id);
   IoThreadClientData client_data;
-  if (!RvhToIoThreadClientMap::GetInstance()->Get(rvh_id, &client_data))
+  if (!RfhToIoThreadClientMap::GetInstance()->Get(rfh_id, &client_data))
     return scoped_ptr<XWalkContentsIoThreadClient>();
 
   JNIEnv* env = AttachCurrentThread();
@@ -168,12 +170,29 @@ XWalkContentsIoThreadClient::FromID(int render_process_id, int render_view_id) {
 }
 
 // static
+void XWalkContentsIoThreadClient::SubFrameCreated(int render_process_id,
+                                                  int parent_render_frame_id,
+                                                  int child_render_frame_id) {
+  pair<int, int> parent_rfh_id(render_process_id, parent_render_frame_id);
+  pair<int, int> child_rfh_id(render_process_id, child_render_frame_id);
+  IoThreadClientData client_data;
+  if (!RfhToIoThreadClientMap::GetInstance()->Get(parent_rfh_id,
+                                                  &client_data)) {
+    NOTREACHED();
+    return;
+  }
+
+  RfhToIoThreadClientMap::GetInstance()->Set(child_rfh_id, client_data);
+}
+
+
+// static
 void XWalkContentsIoThreadClientImpl::RegisterPendingContents(
     WebContents* web_contents) {
   IoThreadClientData client_data;
   client_data.pending_association = true;
-  RvhToIoThreadClientMap::GetInstance()->Set(
-      GetRenderViewHostIdPair(web_contents->GetRenderViewHost()), client_data);
+  RfhToIoThreadClientMap::GetInstance()->Set(
+      GetRenderFrameHostIdPair(web_contents->GetMainFrame()), client_data);
 }
 
 // static
index 00576d5..07ba5ce 100644 (file)
@@ -8,7 +8,7 @@
 #include "base/logging.h"
 #include "base/supports_user_data.h"
 #include "content/public/browser/browser_thread.h"
-#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/render_frame_host.h"
 #include "content/public/browser/resource_dispatcher_host.h"
 #include "content/public/browser/resource_request_info.h"
 #include "content/public/browser/web_contents.h"
@@ -16,7 +16,7 @@
 #include "net/url_request/url_request.h"
 
 using content::BrowserThread;
-using content::RenderViewHost;
+using content::RenderFrameHost;
 using content::ResourceDispatcherHost;
 using content::ResourceRequestInfo;
 using content::WebContents;
@@ -39,9 +39,9 @@ XWalkLoginDelegate::XWalkLoginDelegate(net::AuthChallengeInfo* auth_info,
     : auth_info_(auth_info),
       request_(request),
       render_process_id_(0),
-      render_view_id_(0) {
+      render_frame_id_(0) {
     ResourceRequestInfo::GetRenderFrameForRequest(
-        request, &render_process_id_, &render_view_id_);
+        request, &render_process_id_, &render_frame_id_);
 
     UrlRequestAuthAttemptsData* count =
         static_cast<UrlRequestAuthAttemptsData*>(
@@ -85,15 +85,15 @@ void XWalkLoginDelegate::HandleHttpAuthRequestOnUIThread(
   xwalk_http_auth_handler_.reset(XWalkHttpAuthHandlerBase::Create(
       this, auth_info_.get(), first_auth_attempt));
 
-  RenderViewHost* render_view_host = RenderViewHost::FromID(
-      render_process_id_, render_view_id_);
-  if (!render_view_host) {
+  RenderFrameHost* render_frame_host = RenderFrameHost::FromID(
+      render_process_id_, render_frame_id_);
+  if (!render_frame_host) {
     Cancel();
     return;
   }
 
-  WebContents* web_contents = WebContents::FromRenderViewHost(
-      render_view_host);
+  WebContents* web_contents = WebContents::FromRenderFrameHost(
+      render_frame_host);
   if (!xwalk_http_auth_handler_->HandleOnUIThread(web_contents)) {
     Cancel();
     return;
index 018f5dc..ae1b5c4 100644 (file)
@@ -24,7 +24,8 @@ class XWalkLoginDelegate
   XWalkLoginDelegate(net::AuthChallengeInfo* auth_info,
                      net::URLRequest* request);
 
-  virtual void Proceed(const base::string16& user, const base::string16& password);
+  virtual void Proceed(const base::string16& user,
+                       const base::string16& password);
   virtual void Cancel();
 
   // from ResourceDispatcherHostLoginDelegate
@@ -34,14 +35,15 @@ class XWalkLoginDelegate
   virtual ~XWalkLoginDelegate();
   void HandleHttpAuthRequestOnUIThread(bool first_auth_attempt);
   void CancelOnIOThread();
-  void ProceedOnIOThread(const base::string16& user, const base::string16& password);
+  void ProceedOnIOThread(const base::string16& user,
+                         const base::string16& password);
   void DeleteAuthHandlerSoon();
 
   scoped_ptr<XWalkHttpAuthHandlerBase> xwalk_http_auth_handler_;
   scoped_refptr<net::AuthChallengeInfo> auth_info_;
   net::URLRequest* request_;
   int render_process_id_;
-  int render_view_id_;
+  int render_frame_id_;
 };
 
 }  // namespace xwalk
index 6f482f6..8c0dd12 100644 (file)
@@ -146,6 +146,12 @@ void Runtime::LoadURL(const GURL& url) {
 }
 
 void Runtime::Close() {
+  if (window_) {
+    window_->Close();
+    return;
+  }
+  // Runtime should not free itself on Close but be owned
+  // by Application.
   delete this;
 }
 
@@ -325,7 +331,9 @@ void Runtime::Observe(int type,
 }
 
 void Runtime::OnWindowDestroyed() {
-  Close();
+  // Runtime should not free itself on Close but be owned
+  // by Application.
+  delete this;
 }
 
 void Runtime::RequestMediaAccessPermission(
index 619b5f8..a715b8e 100644 (file)
@@ -19,40 +19,39 @@ XWalkAppExtensionBridge::XWalkAppExtensionBridge()
 XWalkAppExtensionBridge::~XWalkAppExtensionBridge() {}
 
 void XWalkAppExtensionBridge::CheckAPIAccessControl(
+    int render_process_id,
     const std::string& extension_name,
     const std::string& api_name,
     const extensions::PermissionCallback& callback) {
   CHECK(app_system_);
-  xwalk::application::ApplicationService* service =
+  application::ApplicationService *service =
       app_system_->application_service();
-  // TODO(Bai): The extension system should be aware where the request is
-  // comming from, i.e. the request origin application ID. So, apart from
-  // the rp-ep mapping, we need an additional mapping for AppID-rp.
-  const ScopedVector<xwalk::application::Application> &apps =
-      service->active_applications();
-  if (apps.empty()) {
+
+  application::Application *app =
+      service->GetApplicationByRenderHostID(render_process_id);
+  if (!app) {
     callback.Run(extensions::UNDEFINED_RUNTIME_PERM);
     return;
   }
-  std::string app_id = (apps.front())->id();
-  service->CheckAPIAccessControl(app_id, extension_name, api_name,
+
+  service->CheckAPIAccessControl(app->id(), extension_name, api_name,
       *(reinterpret_cast<const xwalk::application::PermissionCallback*>
       (&callback)));
 }
 
 bool XWalkAppExtensionBridge::RegisterPermissions(
+    int render_process_id,
     const std::string& extension_name,
     const std::string& perm_table) {
   CHECK(app_system_);
-  xwalk::application::ApplicationService* service =
+  application::ApplicationService *service =
       app_system_->application_service();
-  const ScopedVector<xwalk::application::Application> &apps =
-      service->active_applications();
-  if (apps.empty()) {
+  application::Application *app =
+      service->GetApplicationByRenderHostID(render_process_id);
+  if (!app)
     return false;
-  }
-  std::string app_id = (apps.front())->id();
-  return service->RegisterPermissions(app_id, extension_name, perm_table);
+
+  return service->RegisterPermissions(app->id(), extension_name, perm_table);
 }
 
 }  // namespace xwalk
index 84e271a..2b63371 100644 (file)
@@ -30,10 +30,14 @@ class XWalkAppExtensionBridge
     app_system_ = app_system;
   }
   // XWalkExtensionService::Delegate implementation
-  virtual void CheckAPIAccessControl(const std::string& extension_name,
+  virtual void CheckAPIAccessControl(
+      int render_process_id,
+      const std::string& extension_name,
       const std::string& api_name,
       const extensions::PermissionCallback& callback) OVERRIDE;
-  virtual bool RegisterPermissions(const std::string& extension_name,
+  virtual bool RegisterPermissions(
+      int render_process_id,
+      const std::string& extension_name,
       const std::string& perm_table) OVERRIDE;
 
  private:
index 3fc5afb..dbeaef8 100644 (file)
@@ -186,13 +186,6 @@ void XWalkBrowserMainParts::PreMainMessageLoopRun() {
 
   NativeAppWindow::Initialize();
 
-  application::ApplicationSystem* app_system = xwalk_runner_->app_system();
-  if (app_system->HandleApplicationManagementCommands(
-      *command_line, startup_url_,
-      run_default_message_loop_)) {
-    return;
-  }
-
   if (command_line->HasSwitch(switches::kListFeaturesFlags)) {
     XWalkRuntimeFeatures::GetInstance()->DumpFeaturesFlags();
     run_default_message_loop_ = false;
@@ -206,9 +199,11 @@ void XWalkBrowserMainParts::PreMainMessageLoopRun() {
     return;
   }
 
-  if (app_system->LaunchFromCommandLine(*command_line, startup_url_,
-      run_default_message_loop_)) {
-    return;
+  application::ApplicationSystem* app_system = xwalk_runner_->app_system();
+  if (!app_system->HandleApplicationManagementCommands(*command_line,
+      startup_url_, run_default_message_loop_)) {
+    app_system->LaunchFromCommandLine(*command_line, startup_url_,
+                                      run_default_message_loop_);
   }
 
   // If the |ui_task| is specified in main function parameter, it indicates
index 7f629b4..50fc75e 100644 (file)
@@ -95,6 +95,14 @@ void XWalkBrowserMainPartsAndroid::PreMainMessageLoopStart() {
   command_line->AppendSwitch(switches::kDisableWebRtcHWDecoding);
   command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding);
 
+  // WebAudio is disabled on android x86 platform, and only enabled on android
+  // ARM platform by default, we must enable it explicitly on x86 platform.
+  // TODO(liyin): Remove enable webaudio switch when it is enabled by default.
+#if defined(ARCH_CPU_X86)
+  if (!command_line->HasSwitch(switches::kEnableWebAudio))
+    command_line->AppendSwitch(switches::kEnableWebAudio);
+#endif
+
   XWalkBrowserMainParts::PreMainMessageLoopStart();
 
   startup_url_ = GURL();
index 06de4ae..e0d796b 100644 (file)
@@ -42,7 +42,7 @@ bool GetXWalkDataPath(base::FilePath* path) {
   CHECK(PathService::Get(base::DIR_LOCAL_APP_DATA, &cur));
   cur = cur.Append(xwalk_suffix);
 
-#elif defined(OS_TIZEN)
+#elif defined(OS_TIZEN_MOBILE)
   if (XWalkRunner::GetInstance()->is_running_as_service())
     cur = GetConfigPath().Append(xwalk_suffix);
   else
index 8a57b13..7d9a122 100644 (file)
@@ -17,7 +17,7 @@ class StorageInfoProviderChromium : public StorageInfoProvider,
   StorageInfoProviderChromium();
   virtual ~StorageInfoProviderChromium();
 
-  virtual scoped_ptr<SystemStorage> storage_info() const;
+  virtual scoped_ptr<SystemStorage> storage_info() const OVERRIDE;
 
   // RemovableStorageObserver implementation.
   virtual void OnRemovableStorageAttached(const StorageInfo& info) OVERRIDE;
index e2f09e7..538ef19 100644 (file)
@@ -8,9 +8,6 @@
         '../../base/base.gyp:run_all_unittests',
         '../../content/content_shell_and_tests.gyp:test_support_content',
         '../../testing/gtest.gyp:gtest',
-        '../../ui/ui.gyp:ui',
-        '../../ui/views/views.gyp:views',
-        '../../webkit/child/webkit_child.gyp:webkit_child',
         '../extensions/extensions.gyp:xwalk_extensions',
         'sysapps.gyp:sysapps',
       ],
             '../../base/allocator/allocator.gyp:allocator',
           ],
         }],
+        ['use_aura==1', {
+          'dependencies': [
+          '../../ui/views/views.gyp:views',
+          ],
+        }],
       ],
     },
     {
index d9762c2..a0b6f0a 100644 (file)
@@ -14,7 +14,7 @@
             android:authorities="org.xwalk.core.xwview.test.TestContentProvider" />
     </application>
 
-    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
     <instrumentation android:name="android.test.InstrumentationTestRunner"
         android:targetPackage="org.xwalk.core.xwview.shell"
         android:label="Test for org.xwalk.core.xwview" />
diff --git a/src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/XWalkClientShouldInterceptRequestTest.java b/src/xwalk/test/android/core/javatests/src/org/xwalk/core/xwview/test/XWalkClientShouldInterceptRequestTest.java
new file mode 100644 (file)
index 0000000..f62d02f
--- /dev/null
@@ -0,0 +1,569 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright (c) 2014 Intel Corporation. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.xwalk.core.xwview.test;
+
+import android.graphics.Bitmap;
+import android.test.suitebuilder.annotation.SmallTest;
+import android.util.Log;
+import android.util.Pair;
+import android.webkit.WebResourceResponse;
+import org.chromium.base.test.util.DisabledTest;
+import org.chromium.base.test.util.Feature;
+import org.chromium.base.test.util.TestFileUtil;
+import org.chromium.content.browser.test.util.CallbackHelper;
+import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnReceivedErrorHelper;
+import org.chromium.net.test.util.TestWebServer;
+
+import org.xwalk.core.xwview.test.util.CommonResources;
+import org.xwalk.core.XWalkClient;
+import org.xwalk.core.XWalkContent;
+import org.xwalk.core.XWalkView;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * Test case for XWalkClient.shouldInterceptRequest callback
+ *
+ * Note the major part of this file is migrated from android_webview/.
+ */
+public class XWalkClientShouldInterceptRequestTest extends XWalkViewTestBase {
+
+    /**
+     * Customized XWalkClient implementation for shouldInterceptRequest
+     */
+    private class TestXWalkClient extends XWalkClient {
+
+        public class ShouldInterceptRequestHelper extends CallbackHelper {
+            private List<String> mShouldInterceptRequestUrls = new ArrayList<String>();
+            private ConcurrentHashMap<String, WebResourceResponse> mReturnValuesByUrls
+                = new ConcurrentHashMap<String, WebResourceResponse>();
+            // This is read from the IO thread, so needs to be marked volatile.
+            private volatile WebResourceResponse mResourceResponseReturnValue = null;
+            private String mUrlToWaitFor;
+
+            void setReturnValue(WebResourceResponse value) {
+                mResourceResponseReturnValue = value;
+            }
+
+            void setReturnValueForUrl(String url, WebResourceResponse value) {
+                mReturnValuesByUrls.put(url, value);
+            }
+
+            public void setUrlToWaitFor(String url) {
+                mUrlToWaitFor = url;
+            }
+
+            public List<String> getUrls() {
+                assert getCallCount() > 0;
+                return mShouldInterceptRequestUrls;
+            }
+
+            public WebResourceResponse getReturnValue(String url) {
+                WebResourceResponse value = mReturnValuesByUrls.get(url);
+                if (value != null) return value;
+                return mResourceResponseReturnValue;
+            }
+
+            public void notifyCalled(String url) {
+                if (mUrlToWaitFor == null || mUrlToWaitFor.equals(url)) {
+                    mShouldInterceptRequestUrls.add(url);
+                    notifyCalled();
+                }
+            }
+        }
+
+        public class OnLoadResourceHelper extends CallbackHelper {
+            private String mUrl;
+
+            public String getUrl() {
+                assert getCallCount() > 0;
+                return mUrl;
+            }
+
+            public void notifyCalled(String url) {
+                mUrl = url;
+                notifyCalled();
+            }
+        }
+
+        @Override
+        public void onPageStarted(XWalkView view, String url, Bitmap favicon) {
+            mTestContentsClient.onPageStarted(url);
+        }
+
+        @Override
+        public void onPageFinished(XWalkView view, String url) {
+            mTestContentsClient.didFinishLoad(url);
+        }
+
+        @Override
+        public void onReceivedError(XWalkView view, int errorCode,
+                String description, String failingUrl) {
+            mTestContentsClient.onReceivedError(errorCode, description, failingUrl);
+        }
+
+        @Override
+        public WebResourceResponse shouldInterceptRequest(XWalkView view, String url) {
+            WebResourceResponse response = mShouldInterceptRequestHelper.getReturnValue(url);
+            mShouldInterceptRequestHelper.notifyCalled(url);
+            return response;
+        }
+
+        @Override
+        public void onLoadResource(XWalkView view, String url) {
+            super.onLoadResource(view, url);
+            mOnLoadResourceHelper.notifyCalled(url);
+        }
+
+        private ShouldInterceptRequestHelper mShouldInterceptRequestHelper;
+        private OnLoadResourceHelper mOnLoadResourceHelper;
+
+        public TestXWalkClient() {
+            mShouldInterceptRequestHelper = new ShouldInterceptRequestHelper();
+            mOnLoadResourceHelper = new OnLoadResourceHelper();
+        }
+
+        public ShouldInterceptRequestHelper getShouldInterceptRequestHelper() {
+            return mShouldInterceptRequestHelper;
+        }
+
+        public OnLoadResourceHelper getOnLoadResourceHelper() {
+            return mOnLoadResourceHelper;
+        }
+    }
+
+    private String addPageToTestServer(TestWebServer webServer, String httpPath, String html) {
+        List<Pair<String, String>> headers = new ArrayList<Pair<String, String>>();
+        headers.add(Pair.create("Content-Type", "text/html"));
+        headers.add(Pair.create("Cache-Control", "no-store"));
+        return webServer.setResponse(httpPath, html, headers);
+    }
+
+    private String addAboutPageToTestServer(TestWebServer webServer) {
+        return addPageToTestServer(webServer, "/" + CommonResources.ABOUT_FILENAME,
+                CommonResources.ABOUT_HTML);
+    }
+
+    private WebResourceResponse stringToWebResourceResponse(String input) throws Throwable {
+        final String mimeType = "text/html";
+        final String encoding = "UTF-8";
+
+        return new WebResourceResponse(
+                mimeType, encoding, new ByteArrayInputStream(input.getBytes(encoding)));
+    }
+
+    private TestWebServer mWebServer;
+    private TestXWalkClient mTestXWalkClient;
+    private TestXWalkClient.ShouldInterceptRequestHelper mShouldInterceptRequestHelper;
+    private TestXWalkClient.OnLoadResourceHelper mOnLoadResourceHelper;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        getInstrumentation().runOnMainSync(new Runnable() {
+            @Override
+            public void run() {
+                mTestXWalkClient = new TestXWalkClient();
+                getXWalkView().setXWalkClient(mTestXWalkClient);
+                mShouldInterceptRequestHelper = mTestXWalkClient.getShouldInterceptRequestHelper();
+                mOnLoadResourceHelper = mTestXWalkClient.getOnLoadResourceHelper();
+            }
+        });
+
+        mWebServer = new TestWebServer(false);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        mWebServer.shutdown();
+        super.tearDown();
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testCalledWithCorrectUrl() throws Throwable {
+        final String aboutPageUrl = addAboutPageToTestServer(mWebServer);
+
+        int callCount = mShouldInterceptRequestHelper.getCallCount();
+        int onPageFinishedCallCount = mTestContentsClient.getOnPageFinishedHelper().getCallCount();
+
+        loadUrlAsync(aboutPageUrl);
+
+        mShouldInterceptRequestHelper.waitForCallback(callCount);
+        assertEquals(1, mShouldInterceptRequestHelper.getUrls().size());
+        assertEquals(aboutPageUrl,
+                mShouldInterceptRequestHelper.getUrls().get(0));
+
+        mTestContentsClient.getOnPageFinishedHelper().waitForCallback(onPageFinishedCallCount);
+        assertEquals(CommonResources.ABOUT_TITLE, getTitleOnUiThread());
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testOnLoadResourceCalledWithCorrectUrl() throws Throwable {
+        final String aboutPageUrl = addAboutPageToTestServer(mWebServer);
+        int callCount = mOnLoadResourceHelper.getCallCount();
+
+        loadUrlAsync(aboutPageUrl);
+
+        mOnLoadResourceHelper.waitForCallback(callCount);
+        assertEquals(aboutPageUrl, mOnLoadResourceHelper.getUrl());
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testDoesNotCrashOnInvalidData() throws Throwable {
+        final String aboutPageUrl = addAboutPageToTestServer(mWebServer);
+
+        mShouldInterceptRequestHelper.setReturnValue(
+                new WebResourceResponse("text/html", "UTF-8", null));
+        int callCount = mShouldInterceptRequestHelper.getCallCount();
+        loadUrlAsync(aboutPageUrl);
+        mShouldInterceptRequestHelper.waitForCallback(callCount);
+
+        mShouldInterceptRequestHelper.setReturnValue(
+                new WebResourceResponse(null, null, new ByteArrayInputStream(new byte[0])));
+        callCount = mShouldInterceptRequestHelper.getCallCount();
+        loadUrlAsync(aboutPageUrl);
+        mShouldInterceptRequestHelper.waitForCallback(callCount);
+
+        mShouldInterceptRequestHelper.setReturnValue(
+                new WebResourceResponse(null, null, null));
+        callCount = mShouldInterceptRequestHelper.getCallCount();
+        loadUrlAsync(aboutPageUrl);
+        mShouldInterceptRequestHelper.waitForCallback(callCount);
+    }
+
+    private static class EmptyInputStream extends InputStream {
+        @Override
+        public int available() {
+            return 0;
+        }
+
+        @Override
+        public int read() throws IOException {
+            return -1;
+        }
+
+        @Override
+        public int read(byte b[]) throws IOException {
+            return -1;
+        }
+
+        @Override
+        public int read(byte b[], int off, int len) throws IOException {
+            return -1;
+        }
+
+        @Override
+        public long skip(long n) throws IOException {
+            if (n < 0)
+                throw new IOException("skipping negative number of bytes");
+            return 0;
+        }
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testDoesNotCrashOnEmptyStream() throws Throwable {
+        final String aboutPageUrl = addAboutPageToTestServer(mWebServer);
+
+        mShouldInterceptRequestHelper.setReturnValue(
+                new WebResourceResponse("text/html", "UTF-8", new EmptyInputStream()));
+        int shouldInterceptRequestCallCount = mShouldInterceptRequestHelper.getCallCount();
+        int onPageFinishedCallCount = mTestContentsClient.getOnPageFinishedHelper().getCallCount();
+
+        loadUrlAsync(aboutPageUrl);
+
+        mShouldInterceptRequestHelper.waitForCallback(shouldInterceptRequestCallCount);
+        mTestContentsClient.getOnPageFinishedHelper().waitForCallback(onPageFinishedCallCount);
+    }
+
+    private static class SlowWebResourceResponse extends WebResourceResponse {
+        private CallbackHelper mReadStartedCallbackHelper = new CallbackHelper();
+        private CountDownLatch mLatch = new CountDownLatch(1);
+
+        public SlowWebResourceResponse(String mimeType, String encoding, InputStream data) {
+            super(mimeType, encoding, data);
+        }
+
+        @Override
+        public InputStream getData() {
+            mReadStartedCallbackHelper.notifyCalled();
+            try {
+                mLatch.await();
+            } catch (InterruptedException e) {
+                // ignore
+            }
+            return super.getData();
+        }
+
+        public void unblockReads() {
+            mLatch.countDown();
+        }
+
+        public CallbackHelper getReadStartedCallbackHelper() {
+            return mReadStartedCallbackHelper;
+        }
+    }
+
+    //@SmallTest
+    //@Feature({"XWalkClientShouldInterceptRequest"})
+    // TODO(gaochun): Enable it once the issue XWALK-1022 gets resolved.
+    @DisabledTest
+    public void testHttpStatusField() throws Throwable {
+        final String syncGetUrl = mWebServer.getResponseUrl("/intercept_me");
+        final String syncGetJs =
+            "(function() {" +
+            "  var xhr = new XMLHttpRequest();" +
+            "  xhr.open('GET', '" + syncGetUrl + "', false);" +
+            "  xhr.send(null);" +
+            "  console.info('xhr.status = ' + xhr.status);" +
+            "  return xhr.status;" +
+            "})();";
+
+        getInstrumentation().runOnMainSync(new Runnable() {
+            @Override
+            public void run() {
+                getXWalkView().getSettings().setJavaScriptEnabled(true);
+            }
+        });
+
+        final String aboutPageUrl = addAboutPageToTestServer(mWebServer);
+        loadUrlSync(aboutPageUrl);
+
+        mShouldInterceptRequestHelper.setReturnValue(
+                new WebResourceResponse("text/html", "UTF-8", null));
+        assertEquals("404", executeJavaScriptAndWaitForResult(syncGetJs));
+
+        mShouldInterceptRequestHelper.setReturnValue(
+                new WebResourceResponse("text/html", "UTF-8", new EmptyInputStream()));
+        assertEquals("200", executeJavaScriptAndWaitForResult(syncGetJs));
+    }
+
+
+    private String makePageWithTitle(String title) {
+        return CommonResources.makeHtmlPageFrom("<title>" + title + "</title>",
+                "<div> The title is: " + title + " </div>");
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testCanInterceptMainFrame() throws Throwable {
+        final String expectedTitle = "testShouldInterceptRequestCanInterceptMainFrame";
+        final String expectedPage = makePageWithTitle(expectedTitle);
+
+        mShouldInterceptRequestHelper.setReturnValue(
+                stringToWebResourceResponse(expectedPage));
+
+        final String aboutPageUrl = addAboutPageToTestServer(mWebServer);
+
+        loadUrlSync(aboutPageUrl);
+
+        assertEquals(expectedTitle, getTitleOnUiThread());
+        assertEquals(0, mWebServer.getRequestCount("/" + CommonResources.ABOUT_FILENAME));
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testDoesNotChangeReportedUrl() throws Throwable {
+        mShouldInterceptRequestHelper.setReturnValue(
+                stringToWebResourceResponse(makePageWithTitle("some title")));
+
+        final String aboutPageUrl = addAboutPageToTestServer(mWebServer);
+
+        loadUrlSync(aboutPageUrl);
+
+        assertEquals(aboutPageUrl, mTestContentsClient.getOnPageFinishedHelper().getUrl());
+        assertEquals(aboutPageUrl, mTestContentsClient.getOnPageStartedHelper().getUrl());
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testNullInputStreamCausesErrorForMainFrame() throws Throwable {
+        final OnReceivedErrorHelper onReceivedErrorHelper = mTestContentsClient.getOnReceivedErrorHelper();
+        mShouldInterceptRequestHelper.setReturnValue(
+                new WebResourceResponse("text/html", "UTF-8", null));
+
+        final String aboutPageUrl = addAboutPageToTestServer(mWebServer);
+        final int callCount = onReceivedErrorHelper.getCallCount();
+        loadUrlAsync(aboutPageUrl);
+        onReceivedErrorHelper.waitForCallback(callCount);
+        assertEquals(0, mWebServer.getRequestCount("/" + CommonResources.ABOUT_FILENAME));
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testCalledForImage() throws Throwable {
+        final String imagePath = "/" + CommonResources.FAVICON_FILENAME;
+        mWebServer.setResponseBase64(imagePath,
+                CommonResources.FAVICON_DATA_BASE64, CommonResources.getImagePngHeaders(true));
+        final String pageWithImage =
+            addPageToTestServer(mWebServer, "/page_with_image.html",
+                    CommonResources.getOnImageLoadedHtml(CommonResources.FAVICON_FILENAME));
+
+        int callCount = mShouldInterceptRequestHelper.getCallCount();
+        loadUrlSync(pageWithImage);
+        mShouldInterceptRequestHelper.waitForCallback(callCount, 2);
+
+        assertEquals(2, mShouldInterceptRequestHelper.getUrls().size());
+        assertTrue(mShouldInterceptRequestHelper.getUrls().get(1).endsWith(
+                CommonResources.FAVICON_FILENAME));
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testOnReceivedErrorCallback() throws Throwable {
+        final OnReceivedErrorHelper onReceivedErrorHelper = mTestContentsClient.getOnReceivedErrorHelper();
+        mShouldInterceptRequestHelper.setReturnValue(new WebResourceResponse(null, null, null));
+        int onReceivedErrorHelperCallCount = onReceivedErrorHelper.getCallCount();
+        loadUrlSync("foo://bar");
+        onReceivedErrorHelper.waitForCallback(onReceivedErrorHelperCallCount, 1);
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testNoOnReceivedErrorCallback() throws Throwable {
+        final String imagePath = "/" + CommonResources.FAVICON_FILENAME;
+        final String imageUrl = mWebServer.setResponseBase64(imagePath,
+                CommonResources.FAVICON_DATA_BASE64, CommonResources.getImagePngHeaders(true));
+        final String pageWithImage =
+                addPageToTestServer(mWebServer, "/page_with_image.html",
+                        CommonResources.getOnImageLoadedHtml(CommonResources.FAVICON_FILENAME));
+        final OnReceivedErrorHelper onReceivedErrorHelper = mTestContentsClient.getOnReceivedErrorHelper();
+        mShouldInterceptRequestHelper.setReturnValueForUrl(
+                imageUrl, new WebResourceResponse(null, null, null));
+        int onReceivedErrorHelperCallCount = onReceivedErrorHelper.getCallCount();
+        loadUrlSync(pageWithImage);
+        assertEquals(onReceivedErrorHelperCallCount, onReceivedErrorHelper.getCallCount());
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testCalledForIframe() throws Throwable {
+        final String aboutPageUrl = addAboutPageToTestServer(mWebServer);
+        final String pageWithIframe = addPageToTestServer(mWebServer, "/page_with_iframe.html",
+                CommonResources.makeHtmlPageFrom("",
+                    "<iframe src=\"" + aboutPageUrl + "\"/>"));
+
+        int callCount = mShouldInterceptRequestHelper.getCallCount();
+        // These callbacks can race with favicon.ico callback.
+        mShouldInterceptRequestHelper.setUrlToWaitFor(aboutPageUrl);
+        loadUrlSync(pageWithIframe);
+
+        mShouldInterceptRequestHelper.waitForCallback(callCount, 1);
+        assertEquals(1, mShouldInterceptRequestHelper.getUrls().size());
+        assertEquals(aboutPageUrl, mShouldInterceptRequestHelper.getUrls().get(0));
+    }
+
+    private void calledForUrlTemplate(final String url) throws Exception {
+        int callCount = mShouldInterceptRequestHelper.getCallCount();
+        int onPageStartedCallCount = mTestContentsClient.getOnPageStartedHelper().getCallCount();
+        loadUrlAsync(url);
+        mShouldInterceptRequestHelper.waitForCallback(callCount);
+        assertEquals(url, mShouldInterceptRequestHelper.getUrls().get(0));
+
+        mTestContentsClient.getOnPageStartedHelper().waitForCallback(onPageStartedCallCount);
+        assertEquals(onPageStartedCallCount + 1,
+                mTestContentsClient.getOnPageStartedHelper().getCallCount());
+    }
+
+    private void notCalledForUrlTemplate(final String url) throws Exception {
+        int callCount = mShouldInterceptRequestHelper.getCallCount();
+        loadUrlSync(url);
+        // The intercepting must happen before onPageFinished. Since the IPC messages from the
+        // renderer should be delivered in order waiting for onPageFinished is sufficient to
+        // 'flush' any pending interception messages.
+        assertEquals(callCount, mShouldInterceptRequestHelper.getCallCount());
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testCalledForUnsupportedSchemes() throws Throwable {
+        calledForUrlTemplate("foobar://resource/1");
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testCalledForNonexistentFiles() throws Throwable {
+        calledForUrlTemplate("file:///somewhere/something");
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testCalledForExistingFiles() throws Throwable {
+        final String tmpDir = getInstrumentation().getTargetContext().getCacheDir().getPath();
+        final String fileName = tmpDir + "/testfile.html";
+        final String title = "existing file title";
+        TestFileUtil.deleteFile(fileName);  // Remove leftover file if any.
+        TestFileUtil.createNewHtmlFile(fileName, title, "");
+        final String existingFileUrl = "file://" + fileName;
+
+        int callCount = mShouldInterceptRequestHelper.getCallCount();
+        int onPageFinishedCallCount = mTestContentsClient.getOnPageFinishedHelper().getCallCount();
+        loadUrlAsync(existingFileUrl);
+        mShouldInterceptRequestHelper.waitForCallback(callCount);
+        assertEquals(existingFileUrl, mShouldInterceptRequestHelper.getUrls().get(0));
+
+        mTestContentsClient.getOnPageFinishedHelper().waitForCallback(onPageFinishedCallCount);
+        assertEquals(title, getTitleOnUiThread());
+        assertEquals(onPageFinishedCallCount + 1,
+                mTestContentsClient.getOnPageFinishedHelper().getCallCount());
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testNotCalledForExistingResource() throws Throwable {
+        notCalledForUrlTemplate("file:///android_res/raw/resource_file.html");
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testCalledForNonexistentResource() throws Throwable {
+        calledForUrlTemplate("file:///android_res/raw/no_file.html");
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testNotCalledForExistingAsset() throws Throwable {
+        notCalledForUrlTemplate("file:///android_asset/www/index.html");
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testCalledForNonexistentAsset() throws Throwable {
+        calledForUrlTemplate("file:///android_res/raw/no_file.html");
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testNotCalledForExistingContentUrl() throws Throwable {
+        final String contentResourceName = "target";
+        final String existingContentUrl = TestContentProvider.createContentUrl(contentResourceName);
+        TestContentProvider.resetResourceRequestCount(
+                getInstrumentation().getTargetContext(), contentResourceName);
+
+        notCalledForUrlTemplate(existingContentUrl);
+
+        int contentRequestCount = TestContentProvider.getResourceRequestCount(
+                getInstrumentation().getTargetContext(), contentResourceName);
+        assertEquals(1, contentRequestCount);
+    }
+
+    @SmallTest
+    @Feature({"XWalkClientShouldInterceptRequest"})
+    public void testCalledForNonexistentContentUrl() throws Throwable {
+        calledForUrlTemplate("content://org.xwalk.core.test.NoSuchProvider/foo");
+    }
+}
index b9601cd..071ee02 100644 (file)
@@ -6,7 +6,6 @@ Crosswalk Sample Application
 </head>
 <body>
 <div style="text-align:center;margin:100">
-<img src='sampapp-icon-helloworld.png'/>
 </div>
 <div style="text-align:center;margin:50;font-size:64;font-weight:bold">
 Welcome to Crosswalk
index aba3638..27f6702 100644 (file)
@@ -14,7 +14,7 @@
             android:authorities="org.xwalk.runtime.test.TestContentProvider" />
     </application>
 
-    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
     <instrumentation android:name="android.test.InstrumentationTestRunner"
         android:targetPackage="org.xwalk.runtime.shell"
         android:label="Test for org.xwalk.runtime" />
index 75ab530..f8f6836 100644 (file)
@@ -14,7 +14,7 @@
             android:authorities="org.xwalk.runtime.client.test.TestContentProvider" />
     </application>
 
-    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
     <instrumentation android:name="android.test.InstrumentationTestRunner"
         android:targetPackage="org.xwalk.runtime.client.shell"
         android:label="Test for org.xwalk.runtime.client" />
index 0ce8242..dca0ae9 100644 (file)
@@ -14,7 +14,7 @@
             android:authorities="org.xwalk.runtime.client.embedded.test.TestContentProvider" />
     </application>
 
-    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
     <instrumentation android:name="android.test.InstrumentationTestRunner"
         android:targetPackage="org.xwalk.runtime.client.embedded.shell"
         android:label="Test for org.xwalk.runtime.client.embedded" />
index 9cfb8ab..abb6d4c 100644 (file)
@@ -52,12 +52,20 @@ base::LazyInstance<XWalkContentRendererClient>::Leaky
 
 }  // namespace
 
+RuntimeRegistry::RuntimeRegistry() {
+}
+
 RuntimeRegistry::~RuntimeRegistry() {
 }
 
 void RuntimeRegistry::CloseAll() {
+  if (runtimes_.empty())
+    return;
+
   RuntimeList cached(runtimes_);
   std::for_each(cached.begin(), cached.end(), std::mem_fun(&Runtime::Close));
+  // Wait until all windows are closed.
+  content::RunAllPendingInMessageLoop();
   DCHECK(runtimes_.empty()) << runtimes_.size();
 }
 
@@ -147,10 +155,7 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() {
 
   // Invoke cleanup and quit even if there are failures. This is similar to
   // gtest in that it invokes TearDown even if Setup fails.
-  CleanUpOnMainThread();
-  // Sometimes tests leave Quit tasks in the MessageLoop (for shame), so let's
-  // run all pending messages here to avoid preempting the QuitBrowsers tasks.
-  content::RunAllPendingInMessageLoop();
+  ProperMainThreadCleanup();
 
   runtime_registry_->CloseAll();
 }
index de8f535..3496dd8 100644 (file)
@@ -30,7 +30,7 @@ class RuleBasedHostResolverProc;
 class RuntimeRegistry : public xwalk::Runtime::Observer {
  public:
   typedef std::vector<xwalk::Runtime*> RuntimeList;
-
+  RuntimeRegistry();
   virtual ~RuntimeRegistry();
 
   void CloseAll();
@@ -70,7 +70,7 @@ class InProcessBrowserTest : public content::BrowserTestBase {
 
   // Override this to add any custom cleanup code that needs to be done on the
   // main thread before the browser is torn down.
-  virtual void CleanUpOnMainThread() {}
+  virtual void ProperMainThreadCleanup() {}
 
   // BrowserTestBase:
   virtual void RunTestOnMainThreadLoop() OVERRIDE;
index 45c9740..2d1af97 100644 (file)
@@ -66,11 +66,8 @@ void NavigateToURL(xwalk::Runtime* runtime, const GURL& url) {
   if (runtime->web_contents()->IsLoading())
     content::WaitForLoadStop(runtime->web_contents());
 
-  TestNavigationObserver navigation_observer(runtime->web_contents(), 1);
   runtime->LoadURL(url);
-
-  base::RunLoop run_loop;
-  navigation_observer.Wait();
+  content::WaitForLoadStop(runtime->web_contents());
 }
 
 }  // namespace xwalk_test_utils
diff --git a/src/xwalk/tizen/appcore_context.cc b/src/xwalk/tizen/appcore_context.cc
deleted file mode 100755 (executable)
index b387a85..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-// Copyright (c) 2013 Intel Corporation. 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/tizen/appcore_context.h"
-
-#include <appcore-common.h>
-#include <aul.h>
-#include <malloc.h>
-#include <tizen.h>
-#include "base/logging.h"
-#include "base/message_loop/message_loop.h"
-
-// AppcoreContextImpl uses private Tizen appcore API to reuse Tizen 2.0
-// implementation.
-// This private implementation of appcore is a bit huge. We will decide later
-// whether to maintain the code similar to appcore private implementation
-// in Crosswalk or not after investigating appcore in Tizen 3.0.
-extern "C" {
-// define in app.h
-int app_get_id(char** id);
-
-// define in app_private.h
-int app_get_package_app_name(const char* package, char** name);
-void app_finalizer_execute(void);
-
-// define in status.c
-int aul_status_update(int status);
-
-// define in appcore-internal.h
-enum app_event {
-  AE_UNKNOWN,
-  AE_CREATE,
-  AE_TERMINATE,
-  AE_PAUSE,
-  AE_RESUME,
-  AE_RESET,
-  AE_LOWMEM_POST,
-  AE_MEM_FLUSH,
-  AE_MAX
-};
-
-struct ui_ops {
-  void* data;
-  void (*cb_app)(enum app_event evnt, void* data, bundle*);
-};
-}
-
-namespace tizen {
-
-// FIXME: this implementation is not compatible with shared process mode,
-// because Tizen task switcher cannot recognize multiple tasks per process.
-// Shared process mode requires one Crosswalk process to include multiple tasks
-// (= web applications). It is not supported by current task switcher.
-class AppcoreContextImpl
-    : public AppcoreContext {
- public:
-  AppcoreContextImpl();
-  virtual ~AppcoreContextImpl();
-
-  bool Initialize();
-
- private:
-  static void HandleAppcoreEvents(enum app_event, void*, bundle*);
-  void HandleAppcoreEventsInternal(enum app_event, bundle*);
-
-  char* package_;
-  char* application_name_;
-  bool initialized_;
-  struct ui_ops appcore_operations_;
-
-  DISALLOW_COPY_AND_ASSIGN(AppcoreContextImpl);
-};
-
-scoped_ptr<AppcoreContext> AppcoreContext::Create() {
-  scoped_ptr<AppcoreContextImpl> context(new AppcoreContextImpl());
-  if (context->Initialize())
-    return context.PassAs<AppcoreContext>();
-  return scoped_ptr<AppcoreContext>();
-}
-
-AppcoreContextImpl::AppcoreContextImpl()
-    : package_(NULL),
-      application_name_(NULL),
-      initialized_(false) {
-  appcore_operations_.data = this;
-  appcore_operations_.cb_app = HandleAppcoreEvents;
-}
-
-AppcoreContextImpl::~AppcoreContextImpl() {
-  if (initialized_) {
-    app_finalizer_execute();
-    aul_status_update(STATUS_DYING);
-    appcore_exit();
-    DCHECK(package_ && application_name_);
-  }
-
-  // app_get_id() and app_get_package_app_name() allocated them using malloc.
-  free(package_);
-  free(application_name_);
-}
-
-bool AppcoreContextImpl::Initialize() {
-  if (app_get_id(&package_) != TIZEN_ERROR_NONE) {
-    LOG(ERROR) << "Failed to get the package: " << package_;
-    return false;
-  }
-
-  if (app_get_package_app_name(package_, &application_name_) !=
-      TIZEN_ERROR_NONE) {
-    LOG(ERROR) << "Failed to get the package's application name: "
-               << application_name_;
-    return false;
-  }
-
-  DCHECK(application_name_ && application_name_[0] != '\0');
-  char* argv[2] = {'\0', };
-  int r = appcore_init(application_name_, &appcore_operations_, 1, argv);
-  if (r == -1) {
-    LOG(ERROR) << "Failed to initialize appcore. application name: "
-               << application_name_;
-    return false;
-  }
-
-  initialized_ = true;
-  return true;
-}
-
-
-void AppcoreContextImpl::HandleAppcoreEvents(enum app_event event,
-                                                  void* data,
-                                                  bundle* b) {
-  static_cast<AppcoreContextImpl*>(data)->
-      HandleAppcoreEventsInternal(event, b);
-}
-
-void AppcoreContextImpl::HandleAppcoreEventsInternal(enum app_event event,
-                                                          bundle* b) {
-  DCHECK(initialized_);
-  if (event >= AE_MAX)
-    return;
-
-  switch (event) {
-    case AE_TERMINATE:
-      LOG(INFO) << "[XWalk " << getpid() <<"] TERMINATE";
-      base::MessageLoop::current()->QuitNow();
-      break;
-    default:
-      break;
-  }
-}
-
-}  // namespace tizen
-
diff --git a/src/xwalk/tizen/appcore_context.h b/src/xwalk/tizen/appcore_context.h
deleted file mode 100755 (executable)
index f7f87aa..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2013 Intel Corporation. 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_TIZEN_APPCORE_CONTEXT_H_
-#define XWALK_TIZEN_APPCORE_CONTEXT_H_
-
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-
-namespace tizen {
-
-// AppcoreContext makes Tizen task switcher be able to control xwalk.
-class AppcoreContext {
- public:
-  static scoped_ptr<AppcoreContext> Create();
-  virtual ~AppcoreContext() {}
-};
-
-}  // namespace tizen
-
-#endif  // XWALK_TIZEN_APPCORE_CONTEXT_H_
index 9d9cd1d..c35cc23 100644 (file)
@@ -5,15 +5,13 @@
     'type': 'static_library',
     'dependencies': [
       '../../skia/skia.gyp:skia',
-      '../build/system.gyp:tizen_appcore',
+      '../build/system.gyp:tizen_sensor',
       '../build/system.gyp:tizen_vibration',
     ],
     'include_dirs': [
       '../..',
     ],
     'sources': [
-      'appcore_context.cc',
-      'appcore_context.h',
       'mobile/sensor/sensor_provider.cc',
       'mobile/sensor/sensor_provider.h',
       'mobile/sensor/tizen_data_fetcher_shared_memory.cc',
index 9f43168..604c0b4 100755 (executable)
@@ -54,7 +54,8 @@ class DepsFetcher(object):
 
   def DoGclientSyncForChromium(self):
     gclient_cmd = ['gclient', 'sync', '--verbose', '--reset',
-                   '--force', '--with_branch_heads']
+                   '--force', '--with_branch_heads',
+                   '--delete_unversioned_trees']
     gclient_cmd.append('--gclientfile=%s' %
                        os.path.basename(self._new_gclient_file))
     gclient_utils.CheckCallAndFilterAndHeader(gclient_cmd,
index dd765c7..1d2e5a1 100644 (file)
@@ -40,7 +40,7 @@
         'xwalk_core_extensions_java',
       ],
       'variables': {
-        'java_in_dir': 'runtime/android/java',
+        'java_in_dir': 'runtime/android/core',
         'has_java_resources': 1,
         'R_package': 'org.xwalk.core',
         'R_package_relpath': 'org/xwalk/core',
       'includes': ['../build/java.gypi'],
     },
     {
+      'target_name': 'xwalk_runtime_java',
+      'type': 'none',
+      'dependencies': [
+        'xwalk_core_java',
+      ],
+      'variables': {
+        'java_in_dir': 'runtime/android/runtime',
+        'has_java_resources': 0,
+      },
+      'includes': ['../build/java.gypi'],
+    },
+    {
       # Use the NativeLibraries.class generated by runtime lib.
-      # It's generated as a '.jar' file used by xwalk_core_embedded.
+      # It's generated as a '.jar' file used by xwalk_runtime_embedded.
       'target_name': 'xwalk_native_libraries_java',
       'type': 'none',
       'dependencies': [
       ],
     },
     {
-      'target_name': 'xwalk_core_embedded',
+      'target_name': 'xwalk_runtime_embedded',
       'type': 'none',
       'dependencies': [
         'xwalk_core_java',
       ],
       'actions': [
         {
-          'action_name': 'xwalk_core_embedded',
+          'action_name': 'xwalk_runtime_embedded',
           'variables': {
             'dex_input_paths': [
               '<(PRODUCT_DIR)/lib.java/base_java.dex.jar',
               '<(PRODUCT_DIR)/lib.java/web_contents_delegate_android_java.dex.jar',
               '<(PRODUCT_DIR)/lib.java/xwalk_core_extensions_java.dex.jar',
               '<(PRODUCT_DIR)/lib.java/xwalk_core_java.dex.jar',
+              '<(PRODUCT_DIR)/lib.java/xwalk_runtime_java.dex.jar',
               '<(SHARED_INTERMEDIATE_DIR)/xwalk_native_libraries/'
                   'xwalk_native_libraries.jar' ],
-            'output_path': '<(PRODUCT_DIR)/lib.java/xwalk_core_embedded.dex.jar',
+            'output_path': '<(PRODUCT_DIR)/lib.java/xwalk_runtime_embedded.dex.jar',
           },
           'includes': [ '../build/android/dex_action.gypi' ],
         },
         'jni_gen_package': 'xwalk',
       },
       'sources': [
-        'runtime/android/java/src/org/xwalk/core/AndroidProtocolHandler.java',
-        'runtime/android/java/src/org/xwalk/core/InterceptedRequestData.java',
-        'runtime/android/java/src/org/xwalk/core/XWalkHttpAuthHandler.java',
-        'runtime/android/java/src/org/xwalk/core/XWalkContentsClientBridge.java',
-        'runtime/android/java/src/org/xwalk/core/XWalkContentsIoThreadClient.java',
-        'runtime/android/java/src/org/xwalk/core/XWalkContent.java',
-        'runtime/android/java/src/org/xwalk/core/XWalkCookieManager.java',
-        'runtime/android/java/src/org/xwalk/core/XWalkDevToolsServer.java',
-        'runtime/android/java/src/org/xwalk/core/XWalkSettings.java',
-        'runtime/android/java/src/org/xwalk/core/XWalkWebContentsDelegate.java',
+        'runtime/android/core/src/org/xwalk/core/AndroidProtocolHandler.java',
+        'runtime/android/core/src/org/xwalk/core/InterceptedRequestData.java',
+        'runtime/android/core/src/org/xwalk/core/XWalkHttpAuthHandler.java',
+        'runtime/android/core/src/org/xwalk/core/XWalkContentsClientBridge.java',
+        'runtime/android/core/src/org/xwalk/core/XWalkContentsIoThreadClient.java',
+        'runtime/android/core/src/org/xwalk/core/XWalkContent.java',
+        'runtime/android/core/src/org/xwalk/core/XWalkCookieManager.java',
+        'runtime/android/core/src/org/xwalk/core/XWalkDevToolsServer.java',
+        'runtime/android/core/src/org/xwalk/core/XWalkSettings.java',
+        'runtime/android/core/src/org/xwalk/core/XWalkWebContentsDelegate.java',
       ],
       'includes': ['../build/jni_generator.gypi'],
     },
       'dependencies': [
         'libxwalkcore',
         'xwalk_core_extensions_java',
-        # Runtime code is also built by this target.
-        'xwalk_core_java',
+        'xwalk_runtime_java',
         'xwalk_runtime_lib_apk_extension',
         'xwalk_runtime_lib_apk_pak',
       ],
       'variables': {
         'apk_name': 'XWalkRuntimeLib',
-        'java_in_dir': 'runtime/android/runtimelib',
-        'resource_dir': 'runtime/android/runtimelib/res',
+        'java_in_dir': 'runtime/android/runtime_lib',
+        'resource_dir': 'runtime/android/runtime_lib/res',
         'native_lib_target': 'libxwalkcore',
         'additional_input_paths': [
           '<(PRODUCT_DIR)/xwalk_runtime_lib/assets/jsapi/contacts_api.js',
           'files': [
             'experimental/launch_screen/launch_screen_api.js',
             'experimental/presentation/presentation_api.js',
-            'runtime/android/java/src/org/xwalk/runtime/extension/api/contacts/contacts_api.js',
-            'runtime/android/java/src/org/xwalk/runtime/extension/api/device_capabilities/device_capabilities_api.js',
-            'runtime/android/java/src/org/xwalk/runtime/extension/api/messaging/messaging_api.js',
+            'runtime/android/core/src/org/xwalk/core/extension/api/contacts/contacts_api.js',
+            'runtime/android/core/src/org/xwalk/core/extension/api/device_capabilities/device_capabilities_api.js',
+            'runtime/android/core/src/org/xwalk/core/extension/api/messaging/messaging_api.js',
             'runtime/extension/screen_orientation_api.js',
           ],
         },
index ce0d78c..73c7578 100644 (file)
       'dependencies': [
         'xwalk_app_runtime_java',
         'xwalk_app_template_apk',
-        'xwalk_core_embedded',
+        'xwalk_runtime_embedded',
         'xwalk_runtime_lib_apk',
       ],
       'actions': [
index d021775..8487c3f 100644 (file)
       'type': 'none',
       'dependencies': [
         'libxwalkcore',
-        'xwalk_core_extensions_java',
         # Runtime code is also built by this target.
-        'xwalk_core_java',
+        'xwalk_runtime_java',
         'xwalk_runtime_shell_apk_pak',
       ],
       'variables': {
         'libxwalkcore',
         'xwalk_app_runtime_client_java',
         'xwalk_app_runtime_activity_java',
-        'xwalk_core_java',
+        'xwalk_runtime_java',
         'xwalk_runtime_client_embedded_shell_apk_pak',
         'xwalk_runtime_client_test_utils_java',
       ],