OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 - (id)initWithSharedBuffer:(SharedBuffer*)buffer; | 43 - (id)initWithSharedBuffer:(SharedBuffer*)buffer; |
44 @end | 44 @end |
45 | 45 |
46 @implementation WebCoreSharedBufferData | 46 @implementation WebCoreSharedBufferData |
47 | 47 |
48 + (void)initialize | 48 + (void)initialize |
49 { | 49 { |
50 #if !USE(WEB_THREAD) | 50 #if !USE(WEB_THREAD) |
51 JSC::initializeThreading(); | 51 JSC::initializeThreading(); |
52 #if PLATFORM(QT) && USE(QTKIT) | |
53 WTF::initializeMainThread(); | |
54 #else | |
55 WTF::initializeMainThreadToProcessMainThread(); | 52 WTF::initializeMainThreadToProcessMainThread(); |
56 #endif | 53 #endif |
57 #endif // !USE(WEB_THREAD) | |
58 WebCoreObjCFinalizeOnMainThread(self); | 54 WebCoreObjCFinalizeOnMainThread(self); |
59 } | 55 } |
60 | 56 |
61 - (void)dealloc | 57 - (void)dealloc |
62 { | 58 { |
63 if (WebCoreObjCScheduleDeallocateOnMainThread([WebCoreSharedBufferData class
], self)) | 59 if (WebCoreObjCScheduleDeallocateOnMainThread([WebCoreSharedBufferData class
], self)) |
64 return; | 60 return; |
65 | 61 |
66 [super dealloc]; | 62 [super dealloc]; |
67 } | 63 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 103 |
108 CFDataRef SharedBuffer::createCFData() | 104 CFDataRef SharedBuffer::createCFData() |
109 { | 105 { |
110 if (m_cfData) { | 106 if (m_cfData) { |
111 CFRetain(m_cfData.get()); | 107 CFRetain(m_cfData.get()); |
112 return m_cfData.get(); | 108 return m_cfData.get(); |
113 } | 109 } |
114 | 110 |
115 return (CFDataRef)RetainPtr<WebCoreSharedBufferData>(AdoptNS, [[WebCoreShare
dBufferData alloc] initWithSharedBuffer:this]).leakRef(); | 111 return (CFDataRef)RetainPtr<WebCoreSharedBufferData>(AdoptNS, [[WebCoreShare
dBufferData alloc] initWithSharedBuffer:this]).leakRef(); |
116 } | 112 } |
117 #if !(PLATFORM(QT) && USE(QTKIT)) | |
118 PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& fi
lePath) | |
119 { | |
120 NSData *resourceData = [NSData dataWithContentsOfFile:filePath]; | |
121 if (resourceData) | |
122 return SharedBuffer::wrapNSData(resourceData); | |
123 return 0; | |
124 } | |
125 #endif | |
126 } | 113 } |
127 | 114 |
OLD | NEW |