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

Side by Side Diff: ios/web/navigation/nscoder_util.mm

Issue 2605913002: Fix include import in ios/web (Closed)
Patch Set: add missing #import Created 3 years, 11 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ios/web/navigation/nscoder_util.h" 9 #import "ios/web/navigation/nscoder_util.h"
10 10
11 #if !defined(__has_feature) || !__has_feature(objc_arc) 11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support." 12 #error "This file requires ARC support."
13 #endif 13 #endif
14 14
15 namespace web { 15 namespace web {
16 namespace nscoder_util { 16 namespace nscoder_util {
17 17
18 void EncodeString(NSCoder* coder, NSString* key, const std::string& string) { 18 void EncodeString(NSCoder* coder, NSString* key, const std::string& string) {
19 [coder encodeBytes:reinterpret_cast<const uint8_t*>(string.data()) 19 [coder encodeBytes:reinterpret_cast<const uint8_t*>(string.data())
20 length:string.size() 20 length:string.size()
21 forKey:key]; 21 forKey:key];
22 } 22 }
23 23
24 std::string DecodeString(NSCoder* decoder, NSString* key) { 24 std::string DecodeString(NSCoder* decoder, NSString* key) {
25 NSUInteger length = 0; 25 NSUInteger length = 0;
26 const uint8_t* bytes = [decoder decodeBytesForKey:key returnedLength:&length]; 26 const uint8_t* bytes = [decoder decodeBytesForKey:key returnedLength:&length];
27 return std::string(reinterpret_cast<const char*>(bytes), length); 27 return std::string(reinterpret_cast<const char*>(bytes), length);
28 } 28 }
29 29
30 } // namespace nscoder_util 30 } // namespace nscoder_util
31 } // namespace web 31 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/navigation/navigation_manager_impl.mm ('k') | ios/web/navigation/nscoder_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698