Commit 1cb26c47 authored by Wang Qing's avatar Wang Qing Committed by Commit Bot

[MIPS] Add chromium.runtime API support for Loongson.

Extension API tests chromium.runtime GetPlatformInfo functions return NULL.
Bug comes from automated test unit: browser_tests

BUG= 838783
R= tbarzic@chromium.org

Change-Id: I4f6b04835fb949f15218c5adc4401950ba14b0a3
Reviewed-on: https://chromium-review.googlesource.com/1038912Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: 汪 清 <wangqing-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#555957}
parent 2f7fef26
......@@ -283,6 +283,10 @@ bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) {
info->arch = extensions::api::runtime::PLATFORM_ARCH_X86_32;
} else if (strcmp(arch, "x64") == 0) {
info->arch = extensions::api::runtime::PLATFORM_ARCH_X86_64;
} else if (strcmp(arch, "mipsel") == 0) {
info->arch = extensions::api::runtime::PLATFORM_ARCH_MIPS;
} else if (strcmp(arch, "mips64el") == 0) {
info->arch = extensions::api::runtime::PLATFORM_ARCH_MIPS64;
} else {
NOTREACHED();
return false;
......@@ -295,6 +299,10 @@ bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) {
info->nacl_arch = extensions::api::runtime::PLATFORM_NACL_ARCH_X86_32;
} else if (strcmp(nacl_arch, "x86-64") == 0) {
info->nacl_arch = extensions::api::runtime::PLATFORM_NACL_ARCH_X86_64;
} else if (strcmp(nacl_arch, "mips32") == 0) {
info->nacl_arch = extensions::api::runtime::PLATFORM_NACL_ARCH_MIPS;
} else if (strcmp(nacl_arch, "mips64") == 0) {
info->nacl_arch = extensions::api::runtime::PLATFORM_NACL_ARCH_MIPS64;
} else {
NOTREACHED();
return false;
......
......@@ -71,14 +71,14 @@
{
"id": "PlatformArch",
"type": "string",
"enum": ["arm", "x86-32", "x86-64"],
"enum": ["arm", "x86-32", "x86-64", "mips", "mips64"],
"description": "The machine's processor architecture."
},
{
"id": "PlatformNaclArch",
"description": "The native client architecture. This may be different from arch on some platforms.",
"type": "string",
"enum": ["arm", "x86-32", "x86-64"]
"enum": ["arm", "x86-32", "x86-64", "mips", "mips64"]
},
{
"id": "PlatformInfo",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment