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

Side by Side Diff: Source/platform/clipboard/ClipboardUtilitiesWin.cpp

Issue 400543004: Rename WebCore namespace to blink in Platform (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. 3 * Copyright (C) 2009 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 14 matching lines...) Expand all
25 */ 25 */
26 26
27 #include "config.h" 27 #include "config.h"
28 #include "platform/clipboard/ClipboardUtilities.h" 28 #include "platform/clipboard/ClipboardUtilities.h"
29 29
30 #include "wtf/text/StringBuilder.h" 30 #include "wtf/text/StringBuilder.h"
31 #include "wtf/text/WTFString.h" 31 #include "wtf/text/WTFString.h"
32 32
33 #include <shlwapi.h> 33 #include <shlwapi.h>
34 34
35 namespace WebCore { 35 namespace blink {
36 36
37 // FAT32 and NTFS both limit filenames to a maximum of 255 characters. 37 // FAT32 and NTFS both limit filenames to a maximum of 255 characters.
38 static const unsigned maxFilenameLength = 255; 38 static const unsigned maxFilenameLength = 255;
39 39
40 // Returns true if the specified character is not valid in a file name. This 40 // Returns true if the specified character is not valid in a file name. This
41 // is intended for use with removeCharacters. 41 // is intended for use with removeCharacters.
42 static bool isInvalidFileCharacter(UChar c) 42 static bool isInvalidFileCharacter(UChar c)
43 { 43 {
44 return !(PathGetCharType(c) & (GCT_LFNCHAR | GCT_SHORTCHAR)); 44 return !(PathGetCharType(c) & (GCT_LFNCHAR | GCT_SHORTCHAR));
45 } 45 }
(...skipping 17 matching lines...) Expand all
63 name = name.removeCharacters(&isInvalidFileCharacter); 63 name = name.removeCharacters(&isInvalidFileCharacter);
64 extension = extension.removeCharacters(&isInvalidFileCharacter); 64 extension = extension.removeCharacters(&isInvalidFileCharacter);
65 65
66 if (extension.length() >= maxFilenameLength) 66 if (extension.length() >= maxFilenameLength)
67 extension = String(); 67 extension = String();
68 68
69 // Truncate overly-long filenames, reserving one character for a dot. 69 // Truncate overly-long filenames, reserving one character for a dot.
70 name.truncate(maxFilenameLength - extension.length() - 1); 70 name.truncate(maxFilenameLength - extension.length() - 1);
71 } 71 }
72 72
73 } // namespace WebCore 73 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/clipboard/ClipboardUtilitiesTest.cpp ('k') | Source/platform/exported/WebAudioBus.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698