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

Side by Side Diff: media/cast/test/cast_benchmarks.cc

Issue 819203002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 12 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 | « media/base/pipeline.cc ('k') | media/cast/test/receiver.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This program benchmarks the theoretical throughput of the cast library. 5 // This program benchmarks the theoretical throughput of the cast library.
6 // It runs using a fake clock, simulated network and fake codecs. This allows 6 // It runs using a fake clock, simulated network and fake codecs. This allows
7 // tests to run much faster than real time. 7 // tests to run much faster than real time.
8 // To run the program, run: 8 // To run the program, run:
9 // $ ./out/Release/cast_benchmarks | tee benchmarkoutput.asc 9 // $ ./out/Release/cast_benchmarks | tee benchmarkoutput.asc
10 // This may take a while, when it is done, you can view the data with 10 // This may take a while, when it is done, you can view the data with
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 void Run() { 691 void Run() {
692 // Spanning search. 692 // Spanning search.
693 693
694 std::vector<linked_ptr<base::Thread> > threads; 694 std::vector<linked_ptr<base::Thread> > threads;
695 for (int i = 0; i < 16; i++) { 695 for (int i = 0; i < 16; i++) {
696 threads.push_back(make_linked_ptr(new base::Thread( 696 threads.push_back(make_linked_ptr(new base::Thread(
697 base::StringPrintf("cast_bench_thread_%d", i)))); 697 base::StringPrintf("cast_bench_thread_%d", i))));
698 threads[i]->Start(); 698 threads[i]->Start();
699 } 699 }
700 700
701 if (CommandLine::ForCurrentProcess()->HasSwitch("single-run")) { 701 if (base::CommandLine::ForCurrentProcess()->HasSwitch("single-run")) {
702 SearchVector a; 702 SearchVector a;
703 a.bitrate.base = 100.0; 703 a.bitrate.base = 100.0;
704 a.bitrate.grade = 1.0; 704 a.bitrate.grade = 1.0;
705 a.latency.grade = 1.0; 705 a.latency.grade = 1.0;
706 a.packet_drop.grade = 1.0; 706 a.packet_drop.grade = 1.0;
707 threads[0]->message_loop()->PostTask( 707 threads[0]->message_loop()->PostTask(
708 FROM_HERE, 708 FROM_HERE,
709 base::Bind(base::IgnoreResult(&CastBenchmark::RunOnePoint), 709 base::Bind(base::IgnoreResult(&CastBenchmark::RunOnePoint),
710 base::Unretained(this), 710 base::Unretained(this),
711 a, 711 a,
(...skipping 24 matching lines...) Expand all
736 private: 736 private:
737 BenchmarkCache<MeasuringPoint> cache_; 737 BenchmarkCache<MeasuringPoint> cache_;
738 base::Lock lock_; 738 base::Lock lock_;
739 }; 739 };
740 740
741 } // namespace cast 741 } // namespace cast
742 } // namespace media 742 } // namespace media
743 743
744 int main(int argc, char** argv) { 744 int main(int argc, char** argv) {
745 base::AtExitManager at_exit; 745 base::AtExitManager at_exit;
746 CommandLine::Init(argc, argv); 746 base::CommandLine::Init(argc, argv);
747 media::cast::CastBenchmark benchmark; 747 media::cast::CastBenchmark benchmark;
748 if (getenv("PROFILE_FILE")) { 748 if (getenv("PROFILE_FILE")) {
749 std::string profile_file(getenv("PROFILE_FILE")); 749 std::string profile_file(getenv("PROFILE_FILE"));
750 base::debug::StartProfiling(profile_file); 750 base::debug::StartProfiling(profile_file);
751 benchmark.Run(); 751 benchmark.Run();
752 base::debug::StopProfiling(); 752 base::debug::StopProfiling();
753 } else { 753 } else {
754 benchmark.Run(); 754 benchmark.Run();
755 } 755 }
756 } 756 }
OLDNEW
« no previous file with comments | « media/base/pipeline.cc ('k') | media/cast/test/receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698