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

Side by Side Diff: chrome/browser/renderer_host/async_resource_handler.h

Issue 335010: Only double the buffer when AsyncResourceHandler's caller fill the buffer. (Closed)
Patch Set: Created 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/renderer_host/async_resource_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_RENDERER_HOST_ASYNC_RESOURCE_HANDLER_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_ASYNC_RESOURCE_HANDLER_H_
6 #define CHROME_BROWSER_RENDERER_HOST_ASYNC_RESOURCE_HANDLER_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_ASYNC_RESOURCE_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/process.h" 10 #include "base/process.h"
(...skipping 28 matching lines...) Expand all
39 static void GlobalCleanup(); 39 static void GlobalCleanup();
40 40
41 private: 41 private:
42 scoped_refptr<SharedIOBuffer> read_buffer_; 42 scoped_refptr<SharedIOBuffer> read_buffer_;
43 ResourceDispatcherHost::Receiver* receiver_; 43 ResourceDispatcherHost::Receiver* receiver_;
44 int process_id_; 44 int process_id_;
45 int routing_id_; 45 int routing_id_;
46 base::ProcessHandle process_handle_; 46 base::ProcessHandle process_handle_;
47 ResourceDispatcherHost* rdh_; 47 ResourceDispatcherHost* rdh_;
48 48
49 // We exponentially grow the size of the buffer allocated. On the first 49 // |next_buffer_size_| is the size of the buffer to be allocated on the next
50 // OnWillRead() call, we allocate a buffer of 32k and double it on each 50 // OnWillRead() call. We exponentially grow the size of the buffer allocated
51 // subsequent call, up to a maximum size of 512k. |next_buffer_size_| is the 51 // when our owner fills our buffers. On the first OnWillRead() call, we
52 // size of the buffer to be allocated on the next OnWillRead() call. 52 // allocate a buffer of 32k and double it in OnReadCompleted() if the buffer
53 // was filled, up to a maximum size of 512k.
53 int next_buffer_size_; 54 int next_buffer_size_;
54 55
55 DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler); 56 DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler);
56 }; 57 };
57 58
58 #endif // CHROME_BROWSER_RENDERER_HOST_ASYNC_RESOURCE_HANDLER_H_ 59 #endif // CHROME_BROWSER_RENDERER_HOST_ASYNC_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_host/async_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698