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

Side by Side Diff: third_party/WebKit/Source/wtf/text/AtomicStringCF.cpp

Issue 1436153002: Apply clang-format with Chromium-style without column limit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 15 matching lines...) Expand all
26 #include "config.h" 26 #include "config.h"
27 #include "wtf/text/AtomicString.h" 27 #include "wtf/text/AtomicString.h"
28 28
29 #if OS(MACOSX) 29 #if OS(MACOSX)
30 30
31 #include "wtf/text/CString.h" 31 #include "wtf/text/CString.h"
32 #include <CoreFoundation/CoreFoundation.h> 32 #include <CoreFoundation/CoreFoundation.h>
33 33
34 namespace WTF { 34 namespace WTF {
35 35
36 PassRefPtr<StringImpl> AtomicString::add(CFStringRef string) 36 PassRefPtr<StringImpl> AtomicString::add(CFStringRef string) {
37 { 37 if (!string)
38 if (!string) 38 return nullptr;
39 return nullptr;
40 39
41 CFIndex length = CFStringGetLength(string); 40 CFIndex length = CFStringGetLength(string);
42 41
43 if (const LChar* ptr = reinterpret_cast<const LChar*>(CFStringGetCStringPtr( string, kCFStringEncodingISOLatin1))) 42 if (const LChar* ptr = reinterpret_cast<const LChar*>(CFStringGetCStringPtr(st ring, kCFStringEncodingISOLatin1)))
44 return add(ptr, length); 43 return add(ptr, length);
45 44
46 if (const UniChar* ptr = CFStringGetCharactersPtr(string)) 45 if (const UniChar* ptr = CFStringGetCharactersPtr(string))
47 return add(reinterpret_cast<const UChar*>(ptr), length); 46 return add(reinterpret_cast<const UChar*>(ptr), length);
48 47
49 Vector<UniChar, 1024> ucharBuffer(length); 48 Vector<UniChar, 1024> ucharBuffer(length);
50 CFStringGetCharacters(string, CFRangeMake(0, length), ucharBuffer.data()); 49 CFStringGetCharacters(string, CFRangeMake(0, length), ucharBuffer.data());
51 return add(reinterpret_cast<const UChar*>(ucharBuffer.data()), length); 50 return add(reinterpret_cast<const UChar*>(ucharBuffer.data()), length);
52 } 51 }
53 52
54 } // namespace WTF 53 } // namespace WTF
55 54
56 #endif // OS(MACOSX) 55 #endif // OS(MACOSX)
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/AtomicString.cpp ('k') | third_party/WebKit/Source/wtf/text/AtomicStringHash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698