summaryrefslogtreecommitdiffstats
path: root/chrome/common/appcache/appcache_backend_proxy.cc
blob: 16e0ff404e5dbdb42a9c23eb3b388cce469c3531 (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
// Copyright (c) 2009 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.

#include "chrome/common/appcache/appcache_backend_proxy.h"

#include "chrome/common/render_messages.h"

void AppCacheBackendProxy::RegisterHost(int host_id) {
  sender_->Send(new AppCacheMsg_RegisterHost(host_id));
}

void AppCacheBackendProxy::UnregisterHost(int host_id) {
  sender_->Send(new AppCacheMsg_UnregisterHost(host_id));
}

void AppCacheBackendProxy::SelectCache(
    int host_id,
    const GURL& document_url,
    const int64 cache_document_was_loaded_from,
    const GURL& manifest_url) {
  sender_->Send(new AppCacheMsg_SelectCache(
                                    host_id, document_url,
                                    cache_document_was_loaded_from,
                                    manifest_url));
}

void AppCacheBackendProxy::SelectCacheForWorker(
    int host_id, int parent_process_id, int parent_host_id) {
  sender_->Send(new AppCacheMsg_SelectCacheForWorker(
                                    host_id, parent_process_id,
                                    parent_host_id));
}

void AppCacheBackendProxy::SelectCacheForSharedWorker(
    int host_id, int64 appcache_id) {
  sender_->Send(new AppCacheMsg_SelectCacheForSharedWorker(
                                    host_id, appcache_id));
}

void AppCacheBackendProxy::MarkAsForeignEntry(
    int host_id, const GURL& document_url,
    int64 cache_document_was_loaded_from) {
  sender_->Send(new AppCacheMsg_MarkAsForeignEntry(
                                    host_id, document_url,
                                    cache_document_was_loaded_from));
}

appcache::Status AppCacheBackendProxy::GetStatus(int host_id) {
  appcache::Status status = appcache::UNCACHED;
  sender_->Send(new AppCacheMsg_GetStatus(host_id, &status));
  return status;
}

bool AppCacheBackendProxy::StartUpdate(int host_id) {
  bool result = false;
  sender_->Send(new AppCacheMsg_StartUpdate(host_id, &result));
  return result;
}

bool AppCacheBackendProxy::SwapCache(int host_id) {
  bool result = false;
  sender_->Send(new AppCacheMsg_SwapCache(host_id, &result));
  return result;
}

void AppCacheBackendProxy::GetResourceList(
    int host_id, std::vector<appcache::AppCacheResourceInfo>* resource_infos) {
  sender_->Send(new AppCacheMsg_GetResourceList(host_id, resource_infos));
}