Revert 285173 "Removed InProcessBrowserTest::CleanUpOnMainThread()"
[chromium-blink-merge.git] / chrome / browser / extensions / api / system_memory / system_memory_api.cc
blobf0c4a24bba67744e06d9ea34175a96afa3f0c0dd
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 "chrome/browser/extensions/api/system_memory/system_memory_api.h"
7 #include "chrome/browser/extensions/api/system_memory/memory_info_provider.h"
9 namespace extensions {
11 using api::system_memory::MemoryInfo;
13 SystemMemoryGetInfoFunction::SystemMemoryGetInfoFunction() {}
15 SystemMemoryGetInfoFunction::~SystemMemoryGetInfoFunction() {}
17 bool SystemMemoryGetInfoFunction::RunAsync() {
18 MemoryInfoProvider::Get()->StartQueryInfo(
19 base::Bind(&SystemMemoryGetInfoFunction::OnGetMemoryInfoCompleted, this));
20 return true;
23 void SystemMemoryGetInfoFunction::OnGetMemoryInfoCompleted(bool success) {
24 if (success)
25 SetResult(MemoryInfoProvider::Get()->memory_info().ToValue().release());
26 else
27 SetError("Error occurred when querying memory information.");
28 SendResponse(success);
31 } // namespace extensions