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

Unified Diff: ios/web/webui/mojo_facade.mm

Issue 2623263005: Tag some of Mojo heap allocations for the heap profiler. (Closed)
Patch Set: Synced Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/webui/mojo_facade.h ('k') | ipc/ipc_mojo_bootstrap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/webui/mojo_facade.mm
diff --git a/ios/web/webui/mojo_facade.mm b/ios/web/webui/mojo_facade.mm
index bc9b59e031c2fcde9e4a435161377f1c902ad5d8..6b02efb288c5bff1b02cb4f965b7ffdaddbdadc0 100644
--- a/ios/web/webui/mojo_facade.mm
+++ b/ios/web/webui/mojo_facade.mm
@@ -4,12 +4,15 @@
#import "ios/web/webui/mojo_facade.h"
+#include <utility>
+
#import <Foundation/Foundation.h>
#import "base/ios/block_types.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#import "base/mac/bind_objc_block.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#import "ios/web/public/web_state/js/crw_js_injection_evaluator.h"
@@ -256,9 +259,9 @@ std::unique_ptr<base::Value> MojoFacade::HandleSupportWatch(
callback_id, result];
[script_evaluator_ executeJavaScript:script completionHandler:nil];
});
-
- mojo::Watcher& watcher = watchers_[++last_watch_id_];
- watcher.Start(static_cast<mojo::Handle>(handle), signals, callback);
+ mojo::Watcher* watcher = new mojo::Watcher(FROM_HERE);
+ watchers_.insert(std::make_pair(++last_watch_id_, base::WrapUnique(watcher)));
+ watcher->Start(static_cast<mojo::Handle>(handle), signals, callback);
return ValueFromInteger(last_watch_id_);
}
« no previous file with comments | « ios/web/webui/mojo_facade.h ('k') | ipc/ipc_mojo_bootstrap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698