diff options
author | Hokein.Wu@gmail.com <Hokein.Wu@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-18 02:06:01 +0000 |
---|---|---|
committer | Hokein.Wu@gmail.com <Hokein.Wu@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-18 02:06:01 +0000 |
commit | 58ed224c7e4b3968e6b651c9ca47c6831ce84ff1 (patch) | |
tree | aef9eb037dc4f87ffeef7c4faba5a4655e21db45 | |
parent | 3328c1d33f600477ccd90a950ab1c1b709c1f9b3 (diff) | |
download | chromium_src-58ed224c7e4b3968e6b651c9ca47c6831ce84ff1.zip chromium_src-58ed224c7e4b3968e6b651c9ca47c6831ce84ff1.tar.gz chromium_src-58ed224c7e4b3968e6b651c9ca47c6831ce84ff1.tar.bz2 |
[SystemInfo API] Rename systemInfo Cpu API.
Rename from "systemInfo.cpu.get" to "system.cpu.getInfo".
BUG=252994
TEST=SystemCpuApiTest.*
Review URL: https://chromiumcodereview.appspot.com/18639003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212204 0039d316-1c4b-4281-b951-d872f2087c98
28 files changed, 115 insertions, 114 deletions
diff --git a/chrome/browser/extensions/activity_log/api_name_constants.h b/chrome/browser/extensions/activity_log/api_name_constants.h index 7a6383d..c8e62d9 100644 --- a/chrome/browser/extensions/activity_log/api_name_constants.h +++ b/chrome/browser/extensions/activity_log/api_name_constants.h @@ -192,7 +192,8 @@ const char* const kNames[] = { "windows.update", "tabs.getSelected", "tabs.sendRequest", "systemInfo.cpu.get", "systemInfo.memory.get", - "runtime.onRestartRequired" + "runtime.onRestartRequired", + "system.cpu.getInfo" }; } // namespace activity_log_api_name_constants diff --git a/chrome/browser/extensions/api/system_info_cpu/OWNERS b/chrome/browser/extensions/api/system_cpu/OWNERS index 20685fc..20685fc 100644 --- a/chrome/browser/extensions/api/system_info_cpu/OWNERS +++ b/chrome/browser/extensions/api/system_cpu/OWNERS diff --git a/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.cc b/chrome/browser/extensions/api/system_cpu/cpu_info_provider.cc index 9c83112..6da73579 100644 --- a/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.cc +++ b/chrome/browser/extensions/api/system_cpu/cpu_info_provider.cc @@ -1,14 +1,14 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 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. -#include "chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h" +#include "chrome/browser/extensions/api/system_cpu/cpu_info_provider.h" #include "base/sys_info.h" namespace extensions { -using api::system_info_cpu::CpuInfo; +using api::system_cpu::CpuInfo; // Static member intialization. template<> diff --git a/chrome/browser/extensions/api/system_cpu/cpu_info_provider.h b/chrome/browser/extensions/api/system_cpu/cpu_info_provider.h new file mode 100644 index 0000000..0381cbd --- /dev/null +++ b/chrome/browser/extensions/api/system_cpu/cpu_info_provider.h @@ -0,0 +1,35 @@ +// Copyright 2013 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. +#ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_CPU_CPU_INFO_PROVIDER_H_ +#define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_CPU_CPU_INFO_PROVIDER_H_ + +#include "chrome/browser/extensions/api/system_info/system_info_provider.h" +#include "chrome/common/extensions/api/system_cpu.h" + +namespace extensions { + +class CpuInfoProvider + : public SystemInfoProvider<api::system_cpu::CpuInfo> { + public: + // Overriden from SystemInfoProvider<CpuInfo>. + virtual bool QueryInfo() OVERRIDE; + + // Return the single shared instance of CpuInfoProvider. + static CpuInfoProvider* Get(); + + const api::system_cpu::CpuInfo& cpu_info() const; + + private: + friend class SystemInfoProvider<api::system_cpu::CpuInfo>; + friend class MockCpuInfoProviderImpl; + + CpuInfoProvider(); + + virtual ~CpuInfoProvider(); +}; + +} // namespace extensions + +#endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_CPU_CPU_INFO_PROVIDER_H_ + diff --git a/chrome/browser/extensions/api/system_info_cpu/system_info_cpu_api.cc b/chrome/browser/extensions/api/system_cpu/system_cpu_api.cc index 175bcdb..45e9b0b 100644 --- a/chrome/browser/extensions/api/system_info_cpu/system_info_cpu_api.cc +++ b/chrome/browser/extensions/api/system_cpu/system_cpu_api.cc @@ -1,30 +1,30 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 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. #include "base/command_line.h" -#include "chrome/browser/extensions/api/system_info_cpu/system_info_cpu_api.h" -#include "chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h" +#include "chrome/browser/extensions/api/system_cpu/cpu_info_provider.h" +#include "chrome/browser/extensions/api/system_cpu/system_cpu_api.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/features/base_feature_provider.h" namespace extensions { -using api::system_info_cpu::CpuInfo; +using api::system_cpu::CpuInfo; -SystemInfoCpuGetFunction::SystemInfoCpuGetFunction() { +SystemCpuGetInfoFunction::SystemCpuGetInfoFunction() { } -SystemInfoCpuGetFunction::~SystemInfoCpuGetFunction() { +SystemCpuGetInfoFunction::~SystemCpuGetInfoFunction() { } -bool SystemInfoCpuGetFunction::RunImpl() { +bool SystemCpuGetInfoFunction::RunImpl() { CpuInfoProvider::Get()->StartQueryInfo( - base::Bind(&SystemInfoCpuGetFunction::OnGetCpuInfoCompleted, this)); + base::Bind(&SystemCpuGetInfoFunction::OnGetCpuInfoCompleted, this)); return true; } -void SystemInfoCpuGetFunction::OnGetCpuInfoCompleted(bool success) { +void SystemCpuGetInfoFunction::OnGetCpuInfoCompleted(bool success) { if (success) SetResult(CpuInfoProvider::Get()->cpu_info().ToValue().release()); else diff --git a/chrome/browser/extensions/api/system_cpu/system_cpu_api.h b/chrome/browser/extensions/api/system_cpu/system_cpu_api.h new file mode 100644 index 0000000..cae4d69 --- /dev/null +++ b/chrome/browser/extensions/api/system_cpu/system_cpu_api.h @@ -0,0 +1,25 @@ +// Copyright 2013 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. +#ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_CPU_SYSTEM_CPU_API_H_ +#define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_CPU_SYSTEM_CPU_API_H_ + +#include "chrome/browser/extensions/extension_function.h" +#include "chrome/common/extensions/api/system_cpu.h" + +namespace extensions { + +class SystemCpuGetInfoFunction : public AsyncExtensionFunction { + public: + DECLARE_EXTENSION_FUNCTION("system.cpu.getInfo", SYSTEM_CPU_GETINFO) + SystemCpuGetInfoFunction(); + + private: + virtual ~SystemCpuGetInfoFunction(); + virtual bool RunImpl() OVERRIDE; + void OnGetCpuInfoCompleted(bool success); +}; + +} // namespace extensions + +#endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_CPU_SYSTEM_CPU_API_H_ diff --git a/chrome/browser/extensions/api/system_info_cpu/system_info_cpu_apitest.cc b/chrome/browser/extensions/api/system_cpu/system_cpu_apitest.cc index fcc27d0..ba2f913 100644 --- a/chrome/browser/extensions/api/system_info_cpu/system_info_cpu_apitest.cc +++ b/chrome/browser/extensions/api/system_cpu/system_cpu_apitest.cc @@ -1,15 +1,15 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 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. #include "base/command_line.h" -#include "chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h" +#include "chrome/browser/extensions/api/system_cpu/cpu_info_provider.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/ui_test_utils.h" namespace extensions { -using api::system_info_cpu::CpuInfo; +using api::system_cpu::CpuInfo; const char kExtensionId[] = "lfakdgdkbaleijdcpbfbngfphpmgfdfn"; @@ -28,10 +28,10 @@ class MockCpuInfoProviderImpl : public CpuInfoProvider { virtual ~MockCpuInfoProviderImpl() {} }; -class SystemInfoCpuApiTest: public ExtensionApiTest { +class SystemCpuApiTest: public ExtensionApiTest { public: - SystemInfoCpuApiTest() {} - virtual ~SystemInfoCpuApiTest() {} + SystemCpuApiTest() {} + virtual ~SystemCpuApiTest() {} virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { ExtensionApiTest::SetUpCommandLine(command_line); @@ -44,11 +44,11 @@ class SystemInfoCpuApiTest: public ExtensionApiTest { } }; -IN_PROC_BROWSER_TEST_F(SystemInfoCpuApiTest, Cpu) { +IN_PROC_BROWSER_TEST_F(SystemCpuApiTest, Cpu) { CpuInfoProvider* provider = new MockCpuInfoProviderImpl(); // The provider is owned by the single CpuInfoProvider instance. CpuInfoProvider::InitializeForTesting(provider); - ASSERT_TRUE(RunExtensionTest("systeminfo/cpu")) << message_; + ASSERT_TRUE(RunExtensionTest("system/cpu")) << message_; } } // namespace extensions diff --git a/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h b/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h deleted file mode 100644 index 69c8092..0000000 --- a/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h +++ /dev/null @@ -1,38 +0,0 @@ -// 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. -#ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ -#define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ - -#include <vector> - -#include "base/timer/timer.h" -#include "chrome/browser/extensions/api/system_info/system_info_provider.h" -#include "chrome/common/extensions/api/system_info_cpu.h" - -namespace extensions { - -class CpuInfoProvider - : public SystemInfoProvider<api::system_info_cpu::CpuInfo> { - public: - // Overriden from SystemInfoProvider<CpuInfo>. - virtual bool QueryInfo() OVERRIDE; - - // Return the single shared instance of CpuInfoProvider. - static CpuInfoProvider* Get(); - - const api::system_info_cpu::CpuInfo& cpu_info() const; - - private: - friend class SystemInfoProvider<api::system_info_cpu::CpuInfo>; - friend class MockCpuInfoProviderImpl; - - CpuInfoProvider(); - - virtual ~CpuInfoProvider(); -}; - -} // namespace extensions - -#endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ - diff --git a/chrome/browser/extensions/api/system_info_cpu/system_info_cpu_api.h b/chrome/browser/extensions/api/system_info_cpu/system_info_cpu_api.h deleted file mode 100644 index 8a2fb52..0000000 --- a/chrome/browser/extensions/api/system_info_cpu/system_info_cpu_api.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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. -#ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_SYSTEM_INFO_CPU_API_H_ -#define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_SYSTEM_INFO_CPU_API_H_ - -#include "chrome/browser/extensions/extension_function.h" -#include "chrome/common/extensions/api/system_info_cpu.h" - -namespace extensions { - -class SystemInfoCpuGetFunction : public AsyncExtensionFunction { - public: - DECLARE_EXTENSION_FUNCTION("systemInfo.cpu.get", SYSTEMINFO_CPU_GET) - SystemInfoCpuGetFunction(); - - private: - virtual ~SystemInfoCpuGetFunction(); - virtual bool RunImpl() OVERRIDE; - void OnGetCpuInfoCompleted(bool success); -}; - -} // namespace extensions - -#endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_SYSTEM_INFO_CPU_API_H_ diff --git a/chrome/browser/extensions/extension_function_histogram_value.h b/chrome/browser/extensions/extension_function_histogram_value.h index cf973d7..0bf7f56 100644 --- a/chrome/browser/extensions/extension_function_histogram_value.h +++ b/chrome/browser/extensions/extension_function_histogram_value.h @@ -414,7 +414,7 @@ enum HistogramValue { TTS_ISSPEAKING, BOOKMARKS_REMOVETREE, FILEBROWSERPRIVATE_SEARCHDRIVE, - EXPERIMENTAL_SYSTEMINFO_CPU_GET, + DELETED_EXPERIMENTAL_SYSTEMINFO_CPU_GET, FILEBROWSERPRIVATE_SETPREFERENCES, FONTSETTINGS_SETFONT, SOCKET_GETNETWORKLIST, @@ -540,7 +540,7 @@ enum HistogramValue { MUSICMANAGERPRIVATE_GETDEVICEID, TTS_PAUSE, TTS_RESUME, - SYSTEMINFO_CPU_GET, + DELETED_SYSTEMINFO_CPU_GET, EXPERIMENTAL_SYSTEMINFO_STORAGE_ADDWATCH, EXPERIMENTAL_SYSTEMINFO_STORAGE_REMOVEWATCH, EXPERIMENTAL_SYSTEMINFO_STORAGE_GETALLWATCH, @@ -566,6 +566,7 @@ enum HistogramValue { TYPES_PRIVATE_CHROMEDIRECTSETTING_SET, TYPES_PRIVATE_CHROMEDIRECTSETTING_CLEAR, EXPERIMENTAL_SYSTEMINFO_STORAGE_EJECTDEVICE, + SYSTEM_CPU_GETINFO, ENUM_BOUNDARY // Last entry: Add new entries above. }; diff --git a/chrome/chrome_browser_extensions.gypi b/chrome/chrome_browser_extensions.gypi index 6c7c369..0234a57 100644 --- a/chrome/chrome_browser_extensions.gypi +++ b/chrome/chrome_browser_extensions.gypi @@ -438,15 +438,15 @@ 'browser/extensions/api/sync_file_system/sync_file_system_api.h', 'browser/extensions/api/sync_file_system/sync_file_system_api_helpers.cc', 'browser/extensions/api/sync_file_system/sync_file_system_api_helpers.h', + 'browser/extensions/api/system_cpu/cpu_info_provider.cc', + 'browser/extensions/api/system_cpu/cpu_info_provider.h', + 'browser/extensions/api/system_cpu/system_cpu_api.cc', + 'browser/extensions/api/system_cpu/system_cpu_api.h', 'browser/extensions/api/system_indicator/system_indicator_api.h', 'browser/extensions/api/system_indicator/system_indicator_manager.cc', 'browser/extensions/api/system_indicator/system_indicator_manager.h', 'browser/extensions/api/system_indicator/system_indicator_manager_factory.cc', 'browser/extensions/api/system_indicator/system_indicator_manager_factory.h', - 'browser/extensions/api/system_info_cpu/cpu_info_provider.cc', - 'browser/extensions/api/system_info_cpu/cpu_info_provider.h', - 'browser/extensions/api/system_info_cpu/system_info_cpu_api.cc', - 'browser/extensions/api/system_info_cpu/system_info_cpu_api.h', 'browser/extensions/api/system_info_display/display_info_provider.cc', 'browser/extensions/api/system_info_display/display_info_provider.h', 'browser/extensions/api/system_info_display/display_info_provider_chromeos.cc', @@ -852,8 +852,7 @@ ['include', '^browser/extensions/api/push_messaging/push_messaging_api.cc'], ['include', '^browser/extensions/api/runtime/runtime_api.cc'], ['include', '^browser/extensions/api/storage/.*\.cc'], - ['include', '^browser/extensions/api/system_info_cpu/cpu_info_provider.cc'], - ['include', '^browser/extensions/api/system_info_cpu/cpu_info_provider_android.cc'], + ['include', '^browser/extensions/api/system_cpu/cpu_info_provider.cc'], ['include', '^browser/extensions/api/system_info_storage/storage_info_provider.cc'], ['include', '^browser/extensions/api/tabs/tabs_constants.cc'], ['include', '^browser/extensions/api/web_navigation/frame_navigation_state.cc'], diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 7394cf7..f4213de 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1335,7 +1335,7 @@ 'browser/extensions/api/streams_private/streams_private_apitest.cc', 'browser/extensions/api/sync_file_system/sync_file_system_apitest.cc', 'browser/extensions/api/system_indicator/system_indicator_apitest.cc', - 'browser/extensions/api/system_info_cpu/system_info_cpu_apitest.cc', + 'browser/extensions/api/system_cpu/system_cpu_apitest.cc', 'browser/extensions/api/system_info_display/system_info_display_apitest.cc', 'browser/extensions/api/system_info_memory/system_info_memory_apitest.cc', 'browser/extensions/api/system_info_storage/system_info_storage_apitest.cc', diff --git a/chrome/common/extensions/api/_api_features.json b/chrome/common/extensions/api/_api_features.json index 2ff896e..07ff307 100644 --- a/chrome/common/extensions/api/_api_features.json +++ b/chrome/common/extensions/api/_api_features.json @@ -457,8 +457,8 @@ "dependencies": ["manifest:system_indicator"], "contexts": ["blessed_extension"] }, - "systemInfo.cpu": { - "dependencies": ["permission:systemInfo.cpu"], + "system.cpu": { + "dependencies": ["permission:system.cpu"], "contexts": ["blessed_extension"] }, "systemInfo.display": { diff --git a/chrome/common/extensions/api/_permission_features.json b/chrome/common/extensions/api/_permission_features.json index 4205358..abf28df 100644 --- a/chrome/common/extensions/api/_permission_features.json +++ b/chrome/common/extensions/api/_permission_features.json @@ -525,7 +525,7 @@ "extension_types": ["extension", "packaged_app", "platform_app"], "min_manifest_version": 2 }, - "systemInfo.cpu": { + "system.cpu": { "channel": "dev", "extension_types": [ "extension", "packaged_app", "hosted_app", "platform_app" diff --git a/chrome/common/extensions/api/api.gyp b/chrome/common/extensions/api/api.gyp index 153cdab..7d7bbee 100644 --- a/chrome/common/extensions/api/api.gyp +++ b/chrome/common/extensions/api/api.gyp @@ -92,7 +92,7 @@ 'storage.json', 'sync_file_system.idl', 'system_indicator.idl', - 'system_info_cpu.idl', + 'system_cpu.idl', 'system_info_display.idl', 'system_private.json', 'tab_capture.idl', diff --git a/chrome/common/extensions/api/system_info_cpu.idl b/chrome/common/extensions/api/system_cpu.idl index cb54340..0516679 100644 --- a/chrome/common/extensions/api/system_info_cpu.idl +++ b/chrome/common/extensions/api/system_cpu.idl @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Use the <code>systemInfo.cpu</code> API to query CPU metadata. -namespace systemInfo.cpu { +// Use the <code>system.cpu</code> API to query CPU metadata. +namespace system.cpu { dictionary CpuInfo { // The number of logical processors. @@ -18,6 +18,6 @@ namespace systemInfo.cpu { interface Functions { // Queries basic CPU information of the system. - static void get(CpuInfoCallback callback); + static void getInfo(CpuInfoCallback callback); }; }; diff --git a/chrome/common/extensions/docs/templates/public/apps/redirects.json b/chrome/common/extensions/docs/templates/public/apps/redirects.json index fea5a4c..023eb7b 100644 --- a/chrome/common/extensions/docs/templates/public/apps/redirects.json +++ b/chrome/common/extensions/docs/templates/public/apps/redirects.json @@ -1,5 +1,6 @@ { "": "about_apps.html", "index.html": "about_apps.html", - "app_csp.html": "contentSecurityPolicy.html" + "app_csp.html": "contentSecurityPolicy.html", + "systemInfo_cpu.html": "system_cpu.html" } diff --git a/chrome/common/extensions/docs/templates/public/apps/systemInfo_cpu.html b/chrome/common/extensions/docs/templates/public/apps/systemInfo_cpu.html deleted file mode 100644 index 8933b49..0000000 --- a/chrome/common/extensions/docs/templates/public/apps/systemInfo_cpu.html +++ /dev/null @@ -1 +0,0 @@ -{{+partials.standard_apps_api api:apis.system_info_cpu}} diff --git a/chrome/common/extensions/docs/templates/public/apps/system_cpu.html b/chrome/common/extensions/docs/templates/public/apps/system_cpu.html new file mode 100644 index 0000000..996fc61 --- /dev/null +++ b/chrome/common/extensions/docs/templates/public/apps/system_cpu.html @@ -0,0 +1 @@ +{{+partials.standard_apps_api api:apis.system_cpu}} diff --git a/chrome/common/extensions/docs/templates/public/extensions/redirects.json b/chrome/common/extensions/docs/templates/public/extensions/redirects.json index 38431d7..c912230 100644 --- a/chrome/common/extensions/docs/templates/public/extensions/redirects.json +++ b/chrome/common/extensions/docs/templates/public/extensions/redirects.json @@ -1,3 +1,4 @@ { - "": "index.html" + "": "index.html", + "systemInfo_cpu.html": "system_cpu.html" } diff --git a/chrome/common/extensions/docs/templates/public/extensions/systemInfo_cpu.html b/chrome/common/extensions/docs/templates/public/extensions/systemInfo_cpu.html deleted file mode 100644 index 2765427..0000000 --- a/chrome/common/extensions/docs/templates/public/extensions/systemInfo_cpu.html +++ /dev/null @@ -1 +0,0 @@ -{{+partials.standard_extensions_api api:apis.system_info_cpu}} diff --git a/chrome/common/extensions/docs/templates/public/extensions/system_cpu.html b/chrome/common/extensions/docs/templates/public/extensions/system_cpu.html new file mode 100644 index 0000000..8a77fee --- /dev/null +++ b/chrome/common/extensions/docs/templates/public/extensions/system_cpu.html @@ -0,0 +1 @@ +{{+partials.standard_extensions_api api:apis.system_cpu}} diff --git a/chrome/common/extensions/permissions/api_permission.h b/chrome/common/extensions/permissions/api_permission.h index e33f3cd..f27281c 100644 --- a/chrome/common/extensions/permissions/api_permission.h +++ b/chrome/common/extensions/permissions/api_permission.h @@ -135,7 +135,7 @@ class APIPermission { kWebSocketProxyPrivate, kWebstorePrivate, kWebView, - kSystemInfoCpu, + kSystemCpu, kSystemInfoMemory, kEnumBoundary }; diff --git a/chrome/common/extensions/permissions/chrome_api_permissions.cc b/chrome/common/extensions/permissions/chrome_api_permissions.cc index ccb4448..8f5bc0b 100644 --- a/chrome/common/extensions/permissions/chrome_api_permissions.cc +++ b/chrome/common/extensions/permissions/chrome_api_permissions.cc @@ -283,7 +283,7 @@ std::vector<APIPermissionInfo*> ChromeAPIPermissions::GetAllPermissions() APIPermissionInfo::kFlagNone, IDS_EXTENSION_PROMPT_WARNING_SYSTEM_INDICATOR, PermissionMessage::kSystemIndicator }, - { APIPermission::kSystemInfoCpu, "systemInfo.cpu" }, + { APIPermission::kSystemCpu, "system.cpu" }, { APIPermission::kSystemInfoMemory, "systemInfo.memory" }, { APIPermission::kSystemInfoDisplay, "systemInfo.display" }, { APIPermission::kPointerLock, "pointerLock" }, diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc index 28f2427..5dbdd36 100644 --- a/chrome/common/extensions/permissions/permission_set_unittest.cc +++ b/chrome/common/extensions/permissions/permission_set_unittest.cc @@ -647,7 +647,7 @@ TEST(PermissionsTest, PermissionMessages) { skip.insert(APIPermission::kSessionRestore); skip.insert(APIPermission::kScreensaver); skip.insert(APIPermission::kStorage); - skip.insert(APIPermission::kSystemInfoCpu); + skip.insert(APIPermission::kSystemCpu); skip.insert(APIPermission::kSystemInfoMemory); skip.insert(APIPermission::kSystemInfoDisplay); skip.insert(APIPermission::kTts); diff --git a/chrome/test/data/extensions/api_test/systeminfo/cpu/manifest.json b/chrome/test/data/extensions/api_test/system/cpu/manifest.json index 3121d43..19de318 100644 --- a/chrome/test/data/extensions/api_test/systeminfo/cpu/manifest.json +++ b/chrome/test/data/extensions/api_test/system/cpu/manifest.json @@ -1,10 +1,10 @@ { // extension id: lfakdgdkbaleijdcpbfbngfphpmgfdfn "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDQ3waZNZ2qInxrEiUFPCx26uyf5BdWPHlvZYX6BS8v70Ps7yPJzOkXbQ1shS1sKGnooLljTNfeWW6vyBx9B5VQqKvPcdHHwhVNumKEJztVkszskPWVaZybVtckQq/WvqJlEgatsgNMoXnF+WC4cm6fSD/m2esXd3zZH8SB1Z24cwIDAQAB", - "name": "systemInfo.cpu test", + "name": "system.cpu test", "version": "1.0", - "description": "Test systemInfo.cpu API", - "permissions": ["systemInfo.cpu"], + "description": "Test system.cpu API", + "permissions": ["system.cpu"], "app": { "background": { "scripts": ["test_cpu_api.js"] diff --git a/chrome/test/data/extensions/api_test/systeminfo/cpu/test_cpu_api.js b/chrome/test/data/extensions/api_test/system/cpu/test_cpu_api.js index 9a4874b..93bad4a 100644 --- a/chrome/test/data/extensions/api_test/systeminfo/cpu/test_cpu_api.js +++ b/chrome/test/data/extensions/api_test/system/cpu/test_cpu_api.js @@ -1,14 +1,14 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 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. -// systeminfo.cpu api test -// browser_tests.exe --gtest_filter=SystemInfoCpuApiTest.* +// system.cpu.getInfo api test +// browser_tests.exe --gtest_filter=SystemCpuApiTest.* chrome.test.runTests([ function testGet() { for(var i = 0; i < 20; ++i) { - chrome.systemInfo.cpu.get(chrome.test.callbackPass(function(result) { + chrome.system.cpu.getInfo(chrome.test.callbackPass(function(result) { chrome.test.assertEq(4, result.numOfProcessors); chrome.test.assertEq("x86", result.archName); chrome.test.assertEq("unknown", result.modelName); diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index b071c7b..6e46b17 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -15782,6 +15782,7 @@ other types of suffix sets. <int value="503" label="TYPES_PRIVATE_CHROMEDIRECTSETTING_GET"/> <int value="504" label="TYPES_PRIVATE_CHROMEDIRECTSETTING_SET"/> <int value="505" label="TYPES_PRIVATE_CHROMEDIRECTSETTING_CLEAR"/> + <int value="506" label="SYSTEM_CPU_GETINFO"/> </enum> <enum name="ExtensionInstallCause" type="int"> |