summaryrefslogtreecommitdiff
path: root/chromium/content/common/appcache_messages.h
blob: 185caf4658069330643ac2fd33e63ef19c366764 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Multiply-included message file, hence no include guard.

#include "ipc/ipc_message_macros.h"
#include "webkit/common/appcache/appcache_interfaces.h"

#define IPC_MESSAGE_START AppCacheMsgStart

IPC_ENUM_TRAITS(appcache::EventID)
IPC_ENUM_TRAITS(appcache::Status)

IPC_STRUCT_TRAITS_BEGIN(appcache::AppCacheInfo)
  IPC_STRUCT_TRAITS_MEMBER(manifest_url)
  IPC_STRUCT_TRAITS_MEMBER(creation_time)
  IPC_STRUCT_TRAITS_MEMBER(last_update_time)
  IPC_STRUCT_TRAITS_MEMBER(last_access_time)
  IPC_STRUCT_TRAITS_MEMBER(cache_id)
  IPC_STRUCT_TRAITS_MEMBER(group_id)
  IPC_STRUCT_TRAITS_MEMBER(status)
  IPC_STRUCT_TRAITS_MEMBER(size)
  IPC_STRUCT_TRAITS_MEMBER(is_complete)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(appcache::AppCacheResourceInfo)
  IPC_STRUCT_TRAITS_MEMBER(url)
  IPC_STRUCT_TRAITS_MEMBER(size)
  IPC_STRUCT_TRAITS_MEMBER(is_master)
  IPC_STRUCT_TRAITS_MEMBER(is_manifest)
  IPC_STRUCT_TRAITS_MEMBER(is_fallback)
  IPC_STRUCT_TRAITS_MEMBER(is_foreign)
  IPC_STRUCT_TRAITS_MEMBER(is_explicit)
IPC_STRUCT_TRAITS_END()

// AppCache messages sent from the child process to the browser.

// Informs the browser of a new appcache host.
IPC_MESSAGE_CONTROL1(AppCacheHostMsg_RegisterHost,
                     int /* host_id */)

// Informs the browser of an appcache host being destroyed.
IPC_MESSAGE_CONTROL1(AppCacheHostMsg_UnregisterHost,
                     int /* host_id */)

// Informs the browser of which host caused another to be created.
// This can influence which appcache should be utilized for the main
// resource load into the newly created host, so it should be sent
// prior to the main resource request being initiated.
IPC_MESSAGE_CONTROL2(AppCacheHostMsg_SetSpawningHostId,
                     int /* host_id */,
                     int /* spawning_host_id */)

// Initiates the cache selection algorithm for the given host.
// This is sent prior to any subresource loads. An AppCacheMsg_CacheSelected
// message will be sent in response.
// 'host_id' indentifies a specific document or worker
// 'document_url' the url of the main resource
// 'appcache_document_was_loaded_from' the id of the appcache the main
//     resource was loaded from or kNoCacheId
// 'opt_manifest_url' the manifest url specified in the <html> tag if any
IPC_MESSAGE_CONTROL4(AppCacheHostMsg_SelectCache,
                     int /* host_id */,
                     GURL  /* document_url */,
                     int64 /* appcache_document_was_loaded_from */,
                     GURL  /* opt_manifest_url */)

// Initiates worker specific cache selection algorithm for the given host.
IPC_MESSAGE_CONTROL3(AppCacheHostMsg_SelectCacheForWorker,
                     int /* host_id */,
                     int /* parent_process_id */,
                     int /* parent_host_id */)
IPC_MESSAGE_CONTROL2(AppCacheHostMsg_SelectCacheForSharedWorker,
                     int /* host_id */,
                     int64 /* appcache_id */)

// Informs the browser of a 'foreign' entry in an appcache.
IPC_MESSAGE_CONTROL3(AppCacheHostMsg_MarkAsForeignEntry,
                     int /* host_id */,
                     GURL  /* document_url */,
                     int64 /* appcache_document_was_loaded_from */)

// Returns the status of the appcache associated with host_id.
IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_GetStatus,
                            int /* host_id */,
                            appcache::Status)

// Initiates an update of the appcache associated with host_id.
IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_StartUpdate,
                            int /* host_id */,
                            bool /* success */)

// Swaps a new pending appcache, if there is one, into use for host_id.
IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_SwapCache,
                            int /* host_id */,
                            bool /* success */)

// Gets resource list from appcache synchronously.
IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_GetResourceList,
                            int /* host_id in*/,
                            std::vector<appcache::AppCacheResourceInfo>
                            /* resources out */)


// AppCache messages sent from the browser to the child process.

// Notifies the renderer of the appcache that has been selected for a
// a particular host. This is sent in reply to AppCacheHostMsg_SelectCache.
IPC_MESSAGE_CONTROL2(AppCacheMsg_CacheSelected,
                     int /* host_id */,
                     appcache::AppCacheInfo)

// Notifies the renderer of an AppCache status change.
IPC_MESSAGE_CONTROL2(AppCacheMsg_StatusChanged,
                     std::vector<int> /* host_ids */,
                     appcache::Status)

// Notifies the renderer of an AppCache event other than the
// progress event which has a seperate message.
IPC_MESSAGE_CONTROL2(AppCacheMsg_EventRaised,
                     std::vector<int> /* host_ids */,
                     appcache::EventID)

// Notifies the renderer of an AppCache progress event.
IPC_MESSAGE_CONTROL4(AppCacheMsg_ProgressEventRaised,
                     std::vector<int> /* host_ids */,
                     GURL /* url being processed */,
                     int /* total */,
                     int /* complete */)

// Notifies the renderer of an AppCache error event.
IPC_MESSAGE_CONTROL2(AppCacheMsg_ErrorEventRaised,
                     std::vector<int> /* host_ids */,
                     std::string /* error_message */)

// Notifies the renderer of an AppCache logging message.
IPC_MESSAGE_CONTROL3(AppCacheMsg_LogMessage,
                     int /* host_id */,
                     int /* log_level */,
                     std::string /* message */)

// Notifies the renderer of the fact that AppCache access was blocked.
IPC_MESSAGE_CONTROL2(AppCacheMsg_ContentBlocked,
                     int /* host_id */,
                     GURL /* manifest_url */)