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

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

Issue 3107026: Add IPC plumbing code for FileSystem API's openFileSystem (Closed)
Patch Set: nits fix + rebase Created 10 years, 4 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
« no previous file with comments | « chrome/chrome_browser.gypi ('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 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 // Unique request id to match requests and responses. 882 // Unique request id to match requests and responses.
883 int request_id; 883 int request_id;
884 884
885 // True if request has a callback specified. 885 // True if request has a callback specified.
886 bool has_callback; 886 bool has_callback;
887 887
888 // True if request is executed in response to an explicit user gesture. 888 // True if request is executed in response to an explicit user gesture.
889 bool user_gesture; 889 bool user_gesture;
890 }; 890 };
891 891
892 struct ViewHostMsg_OpenFileSystemRequest_Params {
893 // The routing ID of the view initiating the request.
894 int routing_id;
895
896 // The response should have this id.
897 int request_id;
898
899 // The origin doing the initiating.
900 GURL origin_url;
901
902 // The requested FileSystem type.
903 WebKit::WebFileSystem::Type type;
904
905 // Indicates how much storage space (in bytes) the caller expects to need.
906 int64 requested_size;
907 };
908
892 namespace IPC { 909 namespace IPC {
893 910
894 template <> 911 template <>
895 struct ParamTraits<ResourceType::Type> { 912 struct ParamTraits<ResourceType::Type> {
896 typedef ResourceType::Type param_type; 913 typedef ResourceType::Type param_type;
897 static void Write(Message* m, const param_type& p) { 914 static void Write(Message* m, const param_type& p) {
898 m->WriteInt(p); 915 m->WriteInt(p);
899 } 916 }
900 static bool Read(const Message* m, void** iter, param_type* p) { 917 static bool Read(const Message* m, void** iter, param_type* p) {
901 int type; 918 int type;
(...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after
2764 l->append(", "); 2781 l->append(", ");
2765 LogParam(p.request_id, l); 2782 LogParam(p.request_id, l);
2766 l->append(", "); 2783 l->append(", ");
2767 LogParam(p.has_callback, l); 2784 LogParam(p.has_callback, l);
2768 l->append(", "); 2785 l->append(", ");
2769 LogParam(p.user_gesture, l); 2786 LogParam(p.user_gesture, l);
2770 l->append(")"); 2787 l->append(")");
2771 } 2788 }
2772 }; 2789 };
2773 2790
2791 template <>
2792 struct ParamTraits<ViewHostMsg_OpenFileSystemRequest_Params> {
2793 typedef ViewHostMsg_OpenFileSystemRequest_Params param_type;
2794 static void Write(Message* m, const param_type& p) {
2795 WriteParam(m, p.routing_id);
2796 WriteParam(m, p.request_id);
2797 WriteParam(m, p.origin_url);
2798 WriteParam(m, p.type);
2799 WriteParam(m, p.requested_size);
2800 }
2801 static bool Read(const Message* m, void** iter, param_type* p) {
2802 return
2803 ReadParam(m, iter, &p->routing_id) &&
2804 ReadParam(m, iter, &p->request_id) &&
2805 ReadParam(m, iter, &p->origin_url) &&
2806 ReadParam(m, iter, &p->type) &&
2807 ReadParam(m, iter, &p->requested_size);
2808 }
2809 static void Log(const param_type& p, std::string* l) {
2810 l->append("(");
2811 LogParam(p.routing_id, l);
2812 l->append(", ");
2813 LogParam(p.request_id, l);
2814 l->append(", ");
2815 LogParam(p.origin_url, l);
2816 l->append(", ");
2817 LogParam(p.type, l);
2818 l->append(", ");
2819 LogParam(p.requested_size, l);
2820 l->append(")");
2821 }
2822 };
2823
2774 } // namespace IPC 2824 } // namespace IPC
2775 2825
2776 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" 2826 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
2777 #include "ipc/ipc_message_macros.h" 2827 #include "ipc/ipc_message_macros.h"
2778 2828
2779 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ 2829 #endif // CHROME_COMMON_RENDER_MESSAGES_H_
OLDNEW
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698