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

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

Issue 340050: Add the plumbing and test code for plugins opening files from the sandbox. Th... (Closed) Base URL: svn://chrome-svn/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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 389
390 struct ViewMsg_DatabaseOpenFileResponse_Params { 390 struct ViewMsg_DatabaseOpenFileResponse_Params {
391 #if defined(OS_WIN) 391 #if defined(OS_WIN)
392 base::PlatformFile file_handle; // DB file handle 392 base::PlatformFile file_handle; // DB file handle
393 #elif defined(OS_POSIX) 393 #elif defined(OS_POSIX)
394 base::FileDescriptor file_handle; // DB file handle 394 base::FileDescriptor file_handle; // DB file handle
395 base::FileDescriptor dir_handle; // DB directory handle 395 base::FileDescriptor dir_handle; // DB directory handle
396 #endif 396 #endif
397 }; 397 };
398 398
399 struct ViewMsg_OpenFileForPluginResponse_Params {
400 // Note: if we end up having to add a directory handle, this should be
401 // combined with the DatabaseOpenFileResponse_Params struct.
402 #if defined(OS_WIN)
403 base::PlatformFile file_handle;
404 #elif defined(OS_POSIX)
405 base::FileDescriptor file_handle;
406 #endif
407 };
408
399 // Parameters to describe a rendered page. 409 // Parameters to describe a rendered page.
400 struct ViewHostMsg_DidPrintPage_Params { 410 struct ViewHostMsg_DidPrintPage_Params {
401 // A shared memory handle to the EMF data. This data can be quite large so a 411 // A shared memory handle to the EMF data. This data can be quite large so a
402 // memory map needs to be used. 412 // memory map needs to be used.
403 base::SharedMemoryHandle metafile_data_handle; 413 base::SharedMemoryHandle metafile_data_handle;
404 414
405 // Size of the metafile data. 415 // Size of the metafile data.
406 unsigned data_size; 416 unsigned data_size;
407 417
408 // Cookie for the document to ensure correctness. 418 // Cookie for the document to ensure correctness.
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1768 LogParam(p.file_handle, l); 1778 LogParam(p.file_handle, l);
1769 #if defined(OS_POSIX) 1779 #if defined(OS_POSIX)
1770 l->append(L", "); 1780 l->append(L", ");
1771 LogParam(p.dir_handle, l); 1781 LogParam(p.dir_handle, l);
1772 #endif 1782 #endif
1773 l->append(L")"); 1783 l->append(L")");
1774 } 1784 }
1775 }; 1785 };
1776 1786
1777 template <> 1787 template <>
1788 struct ParamTraits<ViewMsg_OpenFileForPluginResponse_Params> {
1789 typedef ViewMsg_OpenFileForPluginResponse_Params param_type;
1790 static void Write(Message* m, const param_type& p) {
1791 WriteParam(m, p.file_handle);
1792 }
1793 static bool Read(const Message* m, void** iter, param_type* p) {
1794 return ReadParam(m, iter, &p->file_handle);
1795 }
1796 static void Log(const param_type& p, std::wstring* l) {
1797 LogParam(p.file_handle, l);
1798 }
1799 };
1800
1801 template <>
1778 struct ParamTraits<appcache::Status> { 1802 struct ParamTraits<appcache::Status> {
1779 typedef appcache::Status param_type; 1803 typedef appcache::Status param_type;
1780 static void Write(Message* m, const param_type& p) { 1804 static void Write(Message* m, const param_type& p) {
1781 m->WriteInt(static_cast<int>(p)); 1805 m->WriteInt(static_cast<int>(p));
1782 } 1806 }
1783 static bool Read(const Message* m, void** iter, param_type* p) { 1807 static bool Read(const Message* m, void** iter, param_type* p) {
1784 int type; 1808 int type;
1785 if (!m->ReadInt(iter, &type)) 1809 if (!m->ReadInt(iter, &type))
1786 return false; 1810 return false;
1787 *p = static_cast<param_type>(type); 1811 *p = static_cast<param_type>(type);
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
2160 } 2184 }
2161 }; 2185 };
2162 2186
2163 } // namespace IPC 2187 } // namespace IPC
2164 2188
2165 2189
2166 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" 2190 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
2167 #include "ipc/ipc_message_macros.h" 2191 #include "ipc/ipc_message_macros.h"
2168 2192
2169 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ 2193 #endif // CHROME_COMMON_RENDER_MESSAGES_H_
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/resource_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