• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 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 #include "content/child/appcache/appcache_backend_proxy.h"
6 
7 #include "content/common/appcache_messages.h"
8 
9 namespace content {
10 
RegisterHost(int host_id)11 void AppCacheBackendProxy::RegisterHost(int host_id) {
12   sender_->Send(new AppCacheHostMsg_RegisterHost(host_id));
13 }
14 
UnregisterHost(int host_id)15 void AppCacheBackendProxy::UnregisterHost(int host_id) {
16   sender_->Send(new AppCacheHostMsg_UnregisterHost(host_id));
17 }
18 
SetSpawningHostId(int host_id,int spawning_host_id)19 void AppCacheBackendProxy::SetSpawningHostId(int host_id,
20                                              int spawning_host_id) {
21   sender_->Send(new AppCacheHostMsg_SetSpawningHostId(
22                                     host_id, spawning_host_id));
23 }
24 
SelectCache(int host_id,const GURL & document_url,const int64 cache_document_was_loaded_from,const GURL & manifest_url)25 void AppCacheBackendProxy::SelectCache(
26     int host_id,
27     const GURL& document_url,
28     const int64 cache_document_was_loaded_from,
29     const GURL& manifest_url) {
30   sender_->Send(new AppCacheHostMsg_SelectCache(
31                                     host_id, document_url,
32                                     cache_document_was_loaded_from,
33                                     manifest_url));
34 }
35 
SelectCacheForWorker(int host_id,int parent_process_id,int parent_host_id)36 void AppCacheBackendProxy::SelectCacheForWorker(
37     int host_id, int parent_process_id, int parent_host_id) {
38   sender_->Send(new AppCacheHostMsg_SelectCacheForWorker(
39                                     host_id, parent_process_id,
40                                     parent_host_id));
41 }
42 
SelectCacheForSharedWorker(int host_id,int64 appcache_id)43 void AppCacheBackendProxy::SelectCacheForSharedWorker(
44     int host_id, int64 appcache_id) {
45   sender_->Send(new AppCacheHostMsg_SelectCacheForSharedWorker(
46                                     host_id, appcache_id));
47 }
48 
MarkAsForeignEntry(int host_id,const GURL & document_url,int64 cache_document_was_loaded_from)49 void AppCacheBackendProxy::MarkAsForeignEntry(
50     int host_id, const GURL& document_url,
51     int64 cache_document_was_loaded_from) {
52   sender_->Send(new AppCacheHostMsg_MarkAsForeignEntry(
53                                     host_id, document_url,
54                                     cache_document_was_loaded_from));
55 }
56 
GetStatus(int host_id)57 AppCacheStatus AppCacheBackendProxy::GetStatus(int host_id) {
58   AppCacheStatus status = APPCACHE_STATUS_UNCACHED;
59   sender_->Send(new AppCacheHostMsg_GetStatus(host_id, &status));
60   return status;
61 }
62 
StartUpdate(int host_id)63 bool AppCacheBackendProxy::StartUpdate(int host_id) {
64   bool result = false;
65   sender_->Send(new AppCacheHostMsg_StartUpdate(host_id, &result));
66   return result;
67 }
68 
SwapCache(int host_id)69 bool AppCacheBackendProxy::SwapCache(int host_id) {
70   bool result = false;
71   sender_->Send(new AppCacheHostMsg_SwapCache(host_id, &result));
72   return result;
73 }
74 
GetResourceList(int host_id,std::vector<AppCacheResourceInfo> * resource_infos)75 void AppCacheBackendProxy::GetResourceList(
76     int host_id, std::vector<AppCacheResourceInfo>* resource_infos) {
77   sender_->Send(new AppCacheHostMsg_GetResourceList(host_id, resource_infos));
78 }
79 
80 }  // namespace content
81