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

Side by Side Diff: WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h

Issue 11192017: ********** WebCore blob hacking (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 8 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 // WorkerContext::Observer method. 88 // WorkerContext::Observer method.
89 virtual void notifyStop(); 89 virtual void notifyStop();
90 90
91 static PassRefPtr<WorkerFileWriterCallbacksBridge> create(const WebCore::KUR L& path, WebCore::WorkerLoaderProxy* proxy, WebCore::ScriptExecutionContext* wor kerContext, WebCore::AsyncFileWriterClient* client) 91 static PassRefPtr<WorkerFileWriterCallbacksBridge> create(const WebCore::KUR L& path, WebCore::WorkerLoaderProxy* proxy, WebCore::ScriptExecutionContext* wor kerContext, WebCore::AsyncFileWriterClient* client)
92 { 92 {
93 return adoptRef(new WorkerFileWriterCallbacksBridge(path, proxy, workerC ontext, client)); 93 return adoptRef(new WorkerFileWriterCallbacksBridge(path, proxy, workerC ontext, client));
94 } 94 }
95 95
96 // Methods that create an instance and post an initial request task to the m ain thread. They must be called on the worker thread. 96 // Methods that create an instance and post an initial request task to the m ain thread. They must be called on the worker thread.
97 void postWriteToMainThread(long long position, const WebCore::KURL& data); 97 void postWriteToMainThread(long long position, const String& blobUUID);
98 void postTruncateToMainThread(long long length); 98 void postTruncateToMainThread(long long length);
99 void postAbortToMainThread(); 99 void postAbortToMainThread();
100 100
101 // The owning WorkerAsyncFileWriterChromium should call this method before d ropping its last reference to the bridge, on the context thread. 101 // The owning WorkerAsyncFileWriterChromium should call this method before d ropping its last reference to the bridge, on the context thread.
102 // The actual deletion of the WorkerFileWriterCallbacksBridge may happen on either the main or context thread, depending on where the last reference goes aw ay; that's safe as long as this is called first. 102 // The actual deletion of the WorkerFileWriterCallbacksBridge may happen on either the main or context thread, depending on where the last reference goes aw ay; that's safe as long as this is called first.
103 void postShutdownToMainThread(PassRefPtr<WorkerFileWriterCallbacksBridge>); 103 void postShutdownToMainThread(PassRefPtr<WorkerFileWriterCallbacksBridge>);
104 104
105 // Callback methods that are called on the main thread. 105 // Callback methods that are called on the main thread.
106 // These are the implementation of WebKit::WebFileWriterClient. 106 // These are the implementation of WebKit::WebFileWriterClient.
107 void didWrite(long long bytes, bool complete); 107 void didWrite(long long bytes, bool complete);
108 void didFail(WebFileError); 108 void didFail(WebFileError);
109 void didTruncate(); 109 void didTruncate();
110 110
111 // Call this on the context thread to wait for the current operation to comp lete. 111 // Call this on the context thread to wait for the current operation to comp lete.
112 bool waitForOperationToComplete(); 112 bool waitForOperationToComplete();
113 113
114 private: 114 private:
115 WorkerFileWriterCallbacksBridge(const WebCore::KURL& path, WebCore::WorkerLo aderProxy*, WebCore::ScriptExecutionContext*, WebCore::AsyncFileWriterClient*); 115 WorkerFileWriterCallbacksBridge(const WebCore::KURL& path, WebCore::WorkerLo aderProxy*, WebCore::ScriptExecutionContext*, WebCore::AsyncFileWriterClient*);
116 116
117 void postInitToMainThread(const WebCore::KURL& path); 117 void postInitToMainThread(const WebCore::KURL& path);
118 118
119 // Methods that are to be called on the main thread. 119 // Methods that are to be called on the main thread.
120 static void writeOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<W orkerFileWriterCallbacksBridge>, long long position, const WebCore::KURL& data); 120 // FIXME: param s/b a blobDataHandle?
121 static void writeOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<W orkerFileWriterCallbacksBridge>, long long position, const String& blobUUID);
121 static void truncateOnMainThread(WebCore::ScriptExecutionContext*, PassRefPt r<WorkerFileWriterCallbacksBridge>, long long length); 122 static void truncateOnMainThread(WebCore::ScriptExecutionContext*, PassRefPt r<WorkerFileWriterCallbacksBridge>, long long length);
122 static void abortOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<W orkerFileWriterCallbacksBridge>); 123 static void abortOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<W orkerFileWriterCallbacksBridge>);
123 static void initOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<Wo rkerFileWriterCallbacksBridge>, const WebCore::KURL& path); 124 static void initOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<Wo rkerFileWriterCallbacksBridge>, const WebCore::KURL& path);
124 static void shutdownOnMainThread(WebCore::ScriptExecutionContext*, PassRefPt r<WorkerFileWriterCallbacksBridge>); 125 static void shutdownOnMainThread(WebCore::ScriptExecutionContext*, PassRefPt r<WorkerFileWriterCallbacksBridge>);
125 126
126 // Methods that dispatch to AsyncFileWriterClient on the worker threads. 127 // Methods that dispatch to AsyncFileWriterClient on the worker threads.
127 static void didWriteOnWorkerThread(WebCore::ScriptExecutionContext*, PassRef Ptr<WorkerFileWriterCallbacksBridge>, long long length, bool complete); 128 static void didWriteOnWorkerThread(WebCore::ScriptExecutionContext*, PassRef Ptr<WorkerFileWriterCallbacksBridge>, long long length, bool complete);
128 static void didFailOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefP tr<WorkerFileWriterCallbacksBridge>, WebFileError); 129 static void didFailOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefP tr<WorkerFileWriterCallbacksBridge>, WebFileError);
129 static void didTruncateOnWorkerThread(WebCore::ScriptExecutionContext*, Pass RefPtr<WorkerFileWriterCallbacksBridge>); 130 static void didTruncateOnWorkerThread(WebCore::ScriptExecutionContext*, Pass RefPtr<WorkerFileWriterCallbacksBridge>);
130 131
(...skipping 27 matching lines...) Expand all
158 159
159 // Used by postTaskForModeToWorkerContext and runInMode. 160 // Used by postTaskForModeToWorkerContext and runInMode.
160 String m_mode; 161 String m_mode;
161 }; 162 };
162 163
163 } // namespace WebCore 164 } // namespace WebCore
164 165
165 #endif 166 #endif
166 167
167 #endif // WorkerFileWriterCallbacksBridge_h 168 #endif // WorkerFileWriterCallbacksBridge_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698