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

Side by Side Diff: content/browser/quota_dispatcher_host.cc

Issue 142923005: Allow MessageFilters to restrict listening to specific message classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 9 months 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/browser/quota_dispatcher_host.h" 5 #include "content/browser/quota_dispatcher_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
10 #include "content/common/quota_messages.h" 10 #include "content/common/quota_messages.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 int64 current_quota_; 214 int64 current_quota_;
215 int64 requested_quota_; 215 int64 requested_quota_;
216 const int render_view_id_; 216 const int render_view_id_;
217 base::WeakPtrFactory<self_type> weak_factory_; 217 base::WeakPtrFactory<self_type> weak_factory_;
218 }; 218 };
219 219
220 QuotaDispatcherHost::QuotaDispatcherHost( 220 QuotaDispatcherHost::QuotaDispatcherHost(
221 int process_id, 221 int process_id,
222 QuotaManager* quota_manager, 222 QuotaManager* quota_manager,
223 QuotaPermissionContext* permission_context) 223 QuotaPermissionContext* permission_context)
224 : process_id_(process_id), 224 : BrowserMessageFilter(QuotaMsgStart),
225 process_id_(process_id),
225 quota_manager_(quota_manager), 226 quota_manager_(quota_manager),
226 permission_context_(permission_context), 227 permission_context_(permission_context),
227 weak_factory_(this) { 228 weak_factory_(this) {
228 } 229 }
229 230
230 bool QuotaDispatcherHost::OnMessageReceived( 231 bool QuotaDispatcherHost::OnMessageReceived(
231 const IPC::Message& message, bool* message_was_ok) { 232 const IPC::Message& message, bool* message_was_ok) {
232 *message_was_ok = true; 233 *message_was_ok = true;
233 bool handled = true; 234 bool handled = true;
234 IPC_BEGIN_MESSAGE_MAP_EX(QuotaDispatcherHost, message, *message_was_ok) 235 IPC_BEGIN_MESSAGE_MAP_EX(QuotaDispatcherHost, message, *message_was_ok)
(...skipping 30 matching lines...) Expand all
265 return; 266 return;
266 } 267 }
267 268
268 RequestQuotaDispatcher* dispatcher = new RequestQuotaDispatcher( 269 RequestQuotaDispatcher* dispatcher = new RequestQuotaDispatcher(
269 weak_factory_.GetWeakPtr(), request_id, origin, type, 270 weak_factory_.GetWeakPtr(), request_id, origin, type,
270 requested_size, render_view_id); 271 requested_size, render_view_id);
271 dispatcher->Start(); 272 dispatcher->Start();
272 } 273 }
273 274
274 } // namespace content 275 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/profiler_message_filter.cc ('k') | content/browser/renderer_host/clipboard_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698