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

Side by Side Diff: chrome/utility/chrome_content_utility_client.cc

Issue 2080083002: Revert of Deletes mojo::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/renderer/chrome_render_thread_observer.cc ('k') | chrome/utility/image_decoder_impl.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/utility/chrome_content_utility_client.h" 5 #include "chrome/utility/chrome_content_utility_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 class ResourceUsageReporterImpl : public mojom::ResourceUsageReporter { 78 class ResourceUsageReporterImpl : public mojom::ResourceUsageReporter {
79 public: 79 public:
80 explicit ResourceUsageReporterImpl( 80 explicit ResourceUsageReporterImpl(
81 mojo::InterfaceRequest<mojom::ResourceUsageReporter> req) 81 mojo::InterfaceRequest<mojom::ResourceUsageReporter> req)
82 : binding_(this, std::move(req)) {} 82 : binding_(this, std::move(req)) {}
83 ~ResourceUsageReporterImpl() override {} 83 ~ResourceUsageReporterImpl() override {}
84 84
85 private: 85 private:
86 void GetUsageData(const GetUsageDataCallback& callback) override { 86 void GetUsageData(const mojo::Callback<void(mojom::ResourceUsageDataPtr)>&
87 callback) override {
87 mojom::ResourceUsageDataPtr data = mojom::ResourceUsageData::New(); 88 mojom::ResourceUsageDataPtr data = mojom::ResourceUsageData::New();
88 size_t total_heap_size = net::ProxyResolverV8::GetTotalHeapSize(); 89 size_t total_heap_size = net::ProxyResolverV8::GetTotalHeapSize();
89 if (total_heap_size) { 90 if (total_heap_size) {
90 data->reports_v8_stats = true; 91 data->reports_v8_stats = true;
91 data->v8_bytes_allocated = total_heap_size; 92 data->v8_bytes_allocated = total_heap_size;
92 data->v8_bytes_used = net::ProxyResolverV8::GetUsedHeapSize(); 93 data->v8_bytes_used = net::ProxyResolverV8::GetUsedHeapSize();
93 } 94 }
94 callback.Run(std::move(data)); 95 callback.Run(std::move(data));
95 } 96 }
96 97
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 safe_browsing::zip_analyzer::Results results; 305 safe_browsing::zip_analyzer::Results results;
305 safe_browsing::dmg::AnalyzeDMGFile( 306 safe_browsing::dmg::AnalyzeDMGFile(
306 IPC::PlatformFileForTransitToFile(dmg_file), &results); 307 IPC::PlatformFileForTransitToFile(dmg_file), &results);
307 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( 308 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished(
308 results)); 309 results));
309 ReleaseProcessIfNeeded(); 310 ReleaseProcessIfNeeded();
310 } 311 }
311 #endif // defined(OS_MACOSX) 312 #endif // defined(OS_MACOSX)
312 313
313 #endif // defined(FULL_SAFE_BROWSING) 314 #endif // defined(FULL_SAFE_BROWSING)
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_render_thread_observer.cc ('k') | chrome/utility/image_decoder_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698