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

Side by Side Diff: base/profiler/stack_sampling_profiler_unittest.cc

Issue 1459033003: avoid 'may be used uninitialized' warnings in stack_sampling_profiler_unittest.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <cstdlib> 5 #include <cstdlib>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 ASSERT_TRUE(PathService::Get(DIR_EXE, &other_library_path)); 265 ASSERT_TRUE(PathService::Get(DIR_EXE, &other_library_path));
266 other_library_path = other_library_path.Append(FilePath::FromUTF16Unsafe( 266 other_library_path = other_library_path.Append(FilePath::FromUTF16Unsafe(
267 GetNativeLibraryName(ASCIIToUTF16( 267 GetNativeLibraryName(ASCIIToUTF16(
268 "base_profiler_test_support_library")))); 268 "base_profiler_test_support_library"))));
269 NativeLibraryLoadError load_error; 269 NativeLibraryLoadError load_error;
270 *library = LoadNativeLibrary(other_library_path, &load_error); 270 *library = LoadNativeLibrary(other_library_path, &load_error);
271 ASSERT_TRUE(*library) << "error loading " << other_library_path.value() 271 ASSERT_TRUE(*library) << "error loading " << other_library_path.value()
272 << ": " << load_error.ToString(); 272 << ": " << load_error.ToString();
273 }; 273 };
274 274
275 NativeLibrary library; 275 NativeLibrary library = nullptr;
276 load(&library); 276 load(&library);
277 return library; 277 return library;
278 } 278 }
279 279
280 // Unloads |library| and returns when it has completed unloading. Unloading a 280 // Unloads |library| and returns when it has completed unloading. Unloading a
281 // library is asynchronous on Windows, so simply calling UnloadNativeLibrary() 281 // library is asynchronous on Windows, so simply calling UnloadNativeLibrary()
282 // is insufficient to ensure it's been unloaded. 282 // is insufficient to ensure it's been unloaded.
283 void SynchronousUnloadNativeLibrary(NativeLibrary library) { 283 void SynchronousUnloadNativeLibrary(NativeLibrary library) {
284 UnloadNativeLibrary(library); 284 UnloadNativeLibrary(library);
285 #if defined(OS_WIN) 285 #if defined(OS_WIN)
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 #if defined(STACK_SAMPLING_PROFILER_SUPPORTED) 954 #if defined(STACK_SAMPLING_PROFILER_SUPPORTED)
955 #define MAYBE_UnloadedLibrary UnloadedLibrary 955 #define MAYBE_UnloadedLibrary UnloadedLibrary
956 #else 956 #else
957 #define MAYBE_UnloadedLibrary DISABLED_UnloadedLibrary 957 #define MAYBE_UnloadedLibrary DISABLED_UnloadedLibrary
958 #endif 958 #endif
959 TEST(StackSamplingProfilerTest, MAYBE_UnloadedLibrary) { 959 TEST(StackSamplingProfilerTest, MAYBE_UnloadedLibrary) {
960 TestLibraryUnload(true); 960 TestLibraryUnload(true);
961 } 961 }
962 962
963 } // namespace base 963 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698