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

Side by Side Diff: content/browser/loader/intercepting_resource_handler.cc

Issue 2315443003: Stop sending serialized SSLStatus to the renderer. (Closed)
Patch Set: self review fix and merge fix Created 4 years, 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/loader/intercepting_resource_handler.h" 5 #include "content/browser/loader/intercepting_resource_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "content/public/common/resource_response.h" 9 #include "content/public/common/resource_response.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 new_handler_->SetController(controller()); 118 new_handler_->SetController(controller());
119 payload_for_old_handler_ = payload_for_old_handler; 119 payload_for_old_handler_ = payload_for_old_handler;
120 } 120 }
121 121
122 void InterceptingResourceHandler::SendPayloadToOldHandler() { 122 void InterceptingResourceHandler::SendPayloadToOldHandler() {
123 bool defer_ignored = false; 123 bool defer_ignored = false;
124 if (payload_for_old_handler_.empty()) { 124 if (payload_for_old_handler_.empty()) {
125 // If there is no payload, just finalize the request on the old handler. 125 // If there is no payload, just finalize the request on the old handler.
126 net::URLRequestStatus status(net::URLRequestStatus::CANCELED, 126 net::URLRequestStatus status(net::URLRequestStatus::CANCELED,
127 net::ERR_ABORTED); 127 net::ERR_ABORTED);
128 next_handler_->OnResponseCompleted(status, std::string(), &defer_ignored); 128 next_handler_->OnResponseCompleted(status, &defer_ignored);
129 DCHECK(!defer_ignored); 129 DCHECK(!defer_ignored);
130 return; 130 return;
131 } 131 }
132 132
133 // Ensure the old ResourceHandler has a buffer that can store the payload. 133 // Ensure the old ResourceHandler has a buffer that can store the payload.
134 scoped_refptr<net::IOBuffer> buf; 134 scoped_refptr<net::IOBuffer> buf;
135 int size = 0; 135 int size = 0;
136 if (first_read_buffer_) { 136 if (first_read_buffer_) {
137 // The first read buffer can be reused. The data inside it has been copied 137 // The first read buffer can be reused. The data inside it has been copied
138 // before calling this function, so it can safely be overriden. 138 // before calling this function, so it can safely be overriden.
(...skipping 10 matching lines...) Expand all
149 CHECK_GE(size, static_cast<int>(payload_for_old_handler_.length())); 149 CHECK_GE(size, static_cast<int>(payload_for_old_handler_.length()));
150 memcpy(buf->data(), payload_for_old_handler_.c_str(), 150 memcpy(buf->data(), payload_for_old_handler_.c_str(),
151 payload_for_old_handler_.length()); 151 payload_for_old_handler_.length());
152 next_handler_->OnReadCompleted(payload_for_old_handler_.length(), 152 next_handler_->OnReadCompleted(payload_for_old_handler_.length(),
153 &defer_ignored); 153 &defer_ignored);
154 payload_for_old_handler_ = std::string(); 154 payload_for_old_handler_ = std::string();
155 DCHECK(!defer_ignored); 155 DCHECK(!defer_ignored);
156 156
157 // Finalize the request. 157 // Finalize the request.
158 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); 158 net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0);
159 next_handler_->OnResponseCompleted(status, std::string(), &defer_ignored); 159 next_handler_->OnResponseCompleted(status, &defer_ignored);
160 DCHECK(!defer_ignored); 160 DCHECK(!defer_ignored);
161 } 161 }
162 162
163 } // namespace content 163 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698