OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_APPCACHE_APPCACHE_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/process/process.h" | 12 #include "base/process/process.h" |
13 #include "content/browser/appcache/appcache_frontend_proxy.h" | 13 #include "content/browser/appcache/appcache_frontend_proxy.h" |
14 #include "content/public/browser/browser_message_filter.h" | 14 #include "content/public/browser/browser_message_filter.h" |
15 #include "webkit/browser/appcache/appcache_backend_impl.h" | 15 #include "webkit/browser/appcache/appcache_backend_impl.h" |
| 16 #include "webkit/browser/appcache/appcache_executable_handler.h" |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 class ChromeAppCacheService; | 19 class ChromeAppCacheService; |
19 | 20 |
20 // Handles appcache related messages sent to the main browser process from | 21 // Handles appcache related messages sent to the main browser process from |
21 // its child processes. There is a distinct host for each child process. | 22 // its child processes. There is a distinct host for each child process. |
22 // Messages are handled on the IO thread. The BrowserRenderProcessHost and | 23 // Messages are handled on the IO thread. The BrowserRenderProcessHost and |
23 // WorkerProcessHost create an instance and delegates calls to it. | 24 // WorkerProcessHost create an instance and delegates calls to it. |
24 class AppCacheDispatcherHost : public BrowserMessageFilter { | 25 class AppCacheDispatcherHost : public BrowserMessageFilter { |
25 public: | 26 public: |
(...skipping 27 matching lines...) Expand all Loading... |
53 void OnGetStatus(int host_id, IPC::Message* reply_msg); | 54 void OnGetStatus(int host_id, IPC::Message* reply_msg); |
54 void OnStartUpdate(int host_id, IPC::Message* reply_msg); | 55 void OnStartUpdate(int host_id, IPC::Message* reply_msg); |
55 void OnSwapCache(int host_id, IPC::Message* reply_msg); | 56 void OnSwapCache(int host_id, IPC::Message* reply_msg); |
56 void OnGetResourceList( | 57 void OnGetResourceList( |
57 int host_id, | 58 int host_id, |
58 std::vector<appcache::AppCacheResourceInfo>* resource_infos); | 59 std::vector<appcache::AppCacheResourceInfo>* resource_infos); |
59 void GetStatusCallback(appcache::Status status, void* param); | 60 void GetStatusCallback(appcache::Status status, void* param); |
60 void StartUpdateCallback(bool result, void* param); | 61 void StartUpdateCallback(bool result, void* param); |
61 void SwapCacheCallback(bool result, void* param); | 62 void SwapCacheCallback(bool result, void* param); |
62 | 63 |
| 64 void OnExeHandlerResponse( |
| 65 int request_id, |
| 66 const appcache::AppCacheExecutableHandler::Response& response); |
| 67 void OnFinishInstall(int host_id); |
| 68 |
| 69 void OnRegisterController( |
| 70 int host_id, |
| 71 const GURL& document_url, |
| 72 const string16& pattern, |
| 73 const GURL& controller_url); |
| 74 void OnUnregisterController( |
| 75 int host_id, |
| 76 const GURL& document_url, |
| 77 const string16& pattern); |
63 | 78 |
64 scoped_refptr<ChromeAppCacheService> appcache_service_; | 79 scoped_refptr<ChromeAppCacheService> appcache_service_; |
65 AppCacheFrontendProxy frontend_proxy_; | 80 AppCacheFrontendProxy frontend_proxy_; |
66 appcache::AppCacheBackendImpl backend_impl_; | 81 appcache::AppCacheBackendImpl backend_impl_; |
67 | 82 |
68 appcache::GetStatusCallback get_status_callback_; | 83 appcache::GetStatusCallback get_status_callback_; |
69 appcache::StartUpdateCallback start_update_callback_; | 84 appcache::StartUpdateCallback start_update_callback_; |
70 appcache::SwapCacheCallback swap_cache_callback_; | 85 appcache::SwapCacheCallback swap_cache_callback_; |
71 scoped_ptr<IPC::Message> pending_reply_msg_; | 86 scoped_ptr<IPC::Message> pending_reply_msg_; |
72 | 87 |
73 // The corresponding ChildProcessHost object's id(). | 88 // The corresponding ChildProcessHost object's id(). |
74 int process_id_; | 89 int process_id_; |
75 | 90 |
76 DISALLOW_COPY_AND_ASSIGN(AppCacheDispatcherHost); | 91 DISALLOW_COPY_AND_ASSIGN(AppCacheDispatcherHost); |
77 }; | 92 }; |
78 | 93 |
79 } // namespace content | 94 } // namespace content |
80 | 95 |
81 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DISPATCHER_HOST_H_ | 96 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DISPATCHER_HOST_H_ |
OLD | NEW |