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

Side by Side Diff: mojo/edk/js/drain_data.cc

Issue 2623263005: Tag some of Mojo heap allocations for the heap profiler. (Closed)
Patch Set: Synced Created 3 years, 10 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 | « mojo/common/data_pipe_drainer.cc ('k') | mojo/edk/js/waiting_callback.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 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 "mojo/edk/js/drain_data.h" 5 #include "mojo/edk/js/drain_data.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "gin/array_buffer.h" 12 #include "gin/array_buffer.h"
13 #include "gin/converter.h" 13 #include "gin/converter.h"
14 #include "gin/dictionary.h" 14 #include "gin/dictionary.h"
15 #include "gin/per_context_data.h" 15 #include "gin/per_context_data.h"
16 #include "gin/per_isolate_data.h" 16 #include "gin/per_isolate_data.h"
17 #include "mojo/public/cpp/system/core.h" 17 #include "mojo/public/cpp/system/core.h"
18 18
19 namespace mojo { 19 namespace mojo {
20 namespace edk { 20 namespace edk {
21 namespace js { 21 namespace js {
22 22
23 DrainData::DrainData(v8::Isolate* isolate, mojo::Handle handle) 23 DrainData::DrainData(v8::Isolate* isolate, mojo::Handle handle)
24 : isolate_(isolate), handle_(DataPipeConsumerHandle(handle.value())) { 24 : isolate_(isolate),
25 handle_(DataPipeConsumerHandle(handle.value())),
26 handle_watcher_(FROM_HERE) {
25 v8::Handle<v8::Context> context(isolate_->GetCurrentContext()); 27 v8::Handle<v8::Context> context(isolate_->GetCurrentContext());
26 runner_ = gin::PerContextData::From(context)->runner()->GetWeakPtr(); 28 runner_ = gin::PerContextData::From(context)->runner()->GetWeakPtr();
27 29
28 WaitForData(); 30 WaitForData();
29 } 31 }
30 32
31 v8::Handle<v8::Value> DrainData::GetPromise() { 33 v8::Handle<v8::Value> DrainData::GetPromise() {
32 CHECK(resolver_.IsEmpty()); 34 CHECK(resolver_.IsEmpty());
33 v8::Handle<v8::Promise::Resolver> resolver( 35 v8::Handle<v8::Promise::Resolver> resolver(
34 v8::Promise::Resolver::New(isolate_)); 36 v8::Promise::Resolver::New(isolate_));
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 resolver->Resolve(settled_value); 120 resolver->Resolve(settled_value);
119 else 121 else
120 resolver->Reject(settled_value); 122 resolver->Reject(settled_value);
121 123
122 delete this; 124 delete this;
123 } 125 }
124 126
125 } // namespace js 127 } // namespace js
126 } // namespace edk 128 } // namespace edk
127 } // namespace mojo 129 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/common/data_pipe_drainer.cc ('k') | mojo/edk/js/waiting_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698