Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: extensions/browser/api/system_memory/system_memory_api.cc

Issue 1226353004: Generate all extension schema namespaces as "api" and instead vary the generated bundle names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/api/system_memory/system_memory_api.h" 5 #include "extensions/browser/api/system_memory/system_memory_api.h"
6 6
7 #include "extensions/browser/api/system_memory/memory_info_provider.h" 7 #include "extensions/browser/api/system_memory/memory_info_provider.h"
8 8
9 namespace extensions { 9 namespace extensions {
10 10
11 using core_api::system_memory::MemoryInfo; 11 using api::system_memory::MemoryInfo;
12 12
13 SystemMemoryGetInfoFunction::SystemMemoryGetInfoFunction() { 13 SystemMemoryGetInfoFunction::SystemMemoryGetInfoFunction() {
14 } 14 }
15 15
16 SystemMemoryGetInfoFunction::~SystemMemoryGetInfoFunction() { 16 SystemMemoryGetInfoFunction::~SystemMemoryGetInfoFunction() {
17 } 17 }
18 18
19 bool SystemMemoryGetInfoFunction::RunAsync() { 19 bool SystemMemoryGetInfoFunction::RunAsync() {
20 MemoryInfoProvider::Get()->StartQueryInfo( 20 MemoryInfoProvider::Get()->StartQueryInfo(
21 base::Bind(&SystemMemoryGetInfoFunction::OnGetMemoryInfoCompleted, this)); 21 base::Bind(&SystemMemoryGetInfoFunction::OnGetMemoryInfoCompleted, this));
22 return true; 22 return true;
23 } 23 }
24 24
25 void SystemMemoryGetInfoFunction::OnGetMemoryInfoCompleted(bool success) { 25 void SystemMemoryGetInfoFunction::OnGetMemoryInfoCompleted(bool success) {
26 if (success) 26 if (success)
27 SetResult(MemoryInfoProvider::Get()->memory_info().ToValue().release()); 27 SetResult(MemoryInfoProvider::Get()->memory_info().ToValue().release());
28 else 28 else
29 SetError("Error occurred when querying memory information."); 29 SetError("Error occurred when querying memory information.");
30 SendResponse(success); 30 SendResponse(success);
31 } 31 }
32 32
33 } // namespace extensions 33 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698