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

Side by Side Diff: content/common/content_param_traits.cc

Issue 2240983003: Move |ScopedWebInputEvent| and |WebInputEventTraits| from |content::| to "ui/events/blink" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and ncarter's review 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 (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/common/content_param_traits.h" 5 #include "content/common/content_param_traits.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "content/common/input/web_input_event_traits.h"
11 #include "net/base/ip_endpoint.h" 10 #include "net/base/ip_endpoint.h"
11 #include "ui/events/blink/web_input_event_traits.h"
12 12
13 namespace IPC { 13 namespace IPC {
14 14
15 void ParamTraits<WebInputEventPointer>::GetSize(base::PickleSizer* s, 15 void ParamTraits<WebInputEventPointer>::GetSize(base::PickleSizer* s,
16 const param_type& p) { 16 const param_type& p) {
17 s->AddData(p->size); 17 s->AddData(p->size);
18 } 18 }
19 19
20 void ParamTraits<WebInputEventPointer>::Write(base::Pickle* m, 20 void ParamTraits<WebInputEventPointer>::Write(base::Pickle* m,
21 const param_type& p) { 21 const param_type& p) {
(...skipping 13 matching lines...) Expand all
35 NOTREACHED(); 35 NOTREACHED();
36 return false; 36 return false;
37 } 37 }
38 param_type event = reinterpret_cast<param_type>(data); 38 param_type event = reinterpret_cast<param_type>(data);
39 // Check that the data size matches that of the event. 39 // Check that the data size matches that of the event.
40 if (data_length != static_cast<int>(event->size)) { 40 if (data_length != static_cast<int>(event->size)) {
41 NOTREACHED(); 41 NOTREACHED();
42 return false; 42 return false;
43 } 43 }
44 const size_t expected_size_for_type = 44 const size_t expected_size_for_type =
45 content::WebInputEventTraits::GetSize(event->type); 45 ui::WebInputEventTraits::GetSize(event->type);
46 if (data_length != static_cast<int>(expected_size_for_type)) { 46 if (data_length != static_cast<int>(expected_size_for_type)) {
47 NOTREACHED(); 47 NOTREACHED();
48 return false; 48 return false;
49 } 49 }
50 *r = event; 50 *r = event;
51 return true; 51 return true;
52 } 52 }
53 53
54 void ParamTraits<WebInputEventPointer>::Log(const param_type& p, 54 void ParamTraits<WebInputEventPointer>::Log(const param_type& p,
55 std::string* l) { 55 std::string* l) {
(...skipping 28 matching lines...) Expand all
84 #undef CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_ 84 #undef CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_
85 #include "content/common/content_param_traits_macros.h" 85 #include "content/common/content_param_traits_macros.h"
86 } // namespace IPC 86 } // namespace IPC
87 87
88 // Generate param traits log methods. 88 // Generate param traits log methods.
89 #include "ipc/param_traits_log_macros.h" 89 #include "ipc/param_traits_log_macros.h"
90 namespace IPC { 90 namespace IPC {
91 #undef CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_ 91 #undef CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_
92 #include "content/common/content_param_traits_macros.h" 92 #include "content/common/content_param_traits_macros.h"
93 } // namespace IPC 93 } // namespace IPC
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/input/event_with_latency_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698