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

Unified Diff: mojo/system/shared_buffer_dispatcher.cc

Issue 484893004: Mojo: Make Core own a PlatformSupport, and plumb it through to Channel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 years, 4 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 | « mojo/system/remote_message_pipe_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/shared_buffer_dispatcher.cc
diff --git a/mojo/system/shared_buffer_dispatcher.cc b/mojo/system/shared_buffer_dispatcher.cc
index fc1a66413b8f13cb18684e0b40d3694f4368d6b6..3354904adbc8247dbd106cf930f324ca12d14466 100644
--- a/mojo/system/shared_buffer_dispatcher.cc
+++ b/mojo/system/shared_buffer_dispatcher.cc
@@ -9,8 +9,8 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "mojo/embedder/platform_support.h"
-#include "mojo/embedder/simple_platform_shared_buffer.h" // TODO(vtl): Remove.
#include "mojo/public/c/system/macros.h"
+#include "mojo/system/channel.h"
#include "mojo/system/constants.h"
#include "mojo/system/memory.h"
#include "mojo/system/options_validation.h"
@@ -91,6 +91,8 @@ scoped_refptr<SharedBufferDispatcher> SharedBufferDispatcher::Deserialize(
const void* source,
size_t size,
embedder::PlatformHandleVector* platform_handles) {
+ DCHECK(channel);
+
if (size != sizeof(SerializedSharedBufferDispatcher)) {
LOG(ERROR) << "Invalid serialized shared buffer dispatcher (bad size)";
return scoped_refptr<SharedBufferDispatcher>();
@@ -121,11 +123,8 @@ scoped_refptr<SharedBufferDispatcher> SharedBufferDispatcher::Deserialize(
// Wrapping |platform_handle| in a |ScopedPlatformHandle| means that it'll be
// closed even if creation fails.
- // TODO(vtl): This is obviously wrong -- but we need to have a
- // |PlatformSupport| plumbed through (probably via the |Channel|), and use its
- // |CreateSharedBufferFromHandle()|.
scoped_refptr<embedder::PlatformSharedBuffer> shared_buffer(
- embedder::SimplePlatformSharedBuffer::CreateFromPlatformHandle(
+ channel->platform_support()->CreateSharedBufferFromHandle(
num_bytes, embedder::ScopedPlatformHandle(platform_handle)));
if (!shared_buffer) {
LOG(ERROR)
« no previous file with comments | « mojo/system/remote_message_pipe_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698