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

Side by Side Diff: src/api.cc

Issue 196383015: Move profiler callback interfaces from v8.h to v8-profiler.h (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « include/v8-profiler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 7115 matching lines...) Expand 10 before | Expand all | Expand 10 after
7126 SnapshotObjectId HeapSnapshot::GetMaxSnapshotJSObjectId() const { 7126 SnapshotObjectId HeapSnapshot::GetMaxSnapshotJSObjectId() const {
7127 return ToInternal(this)->max_snapshot_js_object_id(); 7127 return ToInternal(this)->max_snapshot_js_object_id();
7128 } 7128 }
7129 7129
7130 7130
7131 void HeapSnapshot::Serialize(OutputStream* stream, 7131 void HeapSnapshot::Serialize(OutputStream* stream,
7132 HeapSnapshot::SerializationFormat format) const { 7132 HeapSnapshot::SerializationFormat format) const {
7133 Utils::ApiCheck(format == kJSON, 7133 Utils::ApiCheck(format == kJSON,
7134 "v8::HeapSnapshot::Serialize", 7134 "v8::HeapSnapshot::Serialize",
7135 "Unknown serialization format"); 7135 "Unknown serialization format");
7136 Utils::ApiCheck(stream->GetOutputEncoding() == OutputStream::kAscii,
7137 "v8::HeapSnapshot::Serialize",
7138 "Unsupported output encoding");
7139 Utils::ApiCheck(stream->GetChunkSize() > 0, 7136 Utils::ApiCheck(stream->GetChunkSize() > 0,
7140 "v8::HeapSnapshot::Serialize", 7137 "v8::HeapSnapshot::Serialize",
7141 "Invalid stream chunk size"); 7138 "Invalid stream chunk size");
7142 i::HeapSnapshotJSONSerializer serializer(ToInternal(this)); 7139 i::HeapSnapshotJSONSerializer serializer(ToInternal(this));
7143 serializer.Serialize(stream); 7140 serializer.Serialize(stream);
7144 } 7141 }
7145 7142
7146 7143
7147 int HeapProfiler::GetSnapshotCount() { 7144 int HeapProfiler::GetSnapshotCount() {
7148 return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotsCount(); 7145 return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotsCount();
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
7456 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7453 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7457 Address callback_address = 7454 Address callback_address =
7458 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7455 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7459 VMState<EXTERNAL> state(isolate); 7456 VMState<EXTERNAL> state(isolate);
7460 ExternalCallbackScope call_scope(isolate, callback_address); 7457 ExternalCallbackScope call_scope(isolate, callback_address);
7461 callback(info); 7458 callback(info);
7462 } 7459 }
7463 7460
7464 7461
7465 } } // namespace v8::internal 7462 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698