%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+)
Srcset status=stable
Stream status=experimental
StyleScoped status=experimental
-SubpixelFontScaling status=experimental
+SubpixelFontScaling status=stable
SubresourceIntegrity status=test
SVGPaintOrder status=stable
# 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'
MAJOR=7
MINOR=35
-BUILD=139
+BUILD=141
PATCH=0
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()
# 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:
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,
}
void Application::InitSecurityPolicy() {
- if (data_->GetPackageType() != Manifest::TYPE_WGT)
+ if (data_->GetPackageType() != Package::WGT)
return;
const WARPInfo* info = static_cast<WARPInfo*>(
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.
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);
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;
LoadApplication(unpacked_dir,
app_id,
Manifest::COMMAND_LINE,
+ package->type(),
&error);
if (!new_application) {
LOG(ERROR) << "An error occurred during application updating: " << error;
new_application = LoadApplication(app_dir,
app_id,
Manifest::COMMAND_LINE,
+ package->type(),
&error);
if (!new_application) {
LOG(ERROR) << "Error during loading new package: " << error;
return;
}
- if (data_->GetPackageType() != Manifest::TYPE_WGT)
+ if (data_->GetPackageType() != Package::WGT)
return;
// Always enable security mode when under CSP mode.
// 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_;
base::ScopedTempDir temp_dir_;
// Represent if the package has been extracted.
bool is_extracted_;
+ Type type_;
};
} // namespace application
: Package(path) {
if (!base::PathExists(path))
return;
+ type_ = WGT;
base::FilePath extracted_path;
if (!Extract(&extracted_path))
return;
: Package(path) {
if (!base::PathExists(path))
return;
+ type_ = XPK;
scoped_ptr<ScopedStdioHandle> file(
new ScopedStdioHandle(base::OpenFile(path, "rb")));
file_ = file.Pass();
return GetManifest()->IsHosted();
}
-Manifest::PackageType ApplicationData::GetPackageType() const {
- return manifest_->GetPackageType();
-}
-
// static
bool ApplicationData::InitApplicationID(xwalk::application::Manifest* manifest,
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() {
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;
}
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;
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;
}
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;
}
void ClearPermissions();
PermissionSet GetManifestPermissions() const;
- Manifest::PackageType GetPackageType() const;
+ Package::Type GetPackageType() const { return package_type_; }
#if defined(OS_TIZEN)
bool HasCSPDefined() const;
// Application's persistent permissions.
StoredPermissionMap permission_map_;
+ // The package type, wgt or xpk.
+ Package::Type package_type_;
+
DISALLOW_COPY_AND_ASSIGN(ApplicationData);
};
#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"
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 {
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;
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;
}
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);
#include <map>
#include "base/memory/ref_counted.h"
+#include "xwalk/application/browser/installer/package.h"
#include "xwalk/application/common/manifest.h"
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.
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;
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
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.
#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 {
TYPE_PACKAGED_APP
};
- enum PackageType {
- TYPE_WGT = 0,
- TYPE_XPK
- };
-
-
Manifest(SourceType source_type, scoped_ptr<base::DictionaryValue> value);
virtual ~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;
Type type_;
- PackageType package_type_;
-
DISALLOW_COPY_AND_ASSIGN(Manifest);
};
}
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();
}
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);
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_;
// 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;
}
~ManifestHandlerRegistry();
static ManifestHandlerRegistry* GetInstance(
- Manifest::PackageType package_type);
+ Package::Type package_type);
bool ParseAppManifest(
scoped_refptr<ApplicationData> application, base::string16* error);
// 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();
: 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_;
CSPInfo::~CSPInfo() {
}
-CSPHandler::CSPHandler(Manifest::PackageType type)
+CSPHandler::CSPHandler(Package::Type type)
: package_type_(type) {
}
}
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 {
class CSPHandler : public ManifestHandler {
public:
- explicit CSPHandler(Manifest::PackageType type);
+ explicit CSPHandler(Package::Type type);
virtual ~CSPHandler();
virtual bool Parse(scoped_refptr<ApplicationData> application,
virtual std::vector<std::string> Keys() const OVERRIDE;
private:
- Manifest::PackageType package_type_;
+ Package::Type package_type_;
DISALLOW_COPY_AND_ASSIGN(CSPHandler);
};
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());
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);
#include <map>
#include <utility>
-#include <vector>
+#include <set>
#include "base/strings/utf_string_conversions.h"
#include "base/strings/stringprintf.h"
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
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;
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);
}
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);
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);
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));
}
}
}
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',
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,
if (!exists) {
delete this[_keyList[i]];
+ delete _itemStorage[_keyList[i]];
_keyList.splice(i, 1);
}
}
%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+)
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);