Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/glue/webkitplatformsupport_impl.h" | 5 #include "webkit/glue/webkitplatformsupport_impl.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
| 8 #include <malloc.h> | 8 #include <malloc.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 417 { "soloCC", IDR_AUTOFILL_CC_SOLO }, | 417 { "soloCC", IDR_AUTOFILL_CC_SOLO }, |
| 418 { "visaCC", IDR_AUTOFILL_CC_VISA }, | 418 { "visaCC", IDR_AUTOFILL_CC_VISA }, |
| 419 }; | 419 }; |
| 420 | 420 |
| 421 } // namespace | 421 } // namespace |
| 422 | 422 |
| 423 WebData WebKitPlatformSupportImpl::loadResource(const char* name) { | 423 WebData WebKitPlatformSupportImpl::loadResource(const char* name) { |
| 424 // Some clients will call into this method with an empty |name| when they have | 424 // Some clients will call into this method with an empty |name| when they have |
| 425 // optional resources. For example, the PopupMenuChromium code can have icons | 425 // optional resources. For example, the PopupMenuChromium code can have icons |
| 426 // for some Autofill items but not for others. | 426 // for some Autofill items but not for others. |
| 427 if (!strlen(name)) | 427 if (*name == '\0') |
|
wtc
2011/10/21 19:18:19
Some strlen implementations may "helpfully" allow
| |
| 428 return WebData(); | 428 return WebData(); |
| 429 | 429 |
| 430 // Check the name prefix to see if it's an audio resource. | 430 // Check the name prefix to see if it's an audio resource. |
| 431 if (StartsWithASCII(name, "IRC_Composite", true)) | 431 if (StartsWithASCII(name, "IRC_Composite", true)) |
| 432 return loadAudioSpatializationResource(name); | 432 return loadAudioSpatializationResource(name); |
| 433 | 433 |
| 434 for (size_t i = 0; i < arraysize(kDataResources); ++i) { | 434 for (size_t i = 0; i < arraysize(kDataResources); ++i) { |
| 435 if (!strcmp(name, kDataResources[i].name)) { | 435 if (!strcmp(name, kDataResources[i].name)) { |
| 436 base::StringPiece resource = GetDataResource(kDataResources[i].id); | 436 base::StringPiece resource = GetDataResource(kDataResources[i].id); |
| 437 return WebData(resource.data(), resource.size()); | 437 return WebData(resource.data(), resource.size()); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 675 } | 675 } |
| 676 | 676 |
| 677 // static | 677 // static |
| 678 void WebKitPlatformSupportImpl::DestroyCurrentThread(void* thread) { | 678 void WebKitPlatformSupportImpl::DestroyCurrentThread(void* thread) { |
| 679 WebThreadImplForMessageLoop* impl = | 679 WebThreadImplForMessageLoop* impl = |
| 680 static_cast<WebThreadImplForMessageLoop*>(thread); | 680 static_cast<WebThreadImplForMessageLoop*>(thread); |
| 681 delete impl; | 681 delete impl; |
| 682 } | 682 } |
| 683 | 683 |
| 684 } // namespace webkit_glue | 684 } // namespace webkit_glue |
| OLD | NEW |