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

Side by Side Diff: chrome/browser/metrics/plugin_metrics_provider.cc

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change Created 4 years, 4 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
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 "chrome/browser/metrics/plugin_metrics_provider.h" 5 #include "chrome/browser/metrics/plugin_metrics_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 const base::Closure& done_callback, 327 const base::Closure& done_callback,
328 const std::vector<content::WebPluginInfo>& plugins) { 328 const std::vector<content::WebPluginInfo>& plugins) {
329 plugins_ = plugins; 329 plugins_ = plugins;
330 done_callback.Run(); 330 done_callback.Run();
331 } 331 }
332 332
333 PluginMetricsProvider::ChildProcessStats& 333 PluginMetricsProvider::ChildProcessStats&
334 PluginMetricsProvider::GetChildProcessStats( 334 PluginMetricsProvider::GetChildProcessStats(
335 const content::ChildProcessData& data) { 335 const content::ChildProcessData& data) {
336 const base::string16& child_name = data.name; 336 const base::string16& child_name = data.name;
337 if (!ContainsKey(child_process_stats_buffer_, child_name)) { 337 if (!base::ContainsKey(child_process_stats_buffer_, child_name)) {
338 child_process_stats_buffer_[child_name] = 338 child_process_stats_buffer_[child_name] =
339 ChildProcessStats(data.process_type); 339 ChildProcessStats(data.process_type);
340 } 340 }
341 return child_process_stats_buffer_[child_name]; 341 return child_process_stats_buffer_[child_name];
342 } 342 }
343 343
344 void PluginMetricsProvider::BrowserChildProcessHostConnected( 344 void PluginMetricsProvider::BrowserChildProcessHostConnected(
345 const content::ChildProcessData& data) { 345 const content::ChildProcessData& data) {
346 GetChildProcessStats(data).process_launches++; 346 GetChildProcessStats(data).process_launches++;
347 RecordCurrentStateWithDelay(kRecordStateDelayMs); 347 RecordCurrentStateWithDelay(kRecordStateDelayMs);
(...skipping 29 matching lines...) Expand all
377 } 377 }
378 378
379 bool PluginMetricsProvider::RecordCurrentStateIfPending() { 379 bool PluginMetricsProvider::RecordCurrentStateIfPending() {
380 if (!weak_ptr_factory_.HasWeakPtrs()) 380 if (!weak_ptr_factory_.HasWeakPtrs())
381 return false; 381 return false;
382 382
383 weak_ptr_factory_.InvalidateWeakPtrs(); 383 weak_ptr_factory_.InvalidateWeakPtrs();
384 RecordCurrentState(); 384 RecordCurrentState();
385 return true; 385 return true;
386 } 386 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698