Reland the ULONG -> SIZE_T change from 317177
[chromium-blink-merge.git] / extensions / browser / api / system_memory / system_memory_api.cc
bloba171d9f230182f06c077b7980fb6162774f3c0be
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "extensions/browser/api/system_memory/system_memory_api.h"
7 #include "extensions/browser/api/system_memory/memory_info_provider.h"
9 namespace extensions {
11 using core_api::system_memory::MemoryInfo;
13 SystemMemoryGetInfoFunction::SystemMemoryGetInfoFunction() {
16 SystemMemoryGetInfoFunction::~SystemMemoryGetInfoFunction() {
19 bool SystemMemoryGetInfoFunction::RunAsync() {
20 MemoryInfoProvider::Get()->StartQueryInfo(
21 base::Bind(&SystemMemoryGetInfoFunction::OnGetMemoryInfoCompleted, this));
22 return true;
25 void SystemMemoryGetInfoFunction::OnGetMemoryInfoCompleted(bool success) {
26 if (success)
27 SetResult(MemoryInfoProvider::Get()->memory_info().ToValue().release());
28 else
29 SetError("Error occurred when querying memory information.");
30 SendResponse(success);
33 } // namespace extensions