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" | |
9 #include "net/base/load_timing_info.h" | 7 #include "net/base/load_timing_info.h" |
10 #include "net/http/http_response_headers.h" | 8 #include "net/http/http_response_headers.h" |
11 | 9 |
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 | |
26 namespace IPC { | 10 namespace IPC { |
27 | 11 |
28 void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Write( | 12 void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Write( |
29 Message* m, const param_type& p) { | 13 Message* m, const param_type& p) { |
30 WriteParam(m, p.get() != NULL); | 14 WriteParam(m, p.get() != NULL); |
31 if (p.get()) { | 15 if (p.get()) { |
32 // Do not disclose Set-Cookie headers over IPC. | 16 // Do not disclose Set-Cookie headers over IPC. |
33 p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES); | 17 p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES); |
34 } | 18 } |
35 } | 19 } |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 (*r)->set_identifier(identifier); | 307 (*r)->set_identifier(identifier); |
324 return true; | 308 return true; |
325 } | 309 } |
326 | 310 |
327 void ParamTraits<scoped_refptr<content::ResourceRequestBody> >::Log( | 311 void ParamTraits<scoped_refptr<content::ResourceRequestBody> >::Log( |
328 const param_type& p, std::string* l) { | 312 const param_type& p, std::string* l) { |
329 l->append("<ResourceRequestBody>"); | 313 l->append("<ResourceRequestBody>"); |
330 } | 314 } |
331 | 315 |
332 } // namespace IPC | 316 } // namespace IPC |
OLD | NEW |