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

Side by Side Diff: ppapi/host/resource_message_filter.cc

Issue 15806016: Update ppapi/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « no previous file | ppapi/proxy/pdf_resource.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 "ppapi/host/resource_message_filter.h" 5 #include "ppapi/host/resource_message_filter.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "base/task_runner.h" 9 #include "base/task_runner.h"
10 #include "ipc/ipc_message.h" 10 #include "ipc/ipc_message.h"
(...skipping 22 matching lines...) Expand all
33 resource_host_ = resource_host; 33 resource_host_ = resource_host;
34 } 34 }
35 35
36 void ResourceMessageFilter::OnFilterDestroyed() { 36 void ResourceMessageFilter::OnFilterDestroyed() {
37 resource_host_ = NULL; 37 resource_host_ = NULL;
38 } 38 }
39 39
40 bool ResourceMessageFilter::HandleMessage(const IPC::Message& msg, 40 bool ResourceMessageFilter::HandleMessage(const IPC::Message& msg,
41 HostMessageContext* context) { 41 HostMessageContext* context) {
42 scoped_refptr<base::TaskRunner> runner = OverrideTaskRunnerForMessage(msg); 42 scoped_refptr<base::TaskRunner> runner = OverrideTaskRunnerForMessage(msg);
43 if (runner) { 43 if (runner.get()) {
44 // TODO(raymes): We need to make a copy so the context can be used on other 44 // TODO(raymes): We need to make a copy so the context can be used on other
45 // threads. It would be better to have a thread-safe refcounted context. 45 // threads. It would be better to have a thread-safe refcounted context.
46 HostMessageContext context_copy = *context; 46 HostMessageContext context_copy = *context;
47 runner->PostTask(FROM_HERE, base::Bind( 47 runner->PostTask(FROM_HERE, base::Bind(
48 &ResourceMessageFilter::DispatchMessage, this, msg, context_copy)); 48 &ResourceMessageFilter::DispatchMessage, this, msg, context_copy));
49 return true; 49 return true;
50 } 50 }
51 51
52 return false; 52 return false;
53 } 53 }
(...skipping 14 matching lines...) Expand all
68 return NULL; 68 return NULL;
69 } 69 }
70 70
71 void ResourceMessageFilter::DispatchMessage(const IPC::Message& msg, 71 void ResourceMessageFilter::DispatchMessage(const IPC::Message& msg,
72 HostMessageContext context) { 72 HostMessageContext context) {
73 RunMessageHandlerAndReply(msg, &context); 73 RunMessageHandlerAndReply(msg, &context);
74 } 74 }
75 75
76 } // namespace host 76 } // namespace host
77 } // namespace ppapi 77 } // namespace ppapi
OLDNEW
« no previous file with comments | « no previous file | ppapi/proxy/pdf_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698