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

Side by Side Diff: runtime/bin/main.cc

Issue 2997013002: Refactor of the GetEmbedderInformation APIs (Closed)
Patch Set: Address comments Created 3 years, 4 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
« no previous file with comments | « runtime/bin/embedded_dart_io.cc ('k') | runtime/bin/process.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include <stdio.h> 5 #include <stdio.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 #include "include/dart_tools_api.h" 10 #include "include/dart_tools_api.h"
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 int64_t data[File::kStatSize]; 1353 int64_t data[File::kStatSize];
1354 File::Stat(url + 7, data); 1354 File::Stat(url + 7, data);
1355 if (data[File::kType] == File::kDoesNotExist) { 1355 if (data[File::kType] == File::kDoesNotExist) {
1356 return true; 1356 return true;
1357 } 1357 }
1358 bool modified = data[File::kModifiedTime] > since; 1358 bool modified = data[File::kModifiedTime] > since;
1359 return modified; 1359 return modified;
1360 } 1360 }
1361 1361
1362 static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { 1362 static void EmbedderInformationCallback(Dart_EmbedderInformation* info) {
1363 int64_t max_rss = Process::MaxRSS();
1364 int64_t current_rss = Process::CurrentRSS();
1365
1366 info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION; 1363 info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION;
1367 info->name = "Dart VM"; 1364 info->name = "Dart VM";
1368 info->max_rss = max_rss >= 0 ? max_rss : 0; 1365 Process::GetRSSInformation(&(info->max_rss), &(info->current_rss));
1369 info->current_rss = current_rss >= 0 ? current_rss : 0;
1370 } 1366 }
1371 1367
1372 static void GenerateAppAOTSnapshot() { 1368 static void GenerateAppAOTSnapshot() {
1373 if (use_blobs) { 1369 if (use_blobs) {
1374 Snapshot::GenerateAppAOTAsBlobs(snapshot_filename); 1370 Snapshot::GenerateAppAOTAsBlobs(snapshot_filename);
1375 } else { 1371 } else {
1376 Snapshot::GenerateAppAOTAsAssembly(snapshot_filename); 1372 Snapshot::GenerateAppAOTAsAssembly(snapshot_filename);
1377 } 1373 }
1378 } 1374 }
1379 1375
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1859 Platform::Exit(Process::GlobalExitCode()); 1855 Platform::Exit(Process::GlobalExitCode());
1860 } 1856 }
1861 1857
1862 } // namespace bin 1858 } // namespace bin
1863 } // namespace dart 1859 } // namespace dart
1864 1860
1865 int main(int argc, char** argv) { 1861 int main(int argc, char** argv) {
1866 dart::bin::main(argc, argv); 1862 dart::bin::main(argc, argv);
1867 UNREACHABLE(); 1863 UNREACHABLE();
1868 } 1864 }
OLDNEW
« no previous file with comments | « runtime/bin/embedded_dart_io.cc ('k') | runtime/bin/process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698