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

Side by Side Diff: chrome/browser/load_library_perf_test.cc

Issue 864943002: Replaces instances of the deprecated TimeTicks::HighResNow() with TimeTicks::Now(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More changes based on review comments. Created 5 years, 11 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 | « cc/trees/proxy_timing_history.cc ('k') | chrome/browser/net/network_stats.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 #include "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/scoped_native_library.h" 8 #include "base/scoped_native_library.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 11 matching lines...) Expand all
22 int64 size = 0; 22 int64 size = 0;
23 ASSERT_TRUE(base::GetFileSize(library_path, &size)); 23 ASSERT_TRUE(base::GetFileSize(library_path, &size));
24 perf_test::PrintResult("library_size", 24 perf_test::PrintResult("library_size",
25 "", 25 "",
26 library_name.AsUTF8Unsafe(), 26 library_name.AsUTF8Unsafe(),
27 static_cast<size_t>(size), 27 static_cast<size_t>(size),
28 "bytes", 28 "bytes",
29 true); 29 true);
30 30
31 base::NativeLibraryLoadError error; 31 base::NativeLibraryLoadError error;
32 base::TimeTicks start = base::TimeTicks::HighResNow(); 32 base::TimeTicks start = base::TimeTicks::Now();
33 base::NativeLibrary native_library = 33 base::NativeLibrary native_library =
34 base::LoadNativeLibrary(library_path, &error); 34 base::LoadNativeLibrary(library_path, &error);
35 double delta = (base::TimeTicks::HighResNow() - start).InMillisecondsF(); 35 double delta = (base::TimeTicks::Now() - start).InMillisecondsF();
36 ASSERT_TRUE(native_library) << "Error loading library: " << error.ToString(); 36 ASSERT_TRUE(native_library) << "Error loading library: " << error.ToString();
37 base::UnloadNativeLibrary(native_library); 37 base::UnloadNativeLibrary(native_library);
38 perf_test::PrintResult("time_to_load_library", 38 perf_test::PrintResult("time_to_load_library",
39 "", 39 "",
40 library_name.AsUTF8Unsafe(), 40 library_name.AsUTF8Unsafe(),
41 delta, 41 delta,
42 "ms", 42 "ms",
43 true); 43 true);
44 } 44 }
45 45
(...skipping 29 matching lines...) Expand all
75 75
76 TEST(LoadCDMPerfTest, ExternalClearKeyAdapter) { 76 TEST(LoadCDMPerfTest, ExternalClearKeyAdapter) {
77 #if defined(OS_MACOSX) 77 #if defined(OS_MACOSX)
78 MeasureSizeAndTimeToLoadNativeLibrary( 78 MeasureSizeAndTimeToLoadNativeLibrary(
79 base::FilePath::FromUTF8Unsafe("clearkeycdmadapter.plugin")); 79 base::FilePath::FromUTF8Unsafe("clearkeycdmadapter.plugin"));
80 #else 80 #else
81 MeasureSizeAndTimeToLoadNativeLibraryByBaseName("clearkeycdmadapter"); 81 MeasureSizeAndTimeToLoadNativeLibraryByBaseName("clearkeycdmadapter");
82 #endif // defined(OS_MACOSX) 82 #endif // defined(OS_MACOSX)
83 } 83 }
84 #endif // defined(ENABLE_PEPPER_CDMS) 84 #endif // defined(ENABLE_PEPPER_CDMS)
OLDNEW
« no previous file with comments | « cc/trees/proxy_timing_history.cc ('k') | chrome/browser/net/network_stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698