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

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

Issue 19004: Change URLRequest to use a ref-counted buffer for actual IO.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 | Annotate | Revision Log
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_SYNC_RESOURCE_HANDLER_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_SYNC_RESOURCE_HANDLER_H_
6 #define CHROME_BROWSER_RENDERER_HOST_SYNC_RESOURCE_HANDLER_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_SYNC_RESOURCE_HANDLER_H_
7 7
8 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" 8 #include "chrome/browser/renderer_host/resource_dispatcher_host.h"
9 #include "chrome/browser/renderer_host/resource_handler.h" 9 #include "chrome/browser/renderer_host/resource_handler.h"
10 #include "net/base/io_buffer.h"
10 11
11 // Used to complete a synchronous resource request in response to resource load 12 // Used to complete a synchronous resource request in response to resource load
12 // events from the resource dispatcher host. 13 // events from the resource dispatcher host.
13 class SyncResourceHandler : public ResourceHandler { 14 class SyncResourceHandler : public ResourceHandler {
14 public: 15 public:
15 SyncResourceHandler(ResourceDispatcherHost::Receiver* receiver, 16 SyncResourceHandler(ResourceDispatcherHost::Receiver* receiver,
16 const GURL& url, 17 const GURL& url,
17 IPC::Message* result_message); 18 IPC::Message* result_message);
18 19
19 bool OnRequestRedirected(int request_id, const GURL& new_url); 20 bool OnRequestRedirected(int request_id, const GURL& new_url);
20 bool OnResponseStarted(int request_id, ResourceResponse* response); 21 bool OnResponseStarted(int request_id, ResourceResponse* response);
21 bool OnWillRead(int request_id, char** buf, int* buf_size, int min_size); 22 bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size,
23 int min_size);
22 bool OnReadCompleted(int request_id, int* bytes_read); 24 bool OnReadCompleted(int request_id, int* bytes_read);
23 bool OnResponseCompleted(int request_id, const URLRequestStatus& status); 25 bool OnResponseCompleted(int request_id, const URLRequestStatus& status);
24 26
25 private: 27 private:
26 enum { kReadBufSize = 3840 }; 28 enum { kReadBufSize = 3840 };
27 char read_buffer_[kReadBufSize]; 29 scoped_refptr<net::IOBuffer> read_buffer_;
28 30
29 ViewHostMsg_SyncLoad_Result result_; 31 ViewHostMsg_SyncLoad_Result result_;
30 ResourceDispatcherHost::Receiver* receiver_; 32 ResourceDispatcherHost::Receiver* receiver_;
31 IPC::Message* result_message_; 33 IPC::Message* result_message_;
32 }; 34 };
33 35
34 #endif // CHROME_BROWSER_RENDERER_HOST_SYNC_RESOURCE_HANDLER_H_ 36 #endif // CHROME_BROWSER_RENDERER_HOST_SYNC_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/save_file_resource_handler.cc ('k') | chrome/browser/renderer_host/sync_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698