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

Unified Diff: mojo/dart/embedder/mojo_dart_state.h

Issue 1410053002: Dart: Uses a pre-allocated buffer for message pipe query and read. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | mojo/dart/embedder/mojo_natives.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/embedder/mojo_dart_state.h
diff --git a/mojo/dart/embedder/mojo_dart_state.h b/mojo/dart/embedder/mojo_dart_state.h
index 6965aa35ef154c7a1ffc355dc38d9a964afd1a6f..e08218b13f9a66d0c0638db5ddc2b61fae8efa42 100644
--- a/mojo/dart/embedder/mojo_dart_state.h
+++ b/mojo/dart/embedder/mojo_dart_state.h
@@ -7,6 +7,7 @@
#include <set>
#include <string>
+#include <vector>
#include "base/callback.h"
#include "base/macros.h"
@@ -44,9 +45,9 @@ class MojoDartState : public tonic::DartState {
const IsolateCallbacks& callbacks() const { return callbacks_; }
const std::string& script_uri() const { return script_uri_; }
const std::string& package_root() const { return package_root_; }
- std::set<MojoHandle>& unclosed_handles() {
- return unclosed_handles_;
- }
+ std::set<MojoHandle>& unclosed_handles() { return unclosed_handles_; }
+ std::vector<uint8_t>& message_data() { return message_data_; }
+ std::vector<uint32_t>& message_handles() { return message_handles_; }
const std::set<MojoHandle>& unclosed_handles() const {
return unclosed_handles_;
@@ -103,6 +104,10 @@ class MojoDartState : public tonic::DartState {
std::set<MojoHandle> unclosed_handles_;
std::unique_ptr<tonic::DartLibraryProvider> library_provider_;
mojo::NetworkServicePtr network_service_;
+
+ // Buffers for sending/receiving messages.
+ std::vector<uint8_t> message_data_;
+ std::vector<uint32_t> message_handles_;
};
} // namespace dart
« no previous file with comments | « no previous file | mojo/dart/embedder/mojo_natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698