Pass CreateDirectory errors up to IndexedDB.
[chromium-blink-merge.git] / content / child / appcache_dispatcher.h
blob0ce2acb9c806b12de9dabc8473b6c5d6ab002b47
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_CHILD_APPCACHE_DISPATCHER_H_
6 #define CONTENT_CHILD_APPCACHE_DISPATCHER_H_
8 #include <string>
9 #include <vector>
11 #include "base/memory/scoped_ptr.h"
12 #include "content/child/appcache_backend_proxy.h"
13 #include "ipc/ipc_listener.h"
14 #include "webkit/common/appcache/appcache_interfaces.h"
16 namespace content {
18 // Dispatches appcache related messages sent to a child process from the
19 // main browser process. There is one instance per child process. Messages
20 // are dispatched on the main child thread. The ChildThread base class
21 // creates an instance and delegates calls to it.
22 class AppCacheDispatcher : public IPC::Listener {
23 public:
24 AppCacheDispatcher(IPC::Sender* sender,
25 appcache::AppCacheFrontend* frontend);
26 virtual ~AppCacheDispatcher();
28 AppCacheBackendProxy* backend_proxy() { return &backend_proxy_; }
30 // IPC::Listener implementation
31 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
33 private:
34 // Ipc message handlers
35 void OnCacheSelected(int host_id, const appcache::AppCacheInfo& info);
36 void OnStatusChanged(const std::vector<int>& host_ids,
37 appcache::Status status);
38 void OnEventRaised(const std::vector<int>& host_ids,
39 appcache::EventID event_id);
40 void OnProgressEventRaised(const std::vector<int>& host_ids,
41 const GURL& url, int num_total, int num_complete);
42 void OnErrorEventRaised(const std::vector<int>& host_ids,
43 const std::string& message);
44 void OnLogMessage(int host_id, int log_level, const std::string& message);
45 void OnContentBlocked(int host_id, const GURL& manifest_url);
47 AppCacheBackendProxy backend_proxy_;
48 scoped_ptr<appcache::AppCacheFrontend> frontend_;
51 } // namespace content
53 #endif // CONTENT_CHILD_APPCACHE_DISPATCHER_H_