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

Side by Side Diff: content/common/input/input_param_traits.cc

Issue 660883003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/common/input/input_param_traits.h" 5 #include "content/common/input/input_param_traits.h"
6 6
7 #include "content/common/content_param_traits.h" 7 #include "content/common/content_param_traits.h"
8 #include "content/common/input/synthetic_pinch_gesture_params.h" 8 #include "content/common/input/synthetic_pinch_gesture_params.h"
9 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" 9 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h"
10 #include "content/common/input/web_input_event_traits.h" 10 #include "content/common/input/web_input_event_traits.h"
11 #include "content/common/input_messages.h" 11 #include "content/common/input_messages.h"
12 12
13 namespace IPC { 13 namespace IPC {
14 namespace { 14 namespace {
15 template<typename GestureType> 15 template<typename GestureType>
16 scoped_ptr<content::SyntheticGestureParams> ReadGestureParams( 16 scoped_ptr<content::SyntheticGestureParams> ReadGestureParams(
17 const Message* m, 17 const Message* m,
18 PickleIterator* iter) 18 PickleIterator* iter)
19 { 19 {
20 scoped_ptr<GestureType> gesture_params(new GestureType); 20 scoped_ptr<GestureType> gesture_params(new GestureType);
21 if (!ReadParam(m, iter, gesture_params.get())) 21 if (!ReadParam(m, iter, gesture_params.get()))
22 return scoped_ptr<content::SyntheticGestureParams>(); 22 return scoped_ptr<content::SyntheticGestureParams>();
23 23
24 return gesture_params.template PassAs<content::SyntheticGestureParams>(); 24 return gesture_params.Pass();
25 } 25 }
26 } // namespace 26 } // namespace
27 27
28 void ParamTraits<content::ScopedWebInputEvent>::Write(Message* m, 28 void ParamTraits<content::ScopedWebInputEvent>::Write(Message* m,
29 const param_type& p) { 29 const param_type& p) {
30 bool valid_web_event = !!p; 30 bool valid_web_event = !!p;
31 WriteParam(m, valid_web_event); 31 WriteParam(m, valid_web_event);
32 if (valid_web_event) 32 if (valid_web_event)
33 WriteParam(m, static_cast<WebInputEventPointer>(p.get())); 33 WriteParam(m, static_cast<WebInputEventPointer>(p.get()));
34 } 34 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 break; 119 break;
120 case content::SyntheticGestureParams::TAP_GESTURE: 120 case content::SyntheticGestureParams::TAP_GESTURE:
121 LogParam( 121 LogParam(
122 *content::SyntheticTapGestureParams::Cast(p.gesture_params()), 122 *content::SyntheticTapGestureParams::Cast(p.gesture_params()),
123 l); 123 l);
124 break; 124 break;
125 } 125 }
126 } 126 }
127 127
128 } // namespace IPC 128 } // namespace IPC
OLDNEW
« no previous file with comments | « content/common/gpu/media/v4l2_video_device.cc ('k') | content/common/input/input_param_traits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698