OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 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 "webkit/glue/webappcachecontext.h" |
| 6 |
| 7 namespace { |
| 8 |
| 9 WebAppCacheContext::WebAppCacheFactoryProc factory_proc = NULL; |
| 10 |
| 11 class NoopWebAppCacheContext : public WebAppCacheContext { |
| 12 public: |
| 13 virtual int context_id() { return kNoAppCacheContextId; } |
| 14 virtual int64 app_cache_id() { return kNoAppCacheId; } |
| 15 virtual void Initialize(ContextType context_type, |
| 16 WebAppCacheContext* opt_parent) {} |
| 17 virtual void SelectAppCacheWithoutManifest( |
| 18 const GURL& document_url, |
| 19 int64 cache_document_was_loaded_from) {} |
| 20 virtual void SelectAppCacheWithManifest( |
| 21 const GURL& document_url, |
| 22 int64 cache_document_was_loaded_from, |
| 23 const GURL& manifest_url) {} |
| 24 |
| 25 }; |
| 26 |
| 27 } // namespace |
| 28 |
| 29 const int WebAppCacheContext::kNoAppCacheContextId = 0; |
| 30 const int64 WebAppCacheContext::kNoAppCacheId = 0; |
| 31 const int64 WebAppCacheContext::kUnknownAppCacheId = -1; |
| 32 |
| 33 WebAppCacheContext* WebAppCacheContext::Create() { |
| 34 if (factory_proc) |
| 35 return factory_proc(); |
| 36 return new NoopWebAppCacheContext(); |
| 37 } |
| 38 |
| 39 void WebAppCacheContext::SetFactory(WebAppCacheFactoryProc proc) { |
| 40 factory_proc = proc; |
| 41 } |
OLD | NEW |