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

Side by Side Diff: chrome/common/render_messages.h

Issue 348071: First half of http://codereview.chromium.org/274014/show... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ 5 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_
6 #define CHROME_COMMON_RENDER_MESSAGES_H_ 6 #define CHROME_COMMON_RENDER_MESSAGES_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include <map> 10 #include <map>
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 488
489 // Parameters for the IPC message ViewHostMsg_ScriptedPrint 489 // Parameters for the IPC message ViewHostMsg_ScriptedPrint
490 struct ViewHostMsg_ScriptedPrint_Params { 490 struct ViewHostMsg_ScriptedPrint_Params {
491 int routing_id; 491 int routing_id;
492 gfx::NativeViewId host_window_id; 492 gfx::NativeViewId host_window_id;
493 int cookie; 493 int cookie;
494 int expected_pages_count; 494 int expected_pages_count;
495 bool has_selection; 495 bool has_selection;
496 }; 496 };
497 497
498 // Signals a storage event.
499 struct ViewMsg_DOMStorageEvent_Params {
500 // The key that generated the storage event. Null if clear() was called.
501 NullableString16 key_;
502
503 // The old value of this key. Null on clear() or if it didn't have a value.
504 NullableString16 old_value_;
505
506 // The new value of this key. Null on removeItem() or clear().
507 NullableString16 new_value_;
508
509 // The origin this is associated with.
510 string16 origin_;
511
512 // The storage type of this event.
513 DOMStorageType storage_type_;
514 };
515
498 namespace IPC { 516 namespace IPC {
499 517
500 template <> 518 template <>
501 struct ParamTraits<ResourceType::Type> { 519 struct ParamTraits<ResourceType::Type> {
502 typedef ResourceType::Type param_type; 520 typedef ResourceType::Type param_type;
503 static void Write(Message* m, const param_type& p) { 521 static void Write(Message* m, const param_type& p) {
504 m->WriteInt(p); 522 m->WriteInt(p);
505 } 523 }
506 static bool Read(const Message* m, void** iter, param_type* p) { 524 static bool Read(const Message* m, void** iter, param_type* p) {
507 int type; 525 int type;
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 break; 2215 break;
2198 default: 2216 default:
2199 NOTIMPLEMENTED(); 2217 NOTIMPLEMENTED();
2200 control = L"UNKNOWN"; 2218 control = L"UNKNOWN";
2201 break; 2219 break;
2202 } 2220 }
2203 LogParam(control, l); 2221 LogParam(control, l);
2204 } 2222 }
2205 }; 2223 };
2206 2224
2225 // Traits for ViewMsg_DOMStorageEvent_Params.
2226 template <>
2227 struct ParamTraits<ViewMsg_DOMStorageEvent_Params> {
2228 typedef ViewMsg_DOMStorageEvent_Params param_type;
2229 static void Write(Message* m, const param_type& p) {
2230 WriteParam(m, p.key_);
2231 WriteParam(m, p.old_value_);
2232 WriteParam(m, p.new_value_);
2233 WriteParam(m, p.origin_);
2234 WriteParam(m, p.storage_type_);
2235 }
2236 static bool Read(const Message* m, void** iter, param_type* p) {
2237 return
2238 ReadParam(m, iter, &p->key_) &&
2239 ReadParam(m, iter, &p->old_value_) &&
2240 ReadParam(m, iter, &p->new_value_) &&
2241 ReadParam(m, iter, &p->origin_) &&
2242 ReadParam(m, iter, &p->storage_type_);
2243 }
2244 static void Log(const param_type& p, std::wstring* l) {
2245 l->append(L"(");
2246 LogParam(p.key_, l);
2247 l->append(L", ");
2248 LogParam(p.old_value_, l);
2249 l->append(L", ");
2250 LogParam(p.new_value_, l);
2251 l->append(L", ");
2252 LogParam(p.origin_, l);
2253 l->append(L", ");
2254 LogParam(p.storage_type_, l);
2255 l->append(L")");
2256 }
2257 };
2258
2207 // Traits for WebCookie 2259 // Traits for WebCookie
2208 template <> 2260 template <>
2209 struct ParamTraits<webkit_glue::WebCookie> { 2261 struct ParamTraits<webkit_glue::WebCookie> {
2210 typedef webkit_glue::WebCookie param_type; 2262 typedef webkit_glue::WebCookie param_type;
2211 static void Write(Message* m, const param_type& p) { 2263 static void Write(Message* m, const param_type& p) {
2212 WriteParam(m, p.name); 2264 WriteParam(m, p.name);
2213 WriteParam(m, p.value); 2265 WriteParam(m, p.value);
2214 WriteParam(m, p.domain); 2266 WriteParam(m, p.domain);
2215 WriteParam(m, p.path); 2267 WriteParam(m, p.path);
2216 WriteParam(m, p.expires); 2268 WriteParam(m, p.expires);
(...skipping 17 matching lines...) Expand all
2234 } 2286 }
2235 }; 2287 };
2236 2288
2237 } // namespace IPC 2289 } // namespace IPC
2238 2290
2239 2291
2240 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" 2292 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
2241 #include "ipc/ipc_message_macros.h" 2293 #include "ipc/ipc_message_macros.h"
2242 2294
2243 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ 2295 #endif // CHROME_COMMON_RENDER_MESSAGES_H_
OLDNEW
« no previous file with comments | « chrome/browser/in_process_webkit/dom_storage_uitest.cc ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698