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

Side by Side Diff: content/public/browser/browser_message_filter.cc

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | content/public/test/test_browser_context.cc » ('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) 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 #include "content/public/browser/browser_message_filter.h" 5 #include "content/public/browser/browser_message_filter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/process.h" 10 #include "base/process.h"
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 } 37 }
38 38
39 bool BrowserMessageFilter::OnMessageReceived(const IPC::Message& message) { 39 bool BrowserMessageFilter::OnMessageReceived(const IPC::Message& message) {
40 BrowserThread::ID thread = BrowserThread::IO; 40 BrowserThread::ID thread = BrowserThread::IO;
41 OverrideThreadForMessage(message, &thread); 41 OverrideThreadForMessage(message, &thread);
42 42
43 if (thread == BrowserThread::IO) { 43 if (thread == BrowserThread::IO) {
44 scoped_refptr<base::TaskRunner> runner = 44 scoped_refptr<base::TaskRunner> runner =
45 OverrideTaskRunnerForMessage(message); 45 OverrideTaskRunnerForMessage(message);
46 if (runner) { 46 if (runner.get()) {
47 runner->PostTask(FROM_HERE, 47 runner->PostTask(
48 FROM_HERE,
48 base::Bind(base::IgnoreResult(&BrowserMessageFilter::DispatchMessage), 49 base::Bind(base::IgnoreResult(&BrowserMessageFilter::DispatchMessage),
49 this, message)); 50 this,
51 message));
50 return true; 52 return true;
51 } 53 }
52 return DispatchMessage(message); 54 return DispatchMessage(message);
53 } 55 }
54 56
55 if (thread == BrowserThread::UI && !CheckCanDispatchOnUI(message, this)) 57 if (thread == BrowserThread::UI && !CheckCanDispatchOnUI(message, this))
56 return true; 58 return true;
57 59
58 BrowserThread::PostTask( 60 BrowserThread::PostTask(
59 thread, FROM_HERE, 61 thread, FROM_HERE,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 "Must handle messages that were dispatched to another thread!"; 140 "Must handle messages that were dispatched to another thread!";
139 if (!message_was_ok) { 141 if (!message_was_ok) {
140 content::RecordAction(UserMetricsAction("BadMessageTerminate_BMF")); 142 content::RecordAction(UserMetricsAction("BadMessageTerminate_BMF"));
141 BadMessageReceived(); 143 BadMessageReceived();
142 } 144 }
143 145
144 return rv; 146 return rv;
145 } 147 }
146 148
147 } // namespace content 149 } // namespace content
OLDNEW
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | content/public/test/test_browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698