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

Side by Side Diff: content/common/common_param_traits.h

Issue 6681028: Move the blob related code to content, and also move the blob messages to the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // This file is used to define IPC::ParamTraits<> specializations for a number 5 // This file is used to define IPC::ParamTraits<> specializations for a number
6 // of types so that they can be serialized over IPC. IPC::ParamTraits<> 6 // of types so that they can be serialized over IPC. IPC::ParamTraits<>
7 // specializations for basic types (like int and std::string) and types in the 7 // specializations for basic types (like int and std::string) and types in the
8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains 8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains
9 // specializations for types that are used by the content code, and which need 9 // specializations for types that are used by the content code, and which need
10 // manual serialization code. This is usually because they're not structs with 10 // manual serialization code. This is usually because they're not structs with
11 // public members.. 11 // public members..
12 12
13 #ifndef CONTENT_COMMON_COMMON_PARAM_TRAITS_H_ 13 #ifndef CONTENT_COMMON_COMMON_PARAM_TRAITS_H_
14 #define CONTENT_COMMON_COMMON_PARAM_TRAITS_H_ 14 #define CONTENT_COMMON_COMMON_PARAM_TRAITS_H_
15 #pragma once 15 #pragma once
16 16
17 #include "base/platform_file.h" 17 #include "base/platform_file.h"
18 #include "base/ref_counted.h" 18 #include "base/ref_counted.h"
19 #include "googleurl/src/gurl.h" 19 #include "googleurl/src/gurl.h"
20 #include "ipc/ipc_message_utils.h" 20 #include "ipc/ipc_message_utils.h"
21 #include "net/base/ip_endpoint.h" 21 #include "net/base/ip_endpoint.h"
22 #include "net/url_request/url_request_status.h" 22 #include "net/url_request/url_request_status.h"
23 // !!! WARNING: DO NOT ADD NEW WEBKIT DEPENDENCIES !!! 23 // !!! WARNING: DO NOT ADD NEW WEBKIT DEPENDENCIES !!!
24
24 // 25 //
25 // That means don't add #includes to any file in 'webkit/' or 26 // That means don't add #includes to any file in 'webkit/' or
26 // 'third_party/WebKit/'. Chrome Frame and NACL build parts of base/ and 27 // 'third_party/WebKit/'. Chrome Frame and NACL build parts of base/ and
27 // content/common/ for a mini-library that doesn't depend on webkit. 28 // content/common/ for a mini-library that doesn't depend on webkit.
28 29
29 // TODO(erg): The following headers are historical and only work because 30 // TODO(erg): The following headers are historical and only work because
30 // their definitions are inlined, which also needs to be fixed. 31 // their definitions are inlined, which also needs to be fixed.
31 #include "ui/gfx/native_widget_types.h" 32 #include "ui/gfx/native_widget_types.h"
33 #include "webkit/blob/blob_data.h"
32 #include "webkit/glue/resource_type.h" 34 #include "webkit/glue/resource_type.h"
33 35
34 // Forward declarations. 36 // Forward declarations.
35 class GURL; 37 class GURL;
36 38
37 namespace gfx { 39 namespace gfx {
38 class Point; 40 class Point;
39 class Rect; 41 class Rect;
40 class Size; 42 class Size;
41 } // namespace gfx 43 } // namespace gfx
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 NOTREACHED(); 189 NOTREACHED();
188 } 190 }
189 return result; 191 return result;
190 #endif 192 #endif
191 } 193 }
192 static void Log(const param_type& p, std::string* l) { 194 static void Log(const param_type& p, std::string* l) {
193 l->append("<gfx::NativeWindow>"); 195 l->append("<gfx::NativeWindow>");
194 } 196 }
195 }; 197 };
196 198
199 template <>
200 struct ParamTraits<scoped_refptr<webkit_blob::BlobData > > {
201 typedef scoped_refptr<webkit_blob::BlobData> param_type;
202 static void Write(Message* m, const param_type& p);
203 static bool Read(const Message* m, void** iter, param_type* r);
204 static void Log(const param_type& p, std::string* l);
205 };
206
197 } // namespace IPC 207 } // namespace IPC
198 208
199 #endif // CONTENT_COMMON_COMMON_PARAM_TRAITS_H_ 209 #endif // CONTENT_COMMON_COMMON_PARAM_TRAITS_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/blob_message_filter.cc ('k') | content/common/common_param_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698