Upstream version 7.35.141.0 79/21679/1
authorEurogiciel-BOT <eurogiciel.tizen@gmail.com>
Thu, 22 May 2014 17:57:12 +0000 (17:57 +0000)
committerEurogiciel-BOT <eurogiciel.tizen@gmail.com>
Thu, 22 May 2014 17:57:12 +0000 (17:57 +0000)
Upstream commit-id c5788f3264fa300c1ec82a465bf8461f88c9fa34

Change-Id: I49c331816dc92ea2b5d743bdb08131e4367af5f4
Signed-off-by: Eurogiciel-BOT <eurogiciel.tizen@gmail.com>
32 files changed:
packaging/crosswalk.spec
src/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
src/xwalk/DEPS.xwalk
src/xwalk/VERSION
src/xwalk/app/tools/android/customize.py
src/xwalk/app/tools/android/customize_launch_screen.py
src/xwalk/application/browser/application.cc
src/xwalk/application/browser/application_protocols.cc
src/xwalk/application/browser/application_service.cc
src/xwalk/application/browser/application_tizen.cc
src/xwalk/application/browser/installer/package.h
src/xwalk/application/browser/installer/wgt_package.cc
src/xwalk/application/browser/installer/xpk_package.cc
src/xwalk/application/common/application_data.cc
src/xwalk/application/common/application_data.h
src/xwalk/application/common/application_file_util.cc
src/xwalk/application/common/application_file_util.h
src/xwalk/application/common/application_manifest_constants.cc
src/xwalk/application/common/application_manifest_constants.h
src/xwalk/application/common/manifest.cc
src/xwalk/application/common/manifest.h
src/xwalk/application/common/manifest_handler.cc
src/xwalk/application/common/manifest_handler.h
src/xwalk/application/common/manifest_handler_unittest.cc
src/xwalk/application/common/manifest_handlers/csp_handler.cc
src/xwalk/application/common/manifest_handlers/csp_handler.h
src/xwalk/application/common/manifest_handlers/warp_handler_unittest.cc
src/xwalk/application/common/manifest_handlers/widget_handler.cc
src/xwalk/application/common/manifest_handlers/widget_handler_unittest.cc
src/xwalk/application/extension/application_widget_api.js
src/xwalk/packaging/crosswalk.spec
src/xwalk/runtime/browser/xwalk_browser_main_parts.cc

index 0175610..95cab71 100644 (file)
@@ -12,7 +12,7 @@
 %endif
 
 Name:           crosswalk
-Version:        7.35.139.0
+Version:        7.35.141.0
 Release:        0
 Summary:        Crosswalk is an app runtime based on Chromium
 License:        (BSD-3-Clause and LGPL-2.1+)
index 422f5ab..42f853c 100644 (file)
@@ -108,7 +108,7 @@ SpeechSynthesis status=stable
 Srcset status=stable
 Stream status=experimental
 StyleScoped status=experimental
-SubpixelFontScaling status=experimental
+SubpixelFontScaling status=stable
 SubresourceIntegrity status=test
 SVGPaintOrder status=stable
 
index f050240..a7eca55 100644 (file)
@@ -8,7 +8,7 @@
 # If using trunk, will use '.DEPS.git' for gclient.
 chromium_version = '35.0.1916.114'
 chromium_crosswalk_point = 'e76fa1eeaea6745b72a693cf746e5d3d8ece1bef'
-blink_crosswalk_point = 'daeb6d961b90b90572c916653e86ce91a59daa0b'
+blink_crosswalk_point = '3cf743afc1a77a1141f08897c4f2c3b805124f25'
 v8_crosswalk_point = '64b8b78dee87a9d465f9d095e2021bdb9d45d37d'
 ozone_wayland_point = 'f4faec532d7d2f482b3ffe1e52be6fa3e6fc8629'
 
index 85a3369..7068d33 100644 (file)
@@ -1,4 +1,4 @@
 MAJOR=7
 MINOR=35
-BUILD=139
+BUILD=141
 PATCH=0
index 416378c..d2cc6de 100755 (executable)
@@ -161,7 +161,7 @@ def CustomizeThemeXML(name, fullscreen, app_manifest):
     EditElementValueByNodeName(theme_xmldoc, 'item',
                                'android:windowBackground',
                                '@drawable/launchscreen_bg')
-  theme_file = open(theme_path, 'wb')
+  theme_file = open(theme_path, 'w')
   theme_xmldoc.writexml(theme_file, encoding='utf-8')
   theme_file.close()
 
index b44f180..4626b77 100755 (executable)
@@ -64,11 +64,11 @@ def CopyDrawables(image_dict, orientation, sanitized_name, name, app_root):
   # If no supported images found, find the closest one as 1x.
   if not has_image:
     closest = ''
-    delta = sys.maxint
+    delta = sys.maxsize
     for(k, v) in image_dict.items():
       items = k.split('x')
       if len(items) == 2:
-        float_value = sys.maxint
+        float_value = sys.maxsize
         try:
           float_value = float(items[0])
         except ValueError:
index f6c4b6f..ead1f35 100644 (file)
@@ -156,7 +156,7 @@ GURL Application::GetURLFromRelativePathKey(const std::string& key) {
   std::string entry_page;
   if (!manifest->GetString(key, &entry_page)
       || entry_page.empty()) {
-    if (data_->GetPackageType() == Manifest::TYPE_XPK)
+    if (data_->GetPackageType() == Package::XPK)
       return GURL();
 
     base::FileEnumerator iter(data_->Path(), true,
@@ -322,7 +322,7 @@ bool Application::SetPermission(PermissionType type,
 }
 
 void Application::InitSecurityPolicy() {
-  if (data_->GetPackageType() != Manifest::TYPE_WGT)
+  if (data_->GetPackageType() != Package::WGT)
     return;
 
   const WARPInfo* info = static_cast<WARPInfo*>(
@@ -375,7 +375,7 @@ bool Application::CanRequestURL(const GURL& url) const {
     return true;
 
   // Only WGT package need to check the url request permission.
-  if (data_->GetPackageType() != Manifest::TYPE_WGT)
+  if (data_->GetPackageType() != Package::WGT)
     return true;
 
   // Always can request itself resources.
index 6302a3d..be917ca 100644 (file)
@@ -260,7 +260,7 @@ ApplicationProtocolHandler::MaybeCreateJob(
   const std::string& path = request->url().path();
 
   std::list<std::string> locales;
-  if (application && application->GetPackageType() == Manifest::TYPE_WGT) {
+  if (application && application->GetPackageType() == Package::WGT) {
     GetUserAgentLocales(
         xwalk::XWalkRunner::GetInstance()->GetLocale(), locales);
     GetUserAgentLocales(application->GetManifest()->default_locale(), locales);
index f4cdcb8..c0395c5 100644 (file)
@@ -107,7 +107,8 @@ bool ApplicationService::Install(const base::FilePath& path, std::string* id) {
 
   std::string error;
   scoped_refptr<ApplicationData> application_data = LoadApplication(
-      unpacked_dir, app_id, Manifest::COMMAND_LINE, &error);
+      unpacked_dir, app_id, Manifest::COMMAND_LINE,
+      package->type(), &error);
   if (!application_data) {
     LOG(ERROR) << "Error during application installation: " << error;
     return false;
@@ -208,6 +209,7 @@ bool ApplicationService::Update(const std::string& id,
       LoadApplication(unpacked_dir,
                       app_id,
                       Manifest::COMMAND_LINE,
+                      package->type(),
                       &error);
   if (!new_application) {
     LOG(ERROR) << "An error occurred during application updating: " << error;
@@ -245,6 +247,7 @@ bool ApplicationService::Update(const std::string& id,
   new_application = LoadApplication(app_dir,
                                     app_id,
                                     Manifest::COMMAND_LINE,
+                                    package->type(),
                                     &error);
   if (!new_application) {
     LOG(ERROR) << "Error during loading new package: " << error;
index c77f894..5c14fe6 100644 (file)
@@ -70,7 +70,7 @@ void ApplicationTizen::InitSecurityPolicy() {
     return;
   }
 
-  if (data_->GetPackageType() != Manifest::TYPE_WGT)
+  if (data_->GetPackageType() != Package::WGT)
     return;
 
   // Always enable security mode when under CSP mode.
index c946844..d78aa82 100644 (file)
@@ -22,14 +22,21 @@ namespace application {
 //  XPKPackage::Validate()
 class Package {
  public:
+  enum Type {
+    WGT,
+    XPK
+  };
+
   virtual ~Package();
   bool IsValid() const { return is_valid_; }
   const std::string& Id() const { return id_; }
+  Type type() const { return type_; }
   // Factory method for creating a package
   static scoped_ptr<Package> Create(const base::FilePath& path);
   // The function will unzip the XPK/WGT file and return the target path where
   // to decompress by the parameter |target_path|.
   virtual bool Extract(base::FilePath* target_path);
+
  protected:
   explicit Package(const base::FilePath& source_path);
   scoped_ptr<ScopedStdioHandle> file_;
@@ -42,6 +49,7 @@ class Package {
   base::ScopedTempDir temp_dir_;
   // Represent if the package has been extracted.
   bool is_extracted_;
+  Type type_;
 };
 
 }  // namespace application
index 9ce643d..729bd3b 100644 (file)
@@ -25,6 +25,7 @@ WGTPackage::WGTPackage(const base::FilePath& path)
   : Package(path) {
   if (!base::PathExists(path))
     return;
+  type_ = WGT;
   base::FilePath extracted_path;
   if (!Extract(&extracted_path))
     return;
index 7c084ac..b95aaeb 100644 (file)
@@ -25,6 +25,7 @@ XPKPackage::XPKPackage(const base::FilePath& path)
   : Package(path) {
   if (!base::PathExists(path))
     return;
+  type_ = XPK;
   scoped_ptr<ScopedStdioHandle> file(
       new ScopedStdioHandle(base::OpenFile(path, "rb")));
   file_ = file.Pass();
index 4f8f289..fbe69fb 100644 (file)
@@ -151,10 +151,6 @@ bool ApplicationData::IsHostedApp() const {
   return GetManifest()->IsHosted();
 }
 
-Manifest::PackageType ApplicationData::GetPackageType() const {
-  return manifest_->GetPackageType();
-}
-
 // static
 bool ApplicationData::InitApplicationID(xwalk::application::Manifest* manifest,
                                 const base::FilePath& path,
@@ -197,6 +193,10 @@ ApplicationData::ApplicationData(const base::FilePath& path,
       finished_parsing_manifest_(false) {
   DCHECK(path.empty() || path.IsAbsolute());
   path_ = path;
+  if (manifest_->HasPath(widget_keys::kWidgetKey))
+    package_type_ = Package::WGT;
+  else
+    package_type_ = Package::XPK;
 }
 
 ApplicationData::~ApplicationData() {
@@ -255,7 +255,7 @@ bool ApplicationData::LoadName(base::string16* error) {
   std::string name_key(GetNameKey(GetPackageType()));
 
   if (!manifest_->GetString(name_key, &localized_name) &&
-      manifest_->IsXPKPackaged()) {
+      package_type_ == Package::XPK) {
     *error = base::ASCIIToUTF16(errors::kInvalidName);
     return false;
   }
@@ -271,12 +271,12 @@ bool ApplicationData::LoadVersion(base::string16* error) {
   std::string version_key(GetVersionKey(GetPackageType()));
 
   if (!manifest_->GetString(version_key, &version_str) &&
-      manifest_->IsXPKPackaged()) {
+      package_type_ == Package::XPK) {
     *error = base::ASCIIToUTF16(errors::kInvalidVersion);
     return false;
   }
   version_.reset(new base::Version(version_str));
-  if (manifest_->IsXPKPackaged() &&
+  if (package_type_ == Package::XPK &&
       (!version_->IsValid() || version_->components().size() > 4)) {
     *error = base::ASCIIToUTF16(errors::kInvalidVersion);
     return false;
@@ -288,7 +288,7 @@ bool ApplicationData::LoadDescription(base::string16* error) {
   DCHECK(error);
   if (manifest_->HasKey(keys::kDescriptionKey) &&
       !manifest_->GetString(keys::kDescriptionKey, &description_) &&
-      manifest_->IsXPKPackaged()) {
+      package_type_ == Package::XPK) {
     *error = base::ASCIIToUTF16(errors::kInvalidDescription);
     return false;
   }
@@ -303,7 +303,7 @@ bool ApplicationData::LoadManifestVersion(base::string16* error) {
     int manifest_version = 1;
     if (!manifest_->GetInteger(keys::kManifestVersionKey, &manifest_version) ||
         manifest_version < 1) {
-      if (manifest_->IsXPKPackaged()) {
+      if (package_type_ == Package::XPK) {
         *error = base::ASCIIToUTF16(errors::kInvalidManifestVersion);
         return false;
       }
index 1f1fd00..e00216a 100644 (file)
@@ -131,7 +131,7 @@ class ApplicationData : public base::RefCountedThreadSafe<ApplicationData> {
   void ClearPermissions();
   PermissionSet GetManifestPermissions() const;
 
-  Manifest::PackageType GetPackageType() const;
+  Package::Type GetPackageType() const { return package_type_; }
 
 #if defined(OS_TIZEN)
   bool HasCSPDefined() const;
@@ -223,6 +223,9 @@ class ApplicationData : public base::RefCountedThreadSafe<ApplicationData> {
   // Application's persistent permissions.
   StoredPermissionMap permission_map_;
 
+  // The package type, wgt or xpk.
+  Package::Type package_type_;
+
   DISALLOW_COPY_AND_ASSIGN(ApplicationData);
 };
 
index 798c911..9b8b00f 100644 (file)
@@ -25,6 +25,7 @@
 #include "net/base/file_stream.h"
 #include "third_party/libxml/src/include/libxml/tree.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "xwalk/application/browser/installer/package.h"
 #include "xwalk/application/common/application_data.h"
 #include "xwalk/application/common/application_manifest_constants.h"
 #include "xwalk/application/common/constants.h"
@@ -151,6 +152,27 @@ inline bool IsElementSupportSpanAndDir(xmlNode* root) {
   return false;
 }
 
+bool GetPackageType(const base::FilePath& path,
+                    xwalk::application::Package::Type* package_type,
+                    std::string* error) {
+  base::FilePath manifest_path;
+
+  manifest_path = path.Append(xwalk::application::kManifestXpkFilename);
+  if (base::PathExists(manifest_path)) {
+    *package_type = xwalk::application::Package::XPK;
+    return true;
+  }
+
+  manifest_path = path.Append(xwalk::application::kManifestWgtFilename);
+  if (base::PathExists(manifest_path)) {
+    *package_type = xwalk::application::Package::WGT;
+    return true;
+  }
+
+  *error = base::StringPrintf("%s", errors::kManifestUnreadable);
+  return false;
+}
+
 }  // namespace
 
 namespace xwalk {
@@ -273,17 +295,22 @@ scoped_refptr<ApplicationData> LoadApplication(
     const base::FilePath& application_path,
     Manifest::SourceType source_type,
     std::string* error) {
+  Package::Type package_type;
+  if (!GetPackageType(application_path, &package_type, error))
+    return NULL;
+
   return LoadApplication(application_path, std::string(),
-                         source_type, error);
+                         source_type, package_type, error);
 }
 
 scoped_refptr<ApplicationData> LoadApplication(
     const base::FilePath& application_path,
     const std::string& application_id,
     Manifest::SourceType source_type,
+    Package::Type package_type,
     std::string* error) {
   scoped_ptr<base::DictionaryValue> manifest(
-      LoadManifest(application_path, error));
+      LoadManifest(application_path, package_type, error));
   if (!manifest.get())
     return NULL;
 
@@ -299,8 +326,8 @@ scoped_refptr<ApplicationData> LoadApplication(
   std::vector<InstallWarning> warnings;
   ManifestHandlerRegistry* registry =
       manifest->HasKey(widget_keys::kWidgetKey)
-      ? ManifestHandlerRegistry::GetInstance(Manifest::TYPE_WGT)
-      : ManifestHandlerRegistry::GetInstance(Manifest::TYPE_XPK);
+      ? ManifestHandlerRegistry::GetInstance(Package::WGT)
+      : ManifestHandlerRegistry::GetInstance(Package::XPK);
 
   if (!registry->ValidateAppManifest(application, error, &warnings))
     return NULL;
@@ -368,15 +395,16 @@ static base::DictionaryValue* LoadManifestWgt(
 }
 
 base::DictionaryValue* LoadManifest(const base::FilePath& application_path,
-      std::string* error) {
+                                    Package::Type package_type,
+                                    std::string* error) {
   base::FilePath manifest_path;
 
   manifest_path = application_path.Append(kManifestXpkFilename);
-  if (base::PathExists(manifest_path))
+  if (package_type == Package::XPK)
     return LoadManifestXpk(manifest_path, error);
 
   manifest_path = application_path.Append(kManifestWgtFilename);
-  if (base::PathExists(manifest_path))
+  if (package_type == Package::WGT)
     return LoadManifestWgt(manifest_path, error);
 
   *error = base::StringPrintf("%s", errors::kManifestUnreadable);
index 23bcf10..cb22f50 100644 (file)
@@ -9,6 +9,7 @@
 #include <map>
 
 #include "base/memory/ref_counted.h"
+#include "xwalk/application/browser/installer/package.h"
 #include "xwalk/application/common/manifest.h"
 
 
@@ -37,11 +38,13 @@ scoped_refptr<ApplicationData> LoadApplication(
     const base::FilePath& application_root,
     const std::string& application_id,
     Manifest::SourceType source_type,
+    Package::Type package_type,
     std::string* error);
 
 // Loads an application manifest from the specified directory. Returns NULL
 // on failure, with a description of the error in |error|.
 base::DictionaryValue* LoadManifest(const base::FilePath& application_root,
+                                    Package::Type package_type,
                                     std::string* error);
 
 // Get a relative file path from an app:// URL.
index fccddfc..5419345 100644 (file)
@@ -119,51 +119,51 @@ const char kPlatformAppNeedsManifestVersion2[] =
 
 namespace application {
 
-const char* GetNameKey(Manifest::PackageType package_type) {
-  if (package_type == Manifest::TYPE_WGT)
+const char* GetNameKey(Package::Type package_type) {
+  if (package_type == Package::WGT)
     return application_widget_keys::kNameKey;
 
   return application_manifest_keys::kNameKey;
 }
 
-const char* GetVersionKey(Manifest::PackageType package_type) {
-  if (package_type == Manifest::TYPE_WGT)
+const char* GetVersionKey(Package::Type package_type) {
+  if (package_type == Package::WGT)
     return application_widget_keys::kVersionKey;
 
   return application_manifest_keys::kVersionKey;
 }
 
-const char* GetWebURLsKey(Manifest::PackageType package_type) {
-  if (package_type == Manifest::TYPE_WGT)
+const char* GetWebURLsKey(Package::Type package_type) {
+  if (package_type == Package::WGT)
     return application_widget_keys::kWebURLsKey;
 
   return application_manifest_keys::kWebURLsKey;
 }
 
-const char* GetLaunchLocalPathKey(Manifest::PackageType package_type) {
-  if (package_type == Manifest::TYPE_WGT)
+const char* GetLaunchLocalPathKey(Package::Type package_type) {
+  if (package_type == Package::WGT)
     return application_widget_keys::kLaunchLocalPathKey;
 
   return application_manifest_keys::kLaunchLocalPathKey;
 }
 
-const char* GetCSPKey(Manifest::PackageType package_type) {
-  if (package_type == Manifest::TYPE_WGT)
+const char* GetCSPKey(Package::Type package_type) {
+  if (package_type == Package::WGT)
     return application_widget_keys::kCSPKey;
 
   return application_manifest_keys::kCSPKey;
 }
 
 #if defined(OS_TIZEN)
-const char* GetTizenAppIdKey(Manifest::PackageType package_type) {
-  if (package_type == Manifest::TYPE_WGT)
+const char* GetTizenAppIdKey(Package::Type package_type) {
+  if (package_type == Package::WGT)
     return application_widget_keys::kTizenAppIdKey;
 
   return application_manifest_keys::kTizenAppIdKey;
 }
 
-const char* GetIcon128Key(Manifest::PackageType package_type) {
-  if (package_type == Manifest::TYPE_WGT)
+const char* GetIcon128Key(Package::Type package_type) {
+  if (package_type == Package::WGT)
     return application_widget_keys::kIcon128Key;
 
   return application_manifest_keys::kIcon128Key;
index 4fcb394..839e2c2 100644 (file)
@@ -98,14 +98,14 @@ namespace application_manifest_errors {
 namespace application {
 
 typedef application::Manifest Manifest;
-const char* GetNameKey(Manifest::PackageType type);
-const char* GetVersionKey(Manifest::PackageType type);
-const char* GetWebURLsKey(Manifest::PackageType type);
-const char* GetLaunchLocalPathKey(Manifest::PackageType type);
-const char* GetCSPKey(Manifest::PackageType type);
+const char* GetNameKey(Package::Type type);
+const char* GetVersionKey(Package::Type type);
+const char* GetWebURLsKey(Package::Type type);
+const char* GetLaunchLocalPathKey(Package::Type type);
+const char* GetCSPKey(Package::Type type);
 #if defined(OS_TIZEN)
-const char* GetTizenAppIdKey(Manifest::PackageType type);
-const char* GetIcon128Key(Manifest::PackageType type);
+const char* GetTizenAppIdKey(Package::Type type);
+const char* GetIcon128Key(Package::Type type);
 #endif
 }  // namespace application
 }  // namespace xwalk
index 36c816c..43d225f 100644 (file)
@@ -82,11 +82,6 @@ Manifest::Manifest(SourceType source_type,
 
   if (data_->HasKey(widget_keys::kWidgetKey) &&
       data_->Get(widget_keys::kWidgetKey, NULL))
-    package_type_ = TYPE_WGT;
-  else
-    package_type_ = TYPE_XPK;
-
-  if (IsWGTPackaged())
     ParseWGTI18n();
 
   // Unittest may not have an xwalkrunner, so we should check here.
index d484404..cbe6eb6 100644 (file)
@@ -14,6 +14,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/strings/string16.h"
 #include "base/values.h"
+#include "xwalk/application/browser/installer/package.h"
 #include "xwalk/application/common/install_warning.h"
 
 namespace xwalk {
@@ -39,12 +40,6 @@ class Manifest {
     TYPE_PACKAGED_APP
   };
 
-  enum PackageType {
-    TYPE_WGT = 0,
-    TYPE_XPK
-  };
-
-
   Manifest(SourceType source_type, scoped_ptr<base::DictionaryValue> value);
   virtual ~Manifest();
 
@@ -71,10 +66,6 @@ class Manifest {
   bool IsPackaged() const { return type_ == TYPE_PACKAGED_APP; }
   bool IsHosted() const { return type_ == TYPE_HOSTED_APP; }
 
-  PackageType GetPackageType() const { return package_type_; }
-  bool IsXPKPackaged() const { return package_type_ == TYPE_XPK; }
-  bool IsWGTPackaged() const { return package_type_ == TYPE_WGT; }
-
   // These access the wrapped manifest value, returning false when the property
   // does not exist or if the manifest type can't access it.
   bool HasKey(const std::string& key) const;
@@ -146,8 +137,6 @@ class Manifest {
 
   Type type_;
 
-  PackageType package_type_;
-
   DISALLOW_COPY_AND_ASSIGN(Manifest);
 };
 
index 7b364d4..7a2e32c 100644 (file)
@@ -59,8 +59,8 @@ ManifestHandlerRegistry::~ManifestHandlerRegistry() {
 }
 
 ManifestHandlerRegistry*
-ManifestHandlerRegistry::GetInstance(Manifest::PackageType package_type) {
-  if (package_type == Manifest::TYPE_WGT)
+ManifestHandlerRegistry::GetInstance(Package::Type package_type) {
+  if (package_type == Package::WGT)
     return GetInstanceForWGT();
   return GetInstanceForXPK();
 }
@@ -75,7 +75,7 @@ ManifestHandlerRegistry::GetInstanceForWGT() {
   handlers.push_back(new WidgetHandler);
   handlers.push_back(new WARPHandler);
 #if defined(OS_TIZEN)
-  handlers.push_back(new CSPHandler(Manifest::TYPE_WGT));
+  handlers.push_back(new CSPHandler(Package::WGT));
   handlers.push_back(new NavigationHandler);
   handlers.push_back(new TizenApplicationHandler);
   handlers.push_back(new TizenSettingHandler);
@@ -93,7 +93,7 @@ ManifestHandlerRegistry::GetInstanceForXPK() {
   std::vector<ManifestHandler*> handlers;
   // FIXME: Add manifest handlers here like this:
   // handlers.push_back(new xxxHandler);
-  handlers.push_back(new CSPHandler(Manifest::TYPE_XPK));
+  handlers.push_back(new CSPHandler(Package::XPK));
   handlers.push_back(new PermissionsHandler);
   xpk_registry_ = new ManifestHandlerRegistry(handlers);
   return xpk_registry_;
@@ -143,8 +143,8 @@ bool ManifestHandlerRegistry::ValidateAppManifest(
 
 // static
 void ManifestHandlerRegistry::SetInstanceForTesting(
-    ManifestHandlerRegistry* registry, Manifest::PackageType package_type) {
-  if (package_type == Manifest::TYPE_WGT) {
+    ManifestHandlerRegistry* registry, Package::Type package_type) {
+  if (package_type == Package::WGT) {
     widget_registry_ = registry;
     return;
   }
index 9091cba..5176589 100644 (file)
@@ -56,7 +56,7 @@ class ManifestHandlerRegistry {
   ~ManifestHandlerRegistry();
 
   static ManifestHandlerRegistry* GetInstance(
-      Manifest::PackageType package_type);
+      Package::Type package_type);
 
   bool ParseAppManifest(
        scoped_refptr<ApplicationData> application, base::string16* error);
@@ -77,7 +77,7 @@ class ManifestHandlerRegistry {
 
   // Sets a new global registry, for testing purposes.
   static void SetInstanceForTesting(ManifestHandlerRegistry* registry,
-                                    Manifest::PackageType package_type);
+                                    Package::Type package_type);
 
   static ManifestHandlerRegistry* GetInstanceForWGT();
   static ManifestHandlerRegistry* GetInstanceForXPK();
index 55755f3..a6c3f7e 100644 (file)
@@ -32,14 +32,14 @@ class ScopedTestingManifestHandlerRegistry {
       : registry_(
           new ManifestHandlerRegistry(handlers)),
         prev_registry_(
-          ManifestHandlerRegistry::GetInstance(Manifest::TYPE_XPK)) {
+          ManifestHandlerRegistry::GetInstance(Package::XPK)) {
     ManifestHandlerRegistry::SetInstanceForTesting(
-        registry_.get(), Manifest::TYPE_XPK);
+        registry_.get(), Package::XPK);
   }
 
   ~ScopedTestingManifestHandlerRegistry() {
     ManifestHandlerRegistry::SetInstanceForTesting(
-        prev_registry_, Manifest::TYPE_XPK);
+        prev_registry_, Package::XPK);
   }
 
   scoped_ptr<ManifestHandlerRegistry> registry_;
index 0317936..48863e0 100644 (file)
@@ -21,7 +21,7 @@ CSPInfo::CSPInfo() {
 CSPInfo::~CSPInfo() {
 }
 
-CSPHandler::CSPHandler(Manifest::PackageType type)
+CSPHandler::CSPHandler(Package::Type type)
     : package_type_(type) {
 }
 
@@ -62,7 +62,7 @@ bool CSPHandler::Parse(scoped_refptr<ApplicationData> application,
 }
 
 bool CSPHandler::AlwaysParseForType(Manifest::Type type) const {
-  return package_type_ == Manifest::TYPE_XPK;
+  return package_type_ == Package::XPK;
 }
 
 std::vector<std::string> CSPHandler::Keys() const {
index 6861d74..071520d 100644 (file)
@@ -32,7 +32,7 @@ class CSPInfo : public ApplicationData::ManifestData {
 
 class CSPHandler : public ManifestHandler {
  public:
-  explicit CSPHandler(Manifest::PackageType type);
+  explicit CSPHandler(Package::Type type);
   virtual ~CSPHandler();
 
   virtual bool Parse(scoped_refptr<ApplicationData> application,
@@ -41,7 +41,7 @@ class CSPHandler : public ManifestHandler {
   virtual std::vector<std::string> Keys() const OVERRIDE;
 
  private:
-  Manifest::PackageType package_type_;
+  Package::Type package_type_;
 
   DISALLOW_COPY_AND_ASSIGN(CSPHandler);
 };
index 494102d..cc6c2dd 100644 (file)
@@ -52,7 +52,7 @@ TEST_F(WARPHandlerTest, OneWARP) {
   manifest.Set(keys::kAccessKey, warp);
   scoped_refptr<ApplicationData> application = CreateApplication();
   EXPECT_TRUE(application.get());
-  EXPECT_EQ(application->GetPackageType(), Manifest::TYPE_WGT);
+  EXPECT_EQ(application->GetPackageType(), Package::WGT);
   const WARPInfo* info = GetWARPInfo(application);
   EXPECT_TRUE(info);
   scoped_ptr<base::ListValue> list(info->GetWARP()->DeepCopy());
@@ -76,7 +76,7 @@ TEST_F(WARPHandlerTest, WARPs) {
 
   scoped_refptr<ApplicationData> application = CreateApplication();
   EXPECT_TRUE(application.get());
-  EXPECT_EQ(application->GetPackageType(), Manifest::TYPE_WGT);
+  EXPECT_EQ(application->GetPackageType(), Package::WGT);
 
   const WARPInfo* info = GetWARPInfo(application);
   EXPECT_TRUE(info);
index ec29744..084a353 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <map>
 #include <utility>
-#include <vector>
+#include <set>
 
 #include "base/strings/utf_string_conversions.h"
 #include "base/strings/stringprintf.h"
@@ -58,22 +58,28 @@ const KeyMap& GetWidgetKeyPairs() {
   return map;
 }
 
-void ParsePreferenceItem(const base::DictionaryValue* in_value,
-                         base::DictionaryValue* out_value) {
+bool ParsePreferenceItem(const base::DictionaryValue* in_value,
+                         base::DictionaryValue* out_value,
+                         std::set<std::string>* used) {
   DCHECK(in_value && in_value->IsType(base::Value::TYPE_DICTIONARY));
 
   std::string pref_name;
   std::string pref_value;
   std::string pref_readonly;
-  if (in_value->GetString(keys::kPreferencesNameKey, &pref_name))
+  if (in_value->GetString(keys::kPreferencesNameKey, &pref_name)
+     && used->find(pref_name) == used->end()) {
     out_value->SetString(kPreferencesName, pref_name);
+    used->insert(pref_name);
+  } else {
+    return false;
+  }
 
   if (in_value->GetString(keys::kPreferencesValueKey, &pref_value))
     out_value->SetString(kPreferencesValue, pref_value);
 
-  if (in_value->GetString(keys::kPreferencesReadonlyKey, &pref_readonly)) {
-      out_value->SetBoolean(kPreferencesReadonly, pref_readonly == "true");
-  }
+  if (in_value->GetString(keys::kPreferencesReadonlyKey, &pref_readonly))
+    out_value->SetBoolean(kPreferencesReadonly, pref_readonly == "true");
+  return true;
 }
 
 }  // namespace
@@ -126,12 +132,13 @@ bool WidgetHandler::Parse(scoped_refptr<ApplicationData> application,
   base::Value* pref_value = NULL;
   manifest->Get(keys::kPreferencesKey, &pref_value);
 
+  std::set<std::string> preference_names_used;
   if (pref_value && pref_value->IsType(base::Value::TYPE_DICTIONARY)) {
     base::DictionaryValue* preferences = new base::DictionaryValue;
     base::DictionaryValue* dict;
     pref_value->GetAsDictionary(&dict);
-    ParsePreferenceItem(dict, preferences);
-    widget_info->Set(kPreferences, preferences);
+    if (ParsePreferenceItem(dict, preferences, &preference_names_used))
+      widget_info->Set(kPreferences, preferences);
   } else if (pref_value && pref_value->IsType(base::Value::TYPE_LIST)) {
     base::ListValue* preferences = new base::ListValue;
     base::ListValue* list;
@@ -142,8 +149,8 @@ bool WidgetHandler::Parse(scoped_refptr<ApplicationData> application,
       base::DictionaryValue* pref = new base::DictionaryValue;
       base::DictionaryValue* dict;
       (*it)->GetAsDictionary(&dict);
-      ParsePreferenceItem(dict, pref);
-      preferences->Append(pref);
+      if (ParsePreferenceItem(dict, pref, &preference_names_used))
+        preferences->Append(pref);
     }
     widget_info->Set(kPreferences, preferences);
   }
index 6fecbdd..17ab4aa 100644 (file)
@@ -161,7 +161,7 @@ TEST_F(WidgetHandlerTest,
   scoped_refptr<ApplicationData> application;
   application = CreateApplication(*(manifest.get()));
   EXPECT_TRUE(application);
-  EXPECT_EQ(application->GetPackageType(), Manifest::TYPE_WGT);
+  EXPECT_EQ(application->GetPackageType(), Package::WGT);
   // Get widget info from this application.
   WidgetInfo* info = GetWidgetInfo(application);
   EXPECT_TRUE(info);
@@ -193,7 +193,7 @@ TEST_F(WidgetHandlerTest,
   scoped_refptr<ApplicationData> application;
   application = CreateApplication(*(manifest.get()));
   EXPECT_TRUE(application);
-  EXPECT_EQ(application->GetPackageType(), Manifest::TYPE_WGT);
+  EXPECT_EQ(application->GetPackageType(), Package::WGT);
   // Get widget info from this application.
   WidgetInfo* info = GetWidgetInfo(application);
   EXPECT_TRUE(info);
index 2c64ad0..7bd9005 100644 (file)
@@ -46,14 +46,49 @@ for (var key in widgetStringInfo) {
 
 var WidgetStorage = function() {
   var _keyList = new Array();
+  var _itemStorage = new Object();
+
+  var _SetItem = function(itemKey, itemValue) {
+    var result = extension.internal.sendSyncMessage({
+        cmd: 'SetPreferencesItem',
+        preferencesItemKey: String(itemKey),
+        preferencesItemValue: String(itemValue) });
+
+    if (result) {
+      if (_itemStorage[String(itemKey)] == undefined)
+        _keyList.push(String(itemKey));
+      _itemStorage[String(itemKey)] = String(itemValue);
+      return itemValue;
+    } else {
+      throw new common.CustomDOMException(
+        common.CustomDOMException.NO_MODIFICATION_ALLOWED_ERR,
+        'The object can not be modified.');
+    }
+  }
+
+  var _GetSetter = function(itemKey) {
+    var _itemKey = itemKey;
+    return function(itemValue) {
+      return _SetItem(_itemKey, itemValue);
+    }
+  }
+
+  var _GetGetter = function(itemKey) {
+    var _itemKey = itemKey;
+    return function() {
+      return _itemStorage[String(_itemKey)];
+    }
+  }
 
   this.init = function() {
     var result = extension.internal.sendSyncMessage(
         { cmd: 'GetAllItems' });
     for (var itemKey in result) {
-      var itemValue = result[itemKey];
-      this[itemKey] = itemValue;
-      _keyList.push(itemKey);
+      var itemValue = result[String(itemKey)];
+      _itemStorage[String(itemKey)] = itemValue;
+      this.__defineSetter__(String(itemKey), _GetSetter(itemKey));
+      this.__defineGetter__(String(itemKey), _GetGetter(itemKey));
+      _keyList.push(String(itemKey));
     }
   }
 
@@ -66,25 +101,13 @@ var WidgetStorage = function() {
   }
 
   this.getItem = function(itemKey) {
-    return this[String(itemKey)];
-  } 
+    return _itemStorage[String(_itemKey)];
+  }
 
   this.setItem = function(itemKey, itemValue) {
-    var result = extension.internal.sendSyncMessage({
-        cmd: 'SetPreferencesItem',
-        preferencesItemKey: String(itemKey),
-        preferencesItemValue: String(itemValue) });
+    return _SetItem(_itemKey, itemValue);
+  }
 
-    if (result) {
-      this[String(itemKey)] = String(itemValue);
-      _keyList.push(String(itemKey));
-    } else {
-      throw new common.CustomDOMException(
-          common.CustomDOMException.NO_MODIFICATION_ALLOWED_ERR,
-          'The object can not be modified.');
-    }
-  };
-  
   this.removeItem = function(itemKey) {
     var result = extension.internal.sendSyncMessage({
         cmd: 'RemovePreferencesItem',
@@ -92,7 +115,8 @@ var WidgetStorage = function() {
 
     if (result) {
       delete this[itemKey];
-      delete _keyList[_keyList.indexOf(String(itemKey))];
+      delete _itemStorage[itemKey];
+      _keyList.splice(_keyList.indexOf(String(itemKey)), 1);
     } else {
       throw new common.CustomDOMException(
           common.CustomDOMException.NO_MODIFICATION_ALLOWED_ERR,
@@ -117,6 +141,7 @@ var WidgetStorage = function() {
 
       if (!exists) {
         delete this[_keyList[i]];
+        delete _itemStorage[_keyList[i]];
         _keyList.splice(i, 1);
       }
     }
index 0175610..95cab71 100644 (file)
@@ -12,7 +12,7 @@
 %endif
 
 Name:           crosswalk
-Version:        7.35.139.0
+Version:        7.35.141.0
 Release:        0
 Summary:        Crosswalk is an app runtime based on Chromium
 License:        (BSD-3-Clause and LGPL-2.1+)
index 62ffc55..9e11b8e 100644 (file)
@@ -139,10 +139,15 @@ void XWalkBrowserMainParts::RegisterExternalExtensions() {
   CommandLine* cmd_line = CommandLine::ForCurrentProcess();
 
 #if defined(OS_TIZEN)
-  static const std::string tec_path = "/usr/lib/tizen-extensions-crosswalk";
   std::string value = cmd_line->GetSwitchValueASCII(
       switches::kXWalkExternalExtensionsPath);
 
+#if defined(ARCH_CPU_64_BITS)
+  const char tec_path[] = "/usr/lib64/tizen-extensions-crosswalk";
+#else
+  const char tec_path[] = "/usr/lib/tizen-extensions-crosswalk";
+#endif
+
   if (value.empty())
     cmd_line->AppendSwitchASCII(switches::kXWalkExternalExtensionsPath,
         tec_path);