| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_WEB_CACHE_RENDERER_WEB_CACHE_IMPL_H_ | 5 #ifndef COMPONENTS_WEB_CACHE_RENDERER_WEB_CACHE_IMPL_H_ |
| 6 #define COMPONENTS_WEB_CACHE_RENDERER_WEB_CACHE_IMPL_H_ | 6 #define COMPONENTS_WEB_CACHE_RENDERER_WEB_CACHE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "components/web_cache/public/interfaces/web_cache.mojom.h" | 13 #include "components/web_cache/public/interfaces/web_cache.mojom.h" |
| 14 #include "mojo/public/cpp/bindings/binding_set.h" | 14 #include "mojo/public/cpp/bindings/binding_set.h" |
| 15 | 15 |
| 16 namespace web_cache { | 16 namespace web_cache { |
| 17 | 17 |
| 18 // This class implements the Mojo interface mojom::WebCache. | 18 // This class implements the Mojo interface mojom::WebCache. |
| 19 class WebCacheImpl : public mojom::WebCache { | 19 class WebCacheImpl : public mojom::WebCache { |
| 20 public: | 20 public: |
| 21 WebCacheImpl(); | 21 WebCacheImpl(); |
| 22 ~WebCacheImpl() override; | 22 ~WebCacheImpl() override; |
| 23 | 23 |
| 24 void BindRequest(mojo::InterfaceRequest<mojom::WebCache> web_cache_request); | 24 void BindRequest(mojom::WebCacheRequest web_cache_request); |
| 25 | 25 |
| 26 // Needs to be called by RenderViews in case of navigations to execute | 26 // Needs to be called by RenderViews in case of navigations to execute |
| 27 // any 'clear cache' commands that were delayed until the next navigation. | 27 // any 'clear cache' commands that were delayed until the next navigation. |
| 28 void ExecutePendingClearCache(); | 28 void ExecutePendingClearCache(); |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 enum State { | 31 enum State { |
| 32 kInit, | 32 kInit, |
| 33 kNavigate_Pending, | 33 kNavigate_Pending, |
| 34 kClearCache_Pending, | 34 kClearCache_Pending, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 46 State clear_cache_state_; | 46 State clear_cache_state_; |
| 47 | 47 |
| 48 mojo::BindingSet<mojom::WebCache> bindings_; | 48 mojo::BindingSet<mojom::WebCache> bindings_; |
| 49 | 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(WebCacheImpl); | 50 DISALLOW_COPY_AND_ASSIGN(WebCacheImpl); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 } // namespace web_cache | 53 } // namespace web_cache |
| 54 | 54 |
| 55 #endif // COMPONENTS_WEB_CACHE_RENDERER_WEB_CACHE_IMPL_H_ | 55 #endif // COMPONENTS_WEB_CACHE_RENDERER_WEB_CACHE_IMPL_H_ |
| OLD | NEW |