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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2253053003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 InputHandlerManager* input_handler_manager = 1213 InputHandlerManager* input_handler_manager =
1214 render_thread ? render_thread->input_handler_manager() : nullptr; 1214 render_thread ? render_thread->input_handler_manager() : nullptr;
1215 if (input_handler_manager) { 1215 if (input_handler_manager) {
1216 DCHECK(render_view_->HasAddedInputHandler()); 1216 DCHECK(render_view_->HasAddedInputHandler());
1217 input_handler_manager->RegisterRoutingID(GetRoutingID()); 1217 input_handler_manager->RegisterRoutingID(GetRoutingID());
1218 } 1218 }
1219 } 1219 }
1220 1220
1221 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { 1221 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) {
1222 DCHECK(!blame_context_); 1222 DCHECK(!blame_context_);
1223 blame_context_ = base::WrapUnique(new FrameBlameContext(this, parent_frame)); 1223 blame_context_ = base::MakeUnique<FrameBlameContext>(this, parent_frame);
1224 blame_context_->Initialize(); 1224 blame_context_->Initialize();
1225 } 1225 }
1226 1226
1227 RenderWidget* RenderFrameImpl::GetRenderWidget() { 1227 RenderWidget* RenderFrameImpl::GetRenderWidget() {
1228 RenderFrameImpl* local_root = 1228 RenderFrameImpl* local_root =
1229 RenderFrameImpl::FromWebFrame(frame_->localRoot()); 1229 RenderFrameImpl::FromWebFrame(frame_->localRoot());
1230 return local_root->render_widget_.get(); 1230 return local_root->render_widget_.get();
1231 } 1231 }
1232 1232
1233 #if defined(ENABLE_PLUGINS) 1233 #if defined(ENABLE_PLUGINS)
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after
2262 // programming error (there are many ways to DoS the user so it's not 2262 // programming error (there are many ways to DoS the user so it's not
2263 // considered a "real" security check), either in JS requesting many file 2263 // considered a "real" security check), either in JS requesting many file
2264 // choosers to pop up, or in a plugin. 2264 // choosers to pop up, or in a plugin.
2265 // 2265 //
2266 // TODO(brettw): We might possibly want to require a user gesture to open 2266 // TODO(brettw): We might possibly want to require a user gesture to open
2267 // a file picker, which will address this issue in a better way. 2267 // a file picker, which will address this issue in a better way.
2268 return false; 2268 return false;
2269 } 2269 }
2270 2270
2271 file_chooser_completions_.push_back( 2271 file_chooser_completions_.push_back(
2272 base::WrapUnique(new PendingFileChooser(params, completion))); 2272 base::MakeUnique<PendingFileChooser>(params, completion));
2273 if (file_chooser_completions_.size() == 1) { 2273 if (file_chooser_completions_.size() == 1) {
2274 // Actually show the browse dialog when this is the first request. 2274 // Actually show the browse dialog when this is the first request.
2275 Send(new FrameHostMsg_RunFileChooser(routing_id_, params)); 2275 Send(new FrameHostMsg_RunFileChooser(routing_id_, params));
2276 } 2276 }
2277 return true; 2277 return true;
2278 } 2278 }
2279 2279
2280 void RenderFrameImpl::LoadNavigationErrorPage( 2280 void RenderFrameImpl::LoadNavigationErrorPage(
2281 const WebURLRequest& failed_request, 2281 const WebURLRequest& failed_request,
2282 const WebURLError& error, 2282 const WebURLError& error,
(...skipping 3438 matching lines...) Expand 10 before | Expand all | Expand 10 after
5721 } 5721 }
5722 5722
5723 void RenderFrameImpl::InitializeUserMediaClient() { 5723 void RenderFrameImpl::InitializeUserMediaClient() {
5724 if (!RenderThreadImpl::current()) // Will be NULL during unit tests. 5724 if (!RenderThreadImpl::current()) // Will be NULL during unit tests.
5725 return; 5725 return;
5726 5726
5727 #if defined(ENABLE_WEBRTC) 5727 #if defined(ENABLE_WEBRTC)
5728 DCHECK(!web_user_media_client_); 5728 DCHECK(!web_user_media_client_);
5729 web_user_media_client_ = new UserMediaClientImpl( 5729 web_user_media_client_ = new UserMediaClientImpl(
5730 this, RenderThreadImpl::current()->GetPeerConnectionDependencyFactory(), 5730 this, RenderThreadImpl::current()->GetPeerConnectionDependencyFactory(),
5731 base::WrapUnique(new MediaStreamDispatcher(this))); 5731 base::MakeUnique<MediaStreamDispatcher>(this));
5732 #endif 5732 #endif
5733 } 5733 }
5734 5734
5735 WebMediaPlayer* RenderFrameImpl::CreateWebMediaPlayerForMediaStream( 5735 WebMediaPlayer* RenderFrameImpl::CreateWebMediaPlayerForMediaStream(
5736 WebMediaPlayerClient* client, 5736 WebMediaPlayerClient* client,
5737 const WebString& sink_id, 5737 const WebString& sink_id,
5738 const WebSecurityOrigin& security_origin) { 5738 const WebSecurityOrigin& security_origin) {
5739 #if defined(ENABLE_WEBRTC) 5739 #if defined(ENABLE_WEBRTC)
5740 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) 5740 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
5741 const bool found_neon = 5741 const bool found_neon =
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
6343 // event target. Potentially a Pepper plugin will receive the event. 6343 // event target. Potentially a Pepper plugin will receive the event.
6344 // In order to tell whether a plugin gets the last mouse event and which it 6344 // In order to tell whether a plugin gets the last mouse event and which it
6345 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6345 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6346 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6346 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6347 // |pepper_last_mouse_event_target_|. 6347 // |pepper_last_mouse_event_target_|.
6348 pepper_last_mouse_event_target_ = nullptr; 6348 pepper_last_mouse_event_target_ = nullptr;
6349 #endif 6349 #endif
6350 } 6350 }
6351 6351
6352 } // namespace content 6352 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/push_messaging/push_messaging_dispatcher.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698