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

Side by Side Diff: base/metrics/stats_table.cc

Issue 368133002: Fixes for re-enabling more MSVC level 4 warnings: base/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build, attempt 2 Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « base/i18n/break_iterator.cc ('k') | base/process/kill_win.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/metrics/stats_table.h" 5 #include "base/metrics/stats_table.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "base/process/process_handle.h" 10 #include "base/process/process_handle.h"
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 471
472 int* StatsTable::FindLocation(const char* name) { 472 int* StatsTable::FindLocation(const char* name) {
473 // Get the static StatsTable 473 // Get the static StatsTable
474 StatsTable *table = StatsTable::current(); 474 StatsTable *table = StatsTable::current();
475 if (!table) 475 if (!table)
476 return NULL; 476 return NULL;
477 477
478 // Get the slot for this thread. Try to register 478 // Get the slot for this thread. Try to register
479 // it if none exists. 479 // it if none exists.
480 int slot = table->GetSlot(); 480 int slot = table->GetSlot();
481 if (!slot && !(slot = table->RegisterThread(std::string()))) 481 if (!slot)
482 slot = table->RegisterThread(std::string());
483 if (!slot)
482 return NULL; 484 return NULL;
483 485
484 // Find the counter id for the counter. 486 // Find the counter id for the counter.
485 std::string str_name(name); 487 std::string str_name(name);
486 int counter = table->FindCounter(str_name); 488 int counter = table->FindCounter(str_name);
487 489
488 // Now we can find the location in the table. 490 // Now we can find the location in the table.
489 return table->GetLocation(counter, slot); 491 return table->GetLocation(counter, slot);
490 } 492 }
491 493
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 608
607 #if defined(OS_POSIX) 609 #if defined(OS_POSIX)
608 SharedMemoryHandle StatsTable::GetSharedMemoryHandle() const { 610 SharedMemoryHandle StatsTable::GetSharedMemoryHandle() const {
609 if (!internal_) 611 if (!internal_)
610 return SharedMemory::NULLHandle(); 612 return SharedMemory::NULLHandle();
611 return internal_->shared_memory()->handle(); 613 return internal_->shared_memory()->handle();
612 } 614 }
613 #endif 615 #endif
614 616
615 } // namespace base 617 } // namespace base
OLDNEW
« no previous file with comments | « base/i18n/break_iterator.cc ('k') | base/process/kill_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698