Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: chrome/common/appcache/appcache_dispatcher.h

Issue 5978003: Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/worker_host/worker_process_host.cc ('k') | chrome/common/child_process_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_COMMON_APPCACHE_APPCACHE_DISPATCHER_H_ 5 #ifndef CHROME_COMMON_APPCACHE_APPCACHE_DISPATCHER_H_
6 #define CHROME_COMMON_APPCACHE_APPCACHE_DISPATCHER_H_ 6 #define CHROME_COMMON_APPCACHE_APPCACHE_DISPATCHER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 #include "chrome/common/appcache/appcache_backend_proxy.h" 11 #include "chrome/common/appcache/appcache_backend_proxy.h"
12 #include "ipc/ipc_message.h" 12 #include "ipc/ipc_channel.h"
13 #include "webkit/appcache/appcache_frontend_impl.h" 13 #include "webkit/appcache/appcache_frontend_impl.h"
14 14
15 // Dispatches appcache related messages sent to a child process from the 15 // Dispatches appcache related messages sent to a child process from the
16 // main browser process. There is one instance per child process. Messages 16 // main browser process. There is one instance per child process. Messages
17 // are dispatched on the main child thread. The ChildThread base class 17 // are dispatched on the main child thread. The ChildThread base class
18 // creates an instance and delegates calls to it. 18 // creates an instance and delegates calls to it.
19 class AppCacheDispatcher { 19 class AppCacheDispatcher : public IPC::Channel::Listener {
20 public: 20 public:
21 explicit AppCacheDispatcher(IPC::Message::Sender* sender) 21 explicit AppCacheDispatcher(IPC::Message::Sender* sender)
22 : backend_proxy_(sender) {} 22 : backend_proxy_(sender) {}
23 23
24 AppCacheBackendProxy* backend_proxy() { return &backend_proxy_; } 24 AppCacheBackendProxy* backend_proxy() { return &backend_proxy_; }
25 25
26 // IPC::Channel::Listener implementation
26 bool OnMessageReceived(const IPC::Message& msg); 27 bool OnMessageReceived(const IPC::Message& msg);
27 28
28 private: 29 private:
29 // Ipc message handlers 30 // Ipc message handlers
30 void OnCacheSelected(int host_id, const appcache::AppCacheInfo& info); 31 void OnCacheSelected(int host_id, const appcache::AppCacheInfo& info);
31 void OnStatusChanged(const std::vector<int>& host_ids, 32 void OnStatusChanged(const std::vector<int>& host_ids,
32 appcache::Status status); 33 appcache::Status status);
33 void OnEventRaised(const std::vector<int>& host_ids, 34 void OnEventRaised(const std::vector<int>& host_ids,
34 appcache::EventID event_id); 35 appcache::EventID event_id);
35 void OnProgressEventRaised(const std::vector<int>& host_ids, 36 void OnProgressEventRaised(const std::vector<int>& host_ids,
36 const GURL& url, int num_total, int num_complete); 37 const GURL& url, int num_total, int num_complete);
37 void OnErrorEventRaised(const std::vector<int>& host_ids, 38 void OnErrorEventRaised(const std::vector<int>& host_ids,
38 const std::string& message); 39 const std::string& message);
39 void OnLogMessage(int host_id, int log_level, const std::string& message); 40 void OnLogMessage(int host_id, int log_level, const std::string& message);
40 void OnContentBlocked(int host_id, 41 void OnContentBlocked(int host_id,
41 const GURL& manifest_url); 42 const GURL& manifest_url);
42 43
43 AppCacheBackendProxy backend_proxy_; 44 AppCacheBackendProxy backend_proxy_;
44 appcache::AppCacheFrontendImpl frontend_impl_; 45 appcache::AppCacheFrontendImpl frontend_impl_;
45 }; 46 };
46 47
47 #endif // CHROME_COMMON_APPCACHE_APPCACHE_DISPATCHER_H_ 48 #endif // CHROME_COMMON_APPCACHE_APPCACHE_DISPATCHER_H_
OLDNEW
« no previous file with comments | « chrome/browser/worker_host/worker_process_host.cc ('k') | chrome/common/child_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698