summaryrefslogtreecommitdiffstats
path: root/content/renderer/cache_storage/webserviceworkercachestorage_impl.cc
blob: e8c2a05c4eaf0b3009fc91a574b646a35786c880 (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
// Copyright 2015 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 "content/renderer/cache_storage/webserviceworkercachestorage_impl.h"

#include "content/child/thread_safe_sender.h"
#include "content/renderer/cache_storage/cache_storage_dispatcher.h"
#include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h"
#include "third_party/WebKit/public/platform/WebServiceWorkerCache.h"
#include "third_party/WebKit/public/platform/WebServiceWorkerRequest.h"
#include "third_party/WebKit/public/platform/WebServiceWorkerResponse.h"

using base::TimeTicks;

namespace content {

WebServiceWorkerCacheStorageImpl::WebServiceWorkerCacheStorageImpl(
    ThreadSafeSender* thread_safe_sender,
    const GURL& origin)
    : thread_safe_sender_(thread_safe_sender), origin_(origin) {
}

WebServiceWorkerCacheStorageImpl::~WebServiceWorkerCacheStorageImpl() {
}

void WebServiceWorkerCacheStorageImpl::dispatchHas(
    CacheStorageCallbacks* callbacks,
    const blink::WebString& cacheName) {
  GetDispatcher()->dispatchHas(callbacks, origin_, cacheName);
}

void WebServiceWorkerCacheStorageImpl::dispatchOpen(
    CacheStorageWithCacheCallbacks* callbacks,
    const blink::WebString& cacheName) {
  GetDispatcher()->dispatchOpen(callbacks, origin_, cacheName);
}

void WebServiceWorkerCacheStorageImpl::dispatchDelete(
    CacheStorageCallbacks* callbacks,
    const blink::WebString& cacheName) {
  GetDispatcher()->dispatchDelete(callbacks, origin_, cacheName);
}

void WebServiceWorkerCacheStorageImpl::dispatchKeys(
    CacheStorageKeysCallbacks* callbacks) {
  GetDispatcher()->dispatchKeys(callbacks, origin_);
}

void WebServiceWorkerCacheStorageImpl::dispatchMatch(
    CacheStorageMatchCallbacks* callbacks,
    const blink::WebServiceWorkerRequest& request,
    const blink::WebServiceWorkerCache::QueryParams& query_params) {
  GetDispatcher()->dispatchMatch(callbacks, origin_, request, query_params);
}

CacheStorageDispatcher* WebServiceWorkerCacheStorageImpl::GetDispatcher()
    const {
  return CacheStorageDispatcher::ThreadSpecificInstance(
      thread_safe_sender_.get());
}

}  // namespace content