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

Side by Side Diff: chrome/renderer/chrome_render_thread_observer.cc

Issue 2062333002: mojo::Callback -> base::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 | « chrome/browser/usb/usb_chooser_controller.cc ('k') | components/arc/arc_bridge_service.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/chrome_render_thread_observer.h" 5 #include "chrome/renderer/chrome_render_thread_observer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <memory> 10 #include <memory>
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 usage_data_->v8_bytes_allocated += total_bytes; 158 usage_data_->v8_bytes_allocated += total_bytes;
159 usage_data_->v8_bytes_used += used_bytes; 159 usage_data_->v8_bytes_used += used_bytes;
160 workers_to_go_--; 160 workers_to_go_--;
161 if (!workers_to_go_) 161 if (!workers_to_go_)
162 SendResults(); 162 SendResults();
163 } 163 }
164 164
165 void SendResults() { 165 void SendResults() {
166 if (!callback_.is_null()) 166 if (!callback_.is_null())
167 callback_.Run(std::move(usage_data_)); 167 callback_.Run(std::move(usage_data_));
168 callback_.reset(); 168 callback_.Reset();
169 weak_factory_.InvalidateWeakPtrs(); 169 weak_factory_.InvalidateWeakPtrs();
170 workers_to_go_ = 0; 170 workers_to_go_ = 0;
171 } 171 }
172 172
173 void GetUsageData(const mojo::Callback<void(mojom::ResourceUsageDataPtr)>& 173 void GetUsageData(const mojo::Callback<void(mojom::ResourceUsageDataPtr)>&
174 callback) override { 174 callback) override {
175 DCHECK(callback_.is_null()); 175 DCHECK(callback_.is_null());
176 weak_factory_.InvalidateWeakPtrs(); 176 weak_factory_.InvalidateWeakPtrs();
177 usage_data_ = mojom::ResourceUsageData::New(); 177 usage_data_ = mojom::ResourceUsageData::New();
178 usage_data_->reports_v8_stats = true; 178 usage_data_->reports_v8_stats = true;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 void ChromeRenderThreadObserver::OnSetFieldTrialGroup( 304 void ChromeRenderThreadObserver::OnSetFieldTrialGroup(
305 const std::string& trial_name, 305 const std::string& trial_name,
306 const std::string& group_name) { 306 const std::string& group_name) {
307 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); 307 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name);
308 } 308 }
309 309
310 const RendererContentSettingRules* 310 const RendererContentSettingRules*
311 ChromeRenderThreadObserver::content_setting_rules() const { 311 ChromeRenderThreadObserver::content_setting_rules() const {
312 return &content_setting_rules_; 312 return &content_setting_rules_;
313 } 313 }
OLDNEW
« no previous file with comments | « chrome/browser/usb/usb_chooser_controller.cc ('k') | components/arc/arc_bridge_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698