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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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/metrics/stats_counters.cc ('k') | base/nix/mime_util_xdg.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/process_util.h" 9 #include "base/process_util.h"
10 #include "base/shared_memory.h" 10 #include "base/shared_memory.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 424
425 int* StatsTable::FindLocation(const char* name) { 425 int* StatsTable::FindLocation(const char* name) {
426 // Get the static StatsTable 426 // Get the static StatsTable
427 StatsTable *table = StatsTable::current(); 427 StatsTable *table = StatsTable::current();
428 if (!table) 428 if (!table)
429 return NULL; 429 return NULL;
430 430
431 // Get the slot for this thread. Try to register 431 // Get the slot for this thread. Try to register
432 // it if none exists. 432 // it if none exists.
433 int slot = table->GetSlot(); 433 int slot = table->GetSlot();
434 if (!slot && !(slot = table->RegisterThread(""))) 434 if (!slot && !(slot = table->RegisterThread(std::string())))
435 return NULL; 435 return NULL;
436 436
437 // Find the counter id for the counter. 437 // Find the counter id for the counter.
438 std::string str_name(name); 438 std::string str_name(name);
439 int counter = table->FindCounter(str_name); 439 int counter = table->FindCounter(str_name);
440 440
441 // Now we can find the location in the table. 441 // Now we can find the location in the table.
442 return table->GetLocation(counter, slot); 442 return table->GetLocation(counter, slot);
443 } 443 }
444 444
445 void StatsTable::UnregisterThread() { 445 void StatsTable::UnregisterThread() {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 static_cast<TLSData*>(tls_index_.Get()); 551 static_cast<TLSData*>(tls_index_.Get());
552 if (!data) 552 if (!data)
553 return NULL; 553 return NULL;
554 554
555 DCHECK(data->slot); 555 DCHECK(data->slot);
556 DCHECK_EQ(data->table, this); 556 DCHECK_EQ(data->table, this);
557 return data; 557 return data;
558 } 558 }
559 559
560 } // namespace base 560 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/stats_counters.cc ('k') | base/nix/mime_util_xdg.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698