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

Side by Side Diff: content/browser/renderer_host/sync_resource_handler.cc

Issue 10578055: Rewrite guts of ResourceLoader and BufferedResourceHandler to suck less. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/browser/renderer_host/sync_resource_handler.h" 5 #include "content/browser/renderer_host/sync_resource_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/browser/debugger/devtools_netlog_observer.h" 8 #include "content/browser/debugger/devtools_netlog_observer.h"
9 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" 9 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h"
10 #include "content/browser/renderer_host/resource_message_filter.h" 10 #include "content/browser/renderer_host/resource_message_filter.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 97
98 bool SyncResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf, 98 bool SyncResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf,
99 int* buf_size, int min_size) { 99 int* buf_size, int min_size) {
100 DCHECK(min_size == -1); 100 DCHECK(min_size == -1);
101 *buf = read_buffer_.get(); 101 *buf = read_buffer_.get();
102 *buf_size = kReadBufSize; 102 *buf_size = kReadBufSize;
103 return true; 103 return true;
104 } 104 }
105 105
106 bool SyncResourceHandler::OnReadCompleted(int request_id, int* bytes_read, 106 bool SyncResourceHandler::OnReadCompleted(int request_id, int bytes_read,
107 bool* defer) { 107 bool* defer) {
108 if (!*bytes_read) 108 if (!bytes_read)
109 return true; 109 return true;
110 result_.data.append(read_buffer_->data(), *bytes_read); 110 result_.data.append(read_buffer_->data(), bytes_read);
111 return true; 111 return true;
112 } 112 }
113 113
114 bool SyncResourceHandler::OnResponseCompleted( 114 bool SyncResourceHandler::OnResponseCompleted(
115 int request_id, 115 int request_id,
116 const net::URLRequestStatus& status, 116 const net::URLRequestStatus& status,
117 const std::string& security_info) { 117 const std::string& security_info) {
118 result_.status = status; 118 result_.status = status;
119 119
120 result_.encoded_data_length = 120 result_.encoded_data_length =
121 DevToolsNetLogObserver::GetAndResetEncodedDataLength(request_); 121 DevToolsNetLogObserver::GetAndResetEncodedDataLength(request_);
122 122
123 ResourceHostMsg_SyncLoad::WriteReplyParams(result_message_, result_); 123 ResourceHostMsg_SyncLoad::WriteReplyParams(result_message_, result_);
124 filter_->Send(result_message_); 124 filter_->Send(result_message_);
125 result_message_ = NULL; 125 result_message_ = NULL;
126 return true; 126 return true;
127 } 127 }
128 128
129 } // namespace content 129 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/sync_resource_handler.h ('k') | content/browser/renderer_host/x509_user_cert_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698