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

Side by Side Diff: chrome/browser/task_manager/sampling/shared_sampler_win.cc

Issue 2293293002: Two TaskManager tests are flaky on debug due to a DCHECK in SharedSampler (Closed)
Patch Set: Created 4 years, 3 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 | « 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/task_manager/sampling/shared_sampler.h" 5 #include "chrome/browser/task_manager/sampling/shared_sampler.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <winternl.h> 8 #include <winternl.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 return; 349 return;
350 350
351 callbacks_map_.erase(process_id); 351 callbacks_map_.erase(process_id);
352 352
353 if (callbacks_map_.empty()) 353 if (callbacks_map_.empty())
354 ClearState(); 354 ClearState();
355 } 355 }
356 356
357 void SharedSampler::Refresh(base::ProcessId process_id, int64_t refresh_flags) { 357 void SharedSampler::Refresh(base::ProcessId process_id, int64_t refresh_flags) {
358 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 358 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
359 DCHECK(callbacks_map_.find(process_id) != callbacks_map_.end());
360 DCHECK_NE(0, refresh_flags & GetSupportedFlags()); 359 DCHECK_NE(0, refresh_flags & GetSupportedFlags());
361 360
362 if (process_id == 0) 361 if (process_id == 0)
363 return; 362 return;
364 363
364 DCHECK(callbacks_map_.find(process_id) != callbacks_map_.end());
365
365 if (refresh_flags_ == 0) { 366 if (refresh_flags_ == 0) {
366 base::PostTaskAndReplyWithResult( 367 base::PostTaskAndReplyWithResult(
367 blocking_pool_runner_.get(), FROM_HERE, 368 blocking_pool_runner_.get(), FROM_HERE,
368 base::Bind(&SharedSampler::RefreshOnWorkerThread, this), 369 base::Bind(&SharedSampler::RefreshOnWorkerThread, this),
369 base::Bind(&SharedSampler::OnRefreshDone, this)); 370 base::Bind(&SharedSampler::OnRefreshDone, this));
370 } else { 371 } else {
371 // A group of consecutive Refresh calls should all specify the same refresh 372 // A group of consecutive Refresh calls should all specify the same refresh
372 // flags. 373 // flags.
373 DCHECK_EQ(refresh_flags, refresh_flags_); 374 DCHECK_EQ(refresh_flags, refresh_flags_);
374 } 375 }
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 callback_entry.second.on_physical_memory.Run(physical_bytes); 628 callback_entry.second.on_physical_memory.Run(physical_bytes);
628 } 629 }
629 } 630 }
630 631
631 // Reset refresh_results_ to trigger RefreshOnWorkerThread next time Refresh 632 // Reset refresh_results_ to trigger RefreshOnWorkerThread next time Refresh
632 // is called. 633 // is called.
633 refresh_flags_ = 0; 634 refresh_flags_ = 0;
634 } 635 }
635 636
636 } // namespace task_manager 637 } // namespace task_manager
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