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

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

Issue 1601005: Allow synchronous messages to be sent from threads other than the main thread... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 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
« no previous file with comments | « chrome/common/db_message_filter.cc ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 415
416 struct ViewMsg_PrintPages_Params { 416 struct ViewMsg_PrintPages_Params {
417 // Parameters to render the page as a printed page. It must always be the same 417 // Parameters to render the page as a printed page. It must always be the same
418 // value for all the document. 418 // value for all the document.
419 ViewMsg_Print_Params params; 419 ViewMsg_Print_Params params;
420 420
421 // If empty, this means a request to render all the printed pages. 421 // If empty, this means a request to render all the printed pages.
422 std::vector<int> pages; 422 std::vector<int> pages;
423 }; 423 };
424 424
425 struct ViewMsg_DatabaseOpenFileResponse_Params {
426 IPC::PlatformFileForTransit file_handle; // DB file handle
427 #if defined(OS_POSIX)
428 base::FileDescriptor dir_handle; // DB directory handle
429 #endif
430 };
431
432 // Parameters to describe a rendered page. 425 // Parameters to describe a rendered page.
433 struct ViewHostMsg_DidPrintPage_Params { 426 struct ViewHostMsg_DidPrintPage_Params {
434 // A shared memory handle to the EMF data. This data can be quite large so a 427 // A shared memory handle to the EMF data. This data can be quite large so a
435 // memory map needs to be used. 428 // memory map needs to be used.
436 base::SharedMemoryHandle metafile_data_handle; 429 base::SharedMemoryHandle metafile_data_handle;
437 430
438 // Size of the metafile data. 431 // Size of the metafile data.
439 uint32 data_size; 432 uint32 data_size;
440 433
441 // Cookie for the document to ensure correctness. 434 // Cookie for the document to ensure correctness.
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 break; 2024 break;
2032 default: 2025 default:
2033 action = L"UNKNOWN"; 2026 action = L"UNKNOWN";
2034 break; 2027 break;
2035 } 2028 }
2036 LogParam(action, l); 2029 LogParam(action, l);
2037 } 2030 }
2038 }; 2031 };
2039 2032
2040 template <> 2033 template <>
2041 struct ParamTraits<ViewMsg_DatabaseOpenFileResponse_Params> {
2042 typedef ViewMsg_DatabaseOpenFileResponse_Params param_type;
2043 static void Write(Message* m, const param_type& p) {
2044 WriteParam(m, p.file_handle);
2045 #if defined(OS_POSIX)
2046 WriteParam(m, p.dir_handle);
2047 #endif
2048 }
2049 static bool Read(const Message* m, void** iter, param_type* p) {
2050 bool ret = ReadParam(m, iter, &p->file_handle);
2051 #if defined(OS_POSIX)
2052 ret = ret && ReadParam(m, iter, &p->dir_handle);
2053 #endif
2054 return ret;
2055 }
2056 static void Log(const param_type& p, std::wstring* l) {
2057 l->append(L"(");
2058 LogParam(p.file_handle, l);
2059 #if defined(OS_POSIX)
2060 l->append(L", ");
2061 LogParam(p.dir_handle, l);
2062 #endif
2063 l->append(L")");
2064 }
2065 };
2066
2067 template <>
2068 struct ParamTraits<appcache::Status> { 2034 struct ParamTraits<appcache::Status> {
2069 typedef appcache::Status param_type; 2035 typedef appcache::Status param_type;
2070 static void Write(Message* m, const param_type& p) { 2036 static void Write(Message* m, const param_type& p) {
2071 m->WriteInt(static_cast<int>(p)); 2037 m->WriteInt(static_cast<int>(p));
2072 } 2038 }
2073 static bool Read(const Message* m, void** iter, param_type* p) { 2039 static bool Read(const Message* m, void** iter, param_type* p) {
2074 int type; 2040 int type;
2075 if (!m->ReadInt(iter, &type)) 2041 if (!m->ReadInt(iter, &type))
2076 return false; 2042 return false;
2077 *p = static_cast<param_type>(type); 2043 *p = static_cast<param_type>(type);
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
2691 } 2657 }
2692 }; 2658 };
2693 2659
2694 } // namespace IPC 2660 } // namespace IPC
2695 2661
2696 2662
2697 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" 2663 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
2698 #include "ipc/ipc_message_macros.h" 2664 #include "ipc/ipc_message_macros.h"
2699 2665
2700 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ 2666 #endif // CHROME_COMMON_RENDER_MESSAGES_H_
OLDNEW
« no previous file with comments | « chrome/common/db_message_filter.cc ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698