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

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

Issue 611633002: mojom: Add associative arrays to the mojom language. (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 (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "mojo/services/clipboard/clipboard_standalone_impl.h" 5 #include "mojo/services/clipboard/clipboard_standalone_impl.h"
6 6
7 namespace mojo { 7 namespace mojo {
8 8
9 typedef std::vector<uint8_t> ByteVector; 9 typedef std::vector<uint8_t> ByteVector;
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 Clipboard::Type clipboard_type, 90 Clipboard::Type clipboard_type,
91 mojo::Array<MimeTypePairPtr> data) { 91 mojo::Array<MimeTypePairPtr> data) {
92 std::map<std::string, ByteVector> mime_data; 92 std::map<std::string, ByteVector> mime_data;
93 for (size_t i = 0; i < data.size(); ++i) 93 for (size_t i = 0; i < data.size(); ++i)
94 mime_data[data[i]->mime_type] = data[i]->data; 94 mime_data[data[i]->mime_type] = data[i]->data;
95 95
96 sequence_number_[clipboard_type]++; 96 sequence_number_[clipboard_type]++;
97 clipboard_state_[clipboard_type]->SetData(&mime_data); 97 clipboard_state_[clipboard_type]->SetData(&mime_data);
98 } 98 }
99 99
100 void ClipboardStandaloneImpl::FakeTestMethod(
101 const mojo::Callback<void(mojo::Map<mojo::String,
102 mojo::String>)>& callback) {
103 std::map<std::string, std::string> blah;
104 blah["one"] = "more";
105 blah["two"] = "less";
106 callback.Run(Map<String, String>::From(blah));
107 }
108
100 } // namespace mojo 109 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698