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

Side by Side Diff: native_client_sdk/src/examples/api/file_io/file_io.cc

Issue 1355993002: Cleanup: Pass std::string as const reference from native_client_sdk/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /// @file file_io.cc 5 /// @file file_io.cc
6 /// This example demonstrates the use of persistent file I/O 6 /// This example demonstrates the use of persistent file I/O
7 7
8 #define __STDC_LIMIT_MACROS 8 #define __STDC_LIMIT_MACROS
9 #include <stdio.h> 9 #include <stdio.h>
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 message.Set(i + 1, strings[i]); 93 message.Set(i + 1, strings[i]);
94 } 94 }
95 95
96 PostMessage(message); 96 PostMessage(message);
97 } 97 }
98 98
99 void PostArrayMessage(const char* command) { 99 void PostArrayMessage(const char* command) {
100 PostArrayMessage(command, StringVector()); 100 PostArrayMessage(command, StringVector());
101 } 101 }
102 102
103 void PostArrayMessage(const char* command, std::string s) { 103 void PostArrayMessage(const char* command, const std::string& s) {
104 StringVector sv; 104 StringVector sv;
105 sv.push_back(s); 105 sv.push_back(s);
106 PostArrayMessage(command, sv); 106 PostArrayMessage(command, sv);
107 } 107 }
108 108
109 /// Handler for messages coming in from the browser via postMessage(). The 109 /// Handler for messages coming in from the browser via postMessage(). The
110 /// @a var_message can contain anything: a JSON string; a string that encodes 110 /// @a var_message can contain anything: a JSON string; a string that encodes
111 /// method names and arguments; etc. 111 /// method names and arguments; etc.
112 /// 112 ///
113 /// Here we use messages to communicate with the user interface 113 /// Here we use messages to communicate with the user interface
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 }; 384 };
385 385
386 namespace pp { 386 namespace pp {
387 /// Factory function called by the browser when the module is first loaded. 387 /// Factory function called by the browser when the module is first loaded.
388 /// The browser keeps a singleton of this module. It calls the 388 /// The browser keeps a singleton of this module. It calls the
389 /// CreateInstance() method on the object you return to make instances. There 389 /// CreateInstance() method on the object you return to make instances. There
390 /// is one instance per <embed> tag on the page. This is the main binding 390 /// is one instance per <embed> tag on the page. This is the main binding
391 /// point for your NaCl module with the browser. 391 /// point for your NaCl module with the browser.
392 Module* CreateModule() { return new FileIoModule(); } 392 Module* CreateModule() { return new FileIoModule(); }
393 } // namespace pp 393 } // namespace pp
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698