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

Side by Side Diff: services/clipboard/clipboard_standalone_impl.cc

Issue 1408793006: Convert "return local_var.Pass();" to "return local_var;". (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "services/clipboard/clipboard_standalone_impl.h" 5 #include "services/clipboard/clipboard_standalone_impl.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "mojo/public/cpp/bindings/array.h" 10 #include "mojo/public/cpp/bindings/array.h"
(...skipping 12 matching lines...) Expand all
23 public: 23 public:
24 ClipboardData() {} 24 ClipboardData() {}
25 ~ClipboardData() {} 25 ~ClipboardData() {}
26 26
27 Array<String> GetMimeTypes() const { 27 Array<String> GetMimeTypes() const {
28 auto types = Array<String>::New(data_types_.size()); 28 auto types = Array<String>::New(data_types_.size());
29 int i = 0; 29 int i = 0;
30 for (auto it = data_types_.cbegin(); it != data_types_.cend(); ++it, ++i) 30 for (auto it = data_types_.cbegin(); it != data_types_.cend(); ++it, ++i)
31 types[i] = it.GetKey(); 31 types[i] = it.GetKey();
32 32
33 return types.Pass(); 33 return types;
34 } 34 }
35 35
36 void SetData(Map<String, Array<uint8_t>> data) { data_types_ = data.Pass(); } 36 void SetData(Map<String, Array<uint8_t>> data) { data_types_ = data.Pass(); }
37 37
38 void GetData(const String& mime_type, Array<uint8_t>* data) const { 38 void GetData(const String& mime_type, Array<uint8_t>* data) const {
39 auto it = data_types_.find(mime_type); 39 auto it = data_types_.find(mime_type);
40 if (it != data_types_.cend()) 40 if (it != data_types_.cend())
41 *data = it.GetValue().Clone(); 41 *data = it.GetValue().Clone();
42 } 42 }
43 43
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 void ClipboardStandaloneImpl::WriteClipboardData( 89 void ClipboardStandaloneImpl::WriteClipboardData(
90 Clipboard::Type clipboard_type, 90 Clipboard::Type clipboard_type,
91 Map<String, Array<uint8_t>> data) { 91 Map<String, Array<uint8_t>> data) {
92 const size_t ndx = static_cast<size_t>(clipboard_type); 92 const size_t ndx = static_cast<size_t>(clipboard_type);
93 CHECK_LT(ndx, arraysize(sequence_number_)); 93 CHECK_LT(ndx, arraysize(sequence_number_));
94 sequence_number_[ndx]++; 94 sequence_number_[ndx]++;
95 clipboard_state_[ndx]->SetData(data.Pass()); 95 clipboard_state_[ndx]->SetData(data.Pass());
96 } 96 }
97 97
98 } // namespace clipboard 98 } // namespace clipboard
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698