Import Cobalt 2.10373 2016-09-05
diff --git a/src/cobalt/bindings/generated/mozjs/testing/MozjsEnumerationInterface.cc b/src/cobalt/bindings/generated/mozjs/testing/MozjsEnumerationInterface.cc
index 0e08a3f..f9cf774 100644
--- a/src/cobalt/bindings/generated/mozjs/testing/MozjsEnumerationInterface.cc
+++ b/src/cobalt/bindings/generated/mozjs/testing/MozjsEnumerationInterface.cc
@@ -464,6 +464,9 @@
case EnumerationInterface::kGamma:
ToJSValue(context, std::string("gamma"), out_value);
return;
+ default:
+ NOTREACHED();
+ out_value.set(JS::UndefinedValue());
}
}
diff --git a/src/cobalt/bindings/mozjs/templates/interface.cc.template b/src/cobalt/bindings/mozjs/templates/interface.cc.template
index 4d4c20e..992ad67 100644
--- a/src/cobalt/bindings/mozjs/templates/interface.cc.template
+++ b/src/cobalt/bindings/mozjs/templates/interface.cc.template
@@ -933,6 +933,9 @@
ToJSValue(context, std::string("{{idl_value}}"), out_value);
return;
{% endfor %}
+ default:
+ NOTREACHED();
+ out_value.set(JS::UndefinedValue());
}
}
diff --git a/src/cobalt/build/build.id b/src/cobalt/build/build.id
index f8231a2..d57c218 100644
--- a/src/cobalt/build/build.id
+++ b/src/cobalt/build/build.id
@@ -1 +1 @@
-10363
\ No newline at end of file
+10373
\ No newline at end of file
diff --git a/src/starboard/linux/shared/gyp_configuration.gypi b/src/starboard/linux/shared/gyp_configuration.gypi
index 33d4db1..703b774 100644
--- a/src/starboard/linux/shared/gyp_configuration.gypi
+++ b/src/starboard/linux/shared/gyp_configuration.gypi
@@ -27,7 +27,9 @@
# This should have a default value in cobalt/base.gypi. See the comment
# there for acceptable values for this variable.
- 'javascript_engine': 'javascriptcore',
+ 'javascript_engine': 'mozjs',
+ # JIT is temporarily disabled for spidermonkey.
+ 'cobalt_enable_jit': 0,
# Define platform specific compiler and linker flags.
# Refer to base.gypi for a list of all available variables.
diff --git a/src/starboard/linux/x64directfb/system_get_property.cc b/src/starboard/linux/x64directfb/system_get_property.cc
index 84957d0..b1529fe 100644
--- a/src/starboard/linux/x64directfb/system_get_property.cc
+++ b/src/starboard/linux/x64directfb/system_get_property.cc
@@ -19,7 +19,7 @@
namespace {
-const char* kFriendlyName = "My Linux";
+const char* kFriendlyName = "Linux Desktop";
const char* kPlatformName = "DirectFB; Linux x86_64";
bool CopyStringAndTestIfSuccess(char* out_value,
@@ -41,10 +41,11 @@
}
switch (property_id) {
+ case kSbSystemPropertyBrandName:
case kSbSystemPropertyChipsetModelNumber:
case kSbSystemPropertyFirmwareVersion:
- case kSbSystemPropertyManufacturerName:
case kSbSystemPropertyModelName:
+ case kSbSystemPropertyModelYear:
case kSbSystemPropertyNetworkOperatorName:
return false;
diff --git a/src/starboard/linux/x64x11/system_get_property.cc b/src/starboard/linux/x64x11/system_get_property.cc
index c1e0ced..cffaa35 100644
--- a/src/starboard/linux/x64x11/system_get_property.cc
+++ b/src/starboard/linux/x64x11/system_get_property.cc
@@ -19,7 +19,7 @@
namespace {
-const char* kFriendlyName = "My Linux";
+const char* kFriendlyName = "Linux Desktop";
const char* kPlatformName = "X11; Linux x86_64";
bool CopyStringAndTestIfSuccess(char* out_value,
@@ -41,10 +41,11 @@
}
switch (property_id) {
+ case kSbSystemPropertyBrandName:
case kSbSystemPropertyChipsetModelNumber:
case kSbSystemPropertyFirmwareVersion:
- case kSbSystemPropertyManufacturerName:
case kSbSystemPropertyModelName:
+ case kSbSystemPropertyModelYear:
case kSbSystemPropertyNetworkOperatorName:
return false;
diff --git a/src/starboard/nplb/system_get_property_test.cc b/src/starboard/nplb/system_get_property_test.cc
index 82f35d5..52c348b 100644
--- a/src/starboard/nplb/system_get_property_test.cc
+++ b/src/starboard/nplb/system_get_property_test.cc
@@ -26,6 +26,21 @@
// Size of appropriate value buffer.
const size_t kValueSize = 1024;
+bool IsCEDevice(SbSystemDeviceType device_type) {
+ switch (device_type) {
+ case kSbSystemDeviceTypeBlueRayDiskPlayer:
+ case kSbSystemDeviceTypeGameConsole:
+ case kSbSystemDeviceTypeOverTheTopBox:
+ case kSbSystemDeviceTypeSetTopBox:
+ case kSbSystemDeviceTypeTV:
+ return true;
+ case kSbSystemDeviceTypeDesktopPC:
+ case kSbSystemDeviceTypeUnknown:
+ default:
+ return false;
+ }
+}
+
void BasicTest(SbSystemPropertyId id,
bool expect_result,
bool expected_result,
@@ -48,14 +63,23 @@
}
TEST(SbSystemGetPropertyTest, ReturnsRequired) {
- BasicTest(kSbSystemPropertyChipsetModelNumber, false, true, __LINE__);
- BasicTest(kSbSystemPropertyFirmwareVersion, false, true, __LINE__);
BasicTest(kSbSystemPropertyFriendlyName, true, true, __LINE__);
- BasicTest(kSbSystemPropertyManufacturerName, false, true, __LINE__);
- BasicTest(kSbSystemPropertyModelName, false, true, __LINE__);
- BasicTest(kSbSystemPropertyNetworkOperatorName, false, true, __LINE__);
BasicTest(kSbSystemPropertyPlatformName, true, true, __LINE__);
BasicTest(kSbSystemPropertyPlatformUuid, true, true, __LINE__);
+
+ BasicTest(kSbSystemPropertyChipsetModelNumber, false, true, __LINE__);
+ BasicTest(kSbSystemPropertyFirmwareVersion, false, true, __LINE__);
+ BasicTest(kSbSystemPropertyNetworkOperatorName, false, true, __LINE__);
+
+ if (IsCEDevice(SbSystemGetDeviceType())) {
+ BasicTest(kSbSystemPropertyBrandName, true, true, __LINE__);
+ BasicTest(kSbSystemPropertyModelName, true, true, __LINE__);
+ BasicTest(kSbSystemPropertyModelYear, true, true, __LINE__);
+ } else {
+ BasicTest(kSbSystemPropertyBrandName, false, true, __LINE__);
+ BasicTest(kSbSystemPropertyModelName, false, true, __LINE__);
+ BasicTest(kSbSystemPropertyModelYear, false, true, __LINE__);
+ }
}
TEST(SbSystemGetPropertyTest, FailsGracefullyZeroBufferLength) {
diff --git a/src/starboard/raspi/1/system_get_property.cc b/src/starboard/raspi/1/system_get_property.cc
index 9a849da..6b5cee9 100644
--- a/src/starboard/raspi/1/system_get_property.cc
+++ b/src/starboard/raspi/1/system_get_property.cc
@@ -19,8 +19,8 @@
namespace {
-const char* kFriendlyName = "My Linux";
-const char* kPlatformName = "Linux armv7l";
+const char* kFriendlyName = "Raspberry Pi";
+const char* kPlatformName = "Raspian Linux armv7l";
bool CopyStringAndTestIfSuccess(char* out_value,
int value_length,
@@ -41,10 +41,11 @@
}
switch (property_id) {
+ case kSbSystemPropertyBrandName:
case kSbSystemPropertyChipsetModelNumber:
case kSbSystemPropertyFirmwareVersion:
- case kSbSystemPropertyManufacturerName:
case kSbSystemPropertyModelName:
+ case kSbSystemPropertyModelYear:
case kSbSystemPropertyNetworkOperatorName:
return false;
diff --git a/src/starboard/system.h b/src/starboard/system.h
index 5cdad66..957719a 100644
--- a/src/starboard/system.h
+++ b/src/starboard/system.h
@@ -56,7 +56,8 @@
kSbSystemPathExecutableFile,
} SbSystemPathId;
-// System properties that can be queried for.
+// System properties that can be queried for. Many of these are used in
+// User-Agent string generation.
typedef enum SbSystemPropertyId {
// The full model number of the main platform chipset, including any
// vendor-specific prefixes.
@@ -68,19 +69,27 @@
// A friendly name for this actual device. It may include user-personalization
// like "Upstairs Bedroom." It may be displayed to users as part of some kind
- // of device selection.
+ // of device selection (e.g. in-app DIAL).
kSbSystemPropertyFriendlyName,
- // The name of the device manufacturer.
+ // A deprecated alias for |kSbSystemPropertyBrandName|.
kSbSystemPropertyManufacturerName,
- // The name of the device model.
+ // The name of the brand under which the device is being sold.
+ kSbSystemPropertyBrandName = kSbSystemPropertyManufacturerName,
+
+ // The final production model number of the device.
kSbSystemPropertyModelName,
- // The name of the network operator that owns the target device.
+ // The year the device was launched, e.g. "2016".
+ kSbSystemPropertyModelYear,
+
+ // The name of the network operator that owns the target device, if
+ // applicable.
kSbSystemPropertyNetworkOperatorName,
- // The name of this platform, suitable for inclusion in a User-Agent, say.
+ // The name of the operating system and platform, suitable for inclusion in a
+ // User-Agent, say.
kSbSystemPropertyPlatformName,
// A universally-unique ID for the current user.
@@ -240,9 +249,6 @@
// Returns the type of the device.
SB_EXPORT SbSystemDeviceType SbSystemGetDeviceType();
-// Returns whether the device is a TV device.
-SB_EXPORT bool SbSystemIsTvDeviceType(SbSystemDeviceType device_type);
-
// Returns the device's current network connection type.
SB_EXPORT SbSystemConnectionType SbSystemGetConnectionType();