OLD | NEW |
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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 // Whether the code is JavaScript or CSS. | 527 // Whether the code is JavaScript or CSS. |
528 bool is_javascript; | 528 bool is_javascript; |
529 | 529 |
530 // String of code to execute. | 530 // String of code to execute. |
531 std::string code; | 531 std::string code; |
532 | 532 |
533 // Whether to inject into all frames, or only the root frame. | 533 // Whether to inject into all frames, or only the root frame. |
534 bool all_frames; | 534 bool all_frames; |
535 }; | 535 }; |
536 | 536 |
| 537 // Parameters for the message that creates a worker thread. |
| 538 struct ViewHostMsg_CreateWorker_Params { |
| 539 // URL for the worker script. |
| 540 GURL url; |
| 541 |
| 542 // True if this is a SharedWorker, false if it is a dedicated Worker. |
| 543 bool is_shared; |
| 544 |
| 545 // Name for a SharedWorker, otherwise empty string. |
| 546 string16 name; |
| 547 |
| 548 // The ID of the parent document (unique within parent renderer). |
| 549 unsigned long long document_id; |
| 550 |
| 551 // RenderView routing id used to send messages back to the parent. |
| 552 int render_view_route_id; |
| 553 }; |
| 554 |
537 // Creates a new view via a control message since the view doesn't yet exist. | 555 // Creates a new view via a control message since the view doesn't yet exist. |
538 struct ViewMsg_New_Params { | 556 struct ViewMsg_New_Params { |
539 // The parent window's id. | 557 // The parent window's id. |
540 gfx::NativeViewId parent_window; | 558 gfx::NativeViewId parent_window; |
541 | 559 |
542 // Renderer-wide preferences. | 560 // Renderer-wide preferences. |
543 RendererPreferences renderer_preferences; | 561 RendererPreferences renderer_preferences; |
544 | 562 |
545 // Preferences for this view. | 563 // Preferences for this view. |
546 WebPreferences web_preferences; | 564 WebPreferences web_preferences; |
(...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2289 l->append(L", "); | 2307 l->append(L", "); |
2290 LogParam(p.origin_, l); | 2308 LogParam(p.origin_, l); |
2291 l->append(L", "); | 2309 l->append(L", "); |
2292 LogParam(p.url_, l); | 2310 LogParam(p.url_, l); |
2293 l->append(L", "); | 2311 l->append(L", "); |
2294 LogParam(p.storage_type_, l); | 2312 LogParam(p.storage_type_, l); |
2295 l->append(L")"); | 2313 l->append(L")"); |
2296 } | 2314 } |
2297 }; | 2315 }; |
2298 | 2316 |
| 2317 // Traits for ViewHostMsg_CreateWorker_Params |
| 2318 template <> |
| 2319 struct ParamTraits<ViewHostMsg_CreateWorker_Params> { |
| 2320 typedef ViewHostMsg_CreateWorker_Params param_type; |
| 2321 static void Write(Message* m, const param_type& p) { |
| 2322 WriteParam(m, p.url); |
| 2323 WriteParam(m, p.is_shared); |
| 2324 WriteParam(m, p.name); |
| 2325 WriteParam(m, p.document_id); |
| 2326 WriteParam(m, p.render_view_route_id); |
| 2327 } |
| 2328 static bool Read(const Message* m, void** iter, param_type* p) { |
| 2329 return |
| 2330 ReadParam(m, iter, &p->url) && |
| 2331 ReadParam(m, iter, &p->is_shared) && |
| 2332 ReadParam(m, iter, &p->name) && |
| 2333 ReadParam(m, iter, &p->document_id) && |
| 2334 ReadParam(m, iter, &p->render_view_route_id); |
| 2335 } |
| 2336 static void Log(const param_type& p, std::wstring* l) { |
| 2337 l->append(L"("); |
| 2338 LogParam(p.url, l); |
| 2339 l->append(L", "); |
| 2340 LogParam(p.is_shared, l); |
| 2341 l->append(L", "); |
| 2342 LogParam(p.name, l); |
| 2343 l->append(L", "); |
| 2344 LogParam(p.document_id, l); |
| 2345 l->append(L", "); |
| 2346 LogParam(p.render_view_route_id, l); |
| 2347 l->append(L")"); |
| 2348 } |
| 2349 }; |
| 2350 |
2299 // Traits for WebCookie | 2351 // Traits for WebCookie |
2300 template <> | 2352 template <> |
2301 struct ParamTraits<webkit_glue::WebCookie> { | 2353 struct ParamTraits<webkit_glue::WebCookie> { |
2302 typedef webkit_glue::WebCookie param_type; | 2354 typedef webkit_glue::WebCookie param_type; |
2303 static void Write(Message* m, const param_type& p) { | 2355 static void Write(Message* m, const param_type& p) { |
2304 WriteParam(m, p.name); | 2356 WriteParam(m, p.name); |
2305 WriteParam(m, p.value); | 2357 WriteParam(m, p.value); |
2306 WriteParam(m, p.domain); | 2358 WriteParam(m, p.domain); |
2307 WriteParam(m, p.path); | 2359 WriteParam(m, p.path); |
2308 WriteParam(m, p.expires); | 2360 WriteParam(m, p.expires); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2423 } | 2475 } |
2424 }; | 2476 }; |
2425 | 2477 |
2426 } // namespace IPC | 2478 } // namespace IPC |
2427 | 2479 |
2428 | 2480 |
2429 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" | 2481 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" |
2430 #include "ipc/ipc_message_macros.h" | 2482 #include "ipc/ipc_message_macros.h" |
2431 | 2483 |
2432 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 2484 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
OLD | NEW |