Chromium Code Reviews| Index: runtime/bin/eventhandler_win.cc |
| diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc |
| index cb193a640ae6145aea6ebf7c0c87275473572ffd..9e31485a6f4b05d89a309d6df86bbb2d18f5ebef 100644 |
| --- a/runtime/bin/eventhandler_win.cc |
| +++ b/runtime/bin/eventhandler_win.cc |
| @@ -20,6 +20,8 @@ |
| #include "platform/thread.h" |
| +#define BUFFER_SIZE 32 * 1024 |
|
Mads Ager (google)
2013/03/19 15:11:20
Please use a constant as below.
static const int
Søren Gjesse
2013/03/19 15:26:48
Done.
|
| + |
| static const int kInfinityTimeout = -1; |
| static const int kTimeoutId = -1; |
| static const int kShutdownId = -2; |
| @@ -234,7 +236,7 @@ bool Handle::IssueRead() { |
| ScopedLock lock(this); |
| ASSERT(type_ != kListenSocket); |
| ASSERT(pending_read_ == NULL); |
| - IOBuffer* buffer = IOBuffer::AllocateReadBuffer(1024); |
| + IOBuffer* buffer = IOBuffer::AllocateReadBuffer(BUFFER_SIZE); |
| if (SupportsOverlappedIO()) { |
| ASSERT(completion_port_ != INVALID_HANDLE_VALUE); |
| @@ -491,7 +493,7 @@ int Handle::Write(const void* buffer, int num_bytes) { |
| if (SupportsOverlappedIO()) { |
| if (pending_write_ != NULL) return 0; |
| if (completion_port_ == INVALID_HANDLE_VALUE) return 0; |
| - if (num_bytes > 4096) num_bytes = 4096; |
| + if (num_bytes > BUFFER_SIZE) num_bytes = BUFFER_SIZE; |
| pending_write_ = IOBuffer::AllocateWriteBuffer(num_bytes); |
| pending_write_->Write(buffer, num_bytes); |
| if (!IssueWrite()) return -1; |