Home | History | Annotate | Download | only in common
      1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 // Multiply-included message file, hence no include guard.
      6 
      7 #include "ipc/ipc_message_macros.h"
      8 #include "webkit/common/appcache/appcache_interfaces.h"
      9 
     10 #define IPC_MESSAGE_START AppCacheMsgStart
     11 
     12 IPC_ENUM_TRAITS(appcache::EventID)
     13 IPC_ENUM_TRAITS(appcache::Status)
     14 
     15 IPC_STRUCT_TRAITS_BEGIN(appcache::AppCacheInfo)
     16   IPC_STRUCT_TRAITS_MEMBER(manifest_url)
     17   IPC_STRUCT_TRAITS_MEMBER(creation_time)
     18   IPC_STRUCT_TRAITS_MEMBER(last_update_time)
     19   IPC_STRUCT_TRAITS_MEMBER(last_access_time)
     20   IPC_STRUCT_TRAITS_MEMBER(cache_id)
     21   IPC_STRUCT_TRAITS_MEMBER(group_id)
     22   IPC_STRUCT_TRAITS_MEMBER(status)
     23   IPC_STRUCT_TRAITS_MEMBER(size)
     24   IPC_STRUCT_TRAITS_MEMBER(is_complete)
     25 IPC_STRUCT_TRAITS_END()
     26 
     27 IPC_STRUCT_TRAITS_BEGIN(appcache::AppCacheResourceInfo)
     28   IPC_STRUCT_TRAITS_MEMBER(url)
     29   IPC_STRUCT_TRAITS_MEMBER(size)
     30   IPC_STRUCT_TRAITS_MEMBER(is_master)
     31   IPC_STRUCT_TRAITS_MEMBER(is_manifest)
     32   IPC_STRUCT_TRAITS_MEMBER(is_fallback)
     33   IPC_STRUCT_TRAITS_MEMBER(is_foreign)
     34   IPC_STRUCT_TRAITS_MEMBER(is_explicit)
     35 IPC_STRUCT_TRAITS_END()
     36 
     37 // AppCache messages sent from the child process to the browser.
     38 
     39 // Informs the browser of a new appcache host.
     40 IPC_MESSAGE_CONTROL1(AppCacheHostMsg_RegisterHost,
     41                      int /* host_id */)
     42 
     43 // Informs the browser of an appcache host being destroyed.
     44 IPC_MESSAGE_CONTROL1(AppCacheHostMsg_UnregisterHost,
     45                      int /* host_id */)
     46 
     47 // Informs the browser of which host caused another to be created.
     48 // This can influence which appcache should be utilized for the main
     49 // resource load into the newly created host, so it should be sent
     50 // prior to the main resource request being initiated.
     51 IPC_MESSAGE_CONTROL2(AppCacheHostMsg_SetSpawningHostId,
     52                      int /* host_id */,
     53                      int /* spawning_host_id */)
     54 
     55 // Initiates the cache selection algorithm for the given host.
     56 // This is sent prior to any subresource loads. An AppCacheMsg_CacheSelected
     57 // message will be sent in response.
     58 // 'host_id' indentifies a specific document or worker
     59 // 'document_url' the url of the main resource
     60 // 'appcache_document_was_loaded_from' the id of the appcache the main
     61 //     resource was loaded from or kNoCacheId
     62 // 'opt_manifest_url' the manifest url specified in the <html> tag if any
     63 IPC_MESSAGE_CONTROL4(AppCacheHostMsg_SelectCache,
     64                      int /* host_id */,
     65                      GURL  /* document_url */,
     66                      int64 /* appcache_document_was_loaded_from */,
     67                      GURL  /* opt_manifest_url */)
     68 
     69 // Initiates worker specific cache selection algorithm for the given host.
     70 IPC_MESSAGE_CONTROL3(AppCacheHostMsg_SelectCacheForWorker,
     71                      int /* host_id */,
     72                      int /* parent_process_id */,
     73                      int /* parent_host_id */)
     74 IPC_MESSAGE_CONTROL2(AppCacheHostMsg_SelectCacheForSharedWorker,
     75                      int /* host_id */,
     76                      int64 /* appcache_id */)
     77 
     78 // Informs the browser of a 'foreign' entry in an appcache.
     79 IPC_MESSAGE_CONTROL3(AppCacheHostMsg_MarkAsForeignEntry,
     80                      int /* host_id */,
     81                      GURL  /* document_url */,
     82                      int64 /* appcache_document_was_loaded_from */)
     83 
     84 // Returns the status of the appcache associated with host_id.
     85 IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_GetStatus,
     86                             int /* host_id */,
     87                             appcache::Status)
     88 
     89 // Initiates an update of the appcache associated with host_id.
     90 IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_StartUpdate,
     91                             int /* host_id */,
     92                             bool /* success */)
     93 
     94 // Swaps a new pending appcache, if there is one, into use for host_id.
     95 IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_SwapCache,
     96                             int /* host_id */,
     97                             bool /* success */)
     98 
     99 // Gets resource list from appcache synchronously.
    100 IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_GetResourceList,
    101                             int /* host_id in*/,
    102                             std::vector<appcache::AppCacheResourceInfo>
    103                             /* resources out */)
    104 
    105 
    106 // AppCache messages sent from the browser to the child process.
    107 
    108 // Notifies the renderer of the appcache that has been selected for a
    109 // a particular host. This is sent in reply to AppCacheHostMsg_SelectCache.
    110 IPC_MESSAGE_CONTROL2(AppCacheMsg_CacheSelected,
    111                      int /* host_id */,
    112                      appcache::AppCacheInfo)
    113 
    114 // Notifies the renderer of an AppCache status change.
    115 IPC_MESSAGE_CONTROL2(AppCacheMsg_StatusChanged,
    116                      std::vector<int> /* host_ids */,
    117                      appcache::Status)
    118 
    119 // Notifies the renderer of an AppCache event other than the
    120 // progress event which has a seperate message.
    121 IPC_MESSAGE_CONTROL2(AppCacheMsg_EventRaised,
    122                      std::vector<int> /* host_ids */,
    123                      appcache::EventID)
    124 
    125 // Notifies the renderer of an AppCache progress event.
    126 IPC_MESSAGE_CONTROL4(AppCacheMsg_ProgressEventRaised,
    127                      std::vector<int> /* host_ids */,
    128                      GURL /* url being processed */,
    129                      int /* total */,
    130                      int /* complete */)
    131 
    132 // Notifies the renderer of an AppCache error event.
    133 IPC_MESSAGE_CONTROL2(AppCacheMsg_ErrorEventRaised,
    134                      std::vector<int> /* host_ids */,
    135                      std::string /* error_message */)
    136 
    137 // Notifies the renderer of an AppCache logging message.
    138 IPC_MESSAGE_CONTROL3(AppCacheMsg_LogMessage,
    139                      int /* host_id */,
    140                      int /* log_level */,
    141                      std::string /* message */)
    142 
    143 // Notifies the renderer of the fact that AppCache access was blocked.
    144 IPC_MESSAGE_CONTROL2(AppCacheMsg_ContentBlocked,
    145                      int /* host_id */,
    146                      GURL /* manifest_url */)
    147