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

Unified Diff: mojo/edk/system/broker_host.cc

Issue 2488253003: Removing 16MB size limit for Mojo buffers. (Closed)
Patch Set: Addressing @rockot comment Created 4 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/broker_host.cc
diff --git a/mojo/edk/system/broker_host.cc b/mojo/edk/system/broker_host.cc
index a5a5f9cf04b7973a6c12aa05ae55e9bd9774b4a1..28d5157321dababce0a9a0e53efdee16328f3232 100644
--- a/mojo/edk/system/broker_host.cc
+++ b/mojo/edk/system/broker_host.cc
@@ -19,14 +19,6 @@
namespace mojo {
namespace edk {
-namespace {
-
-// To prevent abuse, limit the maximum size of shared memory buffers.
-// TODO(rockot): Re-consider this limit, or do something smarter.
-const uint32_t kMaxSharedBufferSize = 16 * 1024 * 1024;
-
-} // namespace
-
BrokerHost::BrokerHost(base::ProcessHandle client_process,
ScopedPlatformHandle platform_handle)
#if defined(OS_WIN)
@@ -107,17 +99,13 @@ void BrokerHost::SendNamedChannel(const base::StringPiece16& pipe_name) {
#endif // defined(OS_WIN)
void BrokerHost::OnBufferRequest(uint32_t num_bytes) {
- scoped_refptr<PlatformSharedBuffer> buffer;
scoped_refptr<PlatformSharedBuffer> read_only_buffer;
- if (num_bytes <= kMaxSharedBufferSize) {
- buffer = PlatformSharedBuffer::Create(num_bytes);
- if (buffer)
- read_only_buffer = buffer->CreateReadOnlyDuplicate();
- if (!read_only_buffer)
- buffer = nullptr;
- } else {
- LOG(ERROR) << "Shared buffer request too large: " << num_bytes;
- }
+ scoped_refptr<PlatformSharedBuffer> buffer =
+ PlatformSharedBuffer::Create(num_bytes);
+ if (buffer)
+ read_only_buffer = buffer->CreateReadOnlyDuplicate();
+ if (!read_only_buffer)
+ buffer = nullptr;
Channel::MessagePtr message = CreateBrokerMessage(
BrokerMessageType::BUFFER_RESPONSE, buffer ? 2 : 0, nullptr);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698