OLD | NEW |
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/common/resource_messages.h" | 5 #include "content/common/resource_messages.h" |
6 | 6 |
| 7 #include "base/debug/alias.h" |
| 8 #include "ipc/ipc_message.h" |
7 #include "net/base/load_timing_info.h" | 9 #include "net/base/load_timing_info.h" |
8 #include "net/http/http_response_headers.h" | 10 #include "net/http/http_response_headers.h" |
9 | 11 |
| 12 namespace content { |
| 13 // TODO(erikchen): Temporary code to help track http://crbug.com/527588. |
| 14 void CheckContentsOfDataReceivedMessage(const IPC::Message* message) { |
| 15 if (message->type() != ResourceMsg_DataReceived::ID) |
| 16 return; |
| 17 ResourceMsg_DataReceived::Schema::Param arg; |
| 18 bool success = ResourceMsg_DataReceived::Read(message, &arg); |
| 19 CHECK(success); |
| 20 int data_offset = base::get<1>(arg); |
| 21 CHECK_LE(data_offset, 512 * 1024); |
| 22 base::debug::Alias(&data_offset); |
| 23 } |
| 24 } |
| 25 |
10 namespace IPC { | 26 namespace IPC { |
11 | 27 |
12 void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Write( | 28 void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Write( |
13 Message* m, const param_type& p) { | 29 Message* m, const param_type& p) { |
14 WriteParam(m, p.get() != NULL); | 30 WriteParam(m, p.get() != NULL); |
15 if (p.get()) { | 31 if (p.get()) { |
16 // Do not disclose Set-Cookie headers over IPC. | 32 // Do not disclose Set-Cookie headers over IPC. |
17 p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES); | 33 p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES); |
18 } | 34 } |
19 } | 35 } |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 (*r)->set_identifier(identifier); | 323 (*r)->set_identifier(identifier); |
308 return true; | 324 return true; |
309 } | 325 } |
310 | 326 |
311 void ParamTraits<scoped_refptr<content::ResourceRequestBody> >::Log( | 327 void ParamTraits<scoped_refptr<content::ResourceRequestBody> >::Log( |
312 const param_type& p, std::string* l) { | 328 const param_type& p, std::string* l) { |
313 l->append("<ResourceRequestBody>"); | 329 l->append("<ResourceRequestBody>"); |
314 } | 330 } |
315 | 331 |
316 } // namespace IPC | 332 } // namespace IPC |
OLD | NEW |