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

Unified Diff: runtime/vm/code_observers.cc

Issue 11442024: Unify specification of file open, close, and write callbacks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | « runtime/include/dart_api.h ('k') | runtime/vm/dart.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_observers.cc
diff --git a/runtime/vm/code_observers.cc b/runtime/vm/code_observers.cc
index b476a0dd07570138a7ea1949e11a7f01afaf9d76..c537febce943c7edcc0d7f506a39a7f49c3fa8ec 100644
--- a/runtime/vm/code_observers.cc
+++ b/runtime/vm/code_observers.cc
@@ -57,7 +57,7 @@ bool CodeObservers::AreActive() {
class PerfCodeObserver : public CodeObserver {
public:
virtual bool IsActive() const {
- return Dart::perf_events_writer() != NULL;
+ return Dart::perf_events_file() != NULL;
}
virtual void Notify(const char* name,
@@ -65,15 +65,16 @@ class PerfCodeObserver : public CodeObserver {
uword prologue_offset,
uword size,
bool optimized) {
- Dart_FileWriterFunction perf_events_writer = Dart::perf_events_writer();
- ASSERT(perf_events_writer != NULL);
-
const char* format = "%"Px" %"Px" %s%s\n";
const char* marker = optimized ? "*" : "";
intptr_t len = OS::SNPrint(NULL, 0, format, base, size, marker, name);
char* buffer = Isolate::Current()->current_zone()->Alloc<char>(len + 1);
OS::SNPrint(buffer, len + 1, format, base, size, marker, name);
- (*perf_events_writer)(buffer, len);
+ Dart_FileWriteCallback file_write = Isolate::file_write_callback();
+ ASSERT(file_write != NULL);
+ void* file = Dart::perf_events_file();
+ ASSERT(file != NULL);
+ (*file_write)(buffer, len, file);
}
};
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698