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

Side by Side Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 16256018: Update content/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix incorrectly modified code 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
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/renderer/pepper/pepper_plugin_delegate_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <cstddef> 8 #include <cstddef>
9 #include <map> 9 #include <map>
10 #include <queue> 10 #include <queue>
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 } 923 }
924 924
925 void PepperPluginDelegateImpl::OnPpapiBrokerPermissionResult( 925 void PepperPluginDelegateImpl::OnPpapiBrokerPermissionResult(
926 int request_id, 926 int request_id,
927 bool result) { 927 bool result) {
928 scoped_ptr<base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> > client_ptr( 928 scoped_ptr<base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> > client_ptr(
929 pending_permission_requests_.Lookup(request_id)); 929 pending_permission_requests_.Lookup(request_id));
930 DCHECK(client_ptr.get()); 930 DCHECK(client_ptr.get());
931 pending_permission_requests_.Remove(request_id); 931 pending_permission_requests_.Remove(request_id);
932 base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> client = *client_ptr; 932 base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> client = *client_ptr;
933 if (!client) 933 if (!client.get())
934 return; 934 return;
935 935
936 webkit::ppapi::PluginModule* plugin_module = 936 webkit::ppapi::PluginModule* plugin_module =
937 webkit::ppapi::ResourceHelper::GetPluginModule(client); 937 webkit::ppapi::ResourceHelper::GetPluginModule(client.get());
938 if (!plugin_module) 938 if (!plugin_module)
939 return; 939 return;
940 940
941 PepperBrokerImpl* broker = 941 PepperBrokerImpl* broker =
942 static_cast<PepperBrokerImpl*>(plugin_module->GetBroker()); 942 static_cast<PepperBrokerImpl*>(plugin_module->GetBroker());
943 broker->OnBrokerPermissionResult(client, result); 943 broker->OnBrokerPermissionResult(client.get(), result);
944 } 944 }
945 945
946 bool PepperPluginDelegateImpl::AsyncOpenFile( 946 bool PepperPluginDelegateImpl::AsyncOpenFile(
947 const base::FilePath& path, 947 const base::FilePath& path,
948 int flags, 948 int flags,
949 const AsyncOpenFileCallback& callback) { 949 const AsyncOpenFileCallback& callback) {
950 int message_id = pending_async_open_files_.Add( 950 int message_id = pending_async_open_files_.Add(
951 new AsyncOpenFileCallback(callback)); 951 new AsyncOpenFileCallback(callback));
952 IPC::Message* msg = new ViewHostMsg_AsyncOpenFile( 952 IPC::Message* msg = new ViewHostMsg_AsyncOpenFile(
953 render_view_->routing_id(), path, flags, message_id); 953 render_view_->routing_id(), path, flags, message_id);
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1686 should_close_source); 1686 should_close_source);
1687 } 1687 }
1688 1688
1689 bool PepperPluginDelegateImpl::IsRunningInProcess(PP_Instance instance) const { 1689 bool PepperPluginDelegateImpl::IsRunningInProcess(PP_Instance instance) const {
1690 RendererPpapiHostImpl* host = 1690 RendererPpapiHostImpl* host =
1691 RendererPpapiHostImpl::GetForPPInstance(instance); 1691 RendererPpapiHostImpl::GetForPPInstance(instance);
1692 return host && host->IsRunningInProcess(); 1692 return host && host->IsRunningInProcess();
1693 } 1693 }
1694 1694
1695 } // namespace content 1695 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_platform_video_capture_impl.cc ('k') | content/renderer/pepper/pepper_video_source_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698