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 "content/worker/webworkerclient_proxy.h" | 5 #include "content/worker/webworkerclient_proxy.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "content/common/content_switches.h" | 9 #include "content/common/content_switches.h" |
10 #include "content/common/file_system/file_system_dispatcher.h" | 10 #include "content/common/file_system/file_system_dispatcher.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 | 143 |
144 bool WebWorkerClientProxy::allowDatabase(WebFrame* frame, | 144 bool WebWorkerClientProxy::allowDatabase(WebFrame* frame, |
145 const WebString& name, | 145 const WebString& name, |
146 const WebString& display_name, | 146 const WebString& display_name, |
147 unsigned long estimated_size) { | 147 unsigned long estimated_size) { |
148 WebSecurityOrigin origin = frame->securityOrigin(); | 148 WebSecurityOrigin origin = frame->securityOrigin(); |
149 if (origin.isEmpty()) | 149 if (origin.isEmpty()) |
150 return false; | 150 return false; |
151 | 151 |
152 bool result; | 152 bool result = false; |
153 if (!Send(new WorkerProcessHostMsg_AllowDatabase(route_id_, | 153 Send(new WorkerProcessHostMsg_AllowDatabase( |
154 GURL(origin.toString().utf8()), name, display_name, estimated_size, | 154 route_id_, GURL(origin.toString().utf8()), name, display_name, |
155 &result))) | 155 estimated_size, &result)); |
156 return false; | |
157 | |
158 return result; | 156 return result; |
159 } | 157 } |
160 | 158 |
| 159 bool WebWorkerClientProxy::allowFileSystem() { |
| 160 bool result = false; |
| 161 Send(new WorkerProcessHostMsg_AllowFileSystem( |
| 162 route_id_, stub_->url().GetOrigin(), &result)); |
| 163 return result; |
| 164 } |
| 165 |
161 void WebWorkerClientProxy::openFileSystem( | 166 void WebWorkerClientProxy::openFileSystem( |
162 WebKit::WebFileSystem::Type type, | 167 WebKit::WebFileSystem::Type type, |
163 long long size, | 168 long long size, |
164 bool create, | 169 bool create, |
165 WebKit::WebFileSystemCallbacks* callbacks) { | 170 WebKit::WebFileSystemCallbacks* callbacks) { |
166 ChildThread::current()->file_system_dispatcher()->OpenFileSystem( | 171 ChildThread::current()->file_system_dispatcher()->OpenFileSystem( |
167 stub_->url().GetOrigin(), static_cast<fileapi::FileSystemType>(type), | 172 stub_->url().GetOrigin(), static_cast<fileapi::FileSystemType>(type), |
168 size, create, new WebFileSystemCallbackDispatcher(callbacks)); | 173 size, create, new WebFileSystemCallbackDispatcher(callbacks)); |
169 } | 174 } |
170 | 175 |
(...skipping 13 matching lines...) Expand all Loading... |
184 | 189 |
185 // This shuts down the process cleanly from the perspective of the browser | 190 // This shuts down the process cleanly from the perspective of the browser |
186 // process, and avoids the crashed worker infobar from appearing to the new | 191 // process, and avoids the crashed worker infobar from appearing to the new |
187 // page. It's ok to post several of theese, because the first executed task | 192 // page. It's ok to post several of theese, because the first executed task |
188 // will exit the message loop and subsequent ones won't be executed. | 193 // will exit the message loop and subsequent ones won't be executed. |
189 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 194 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
190 kill_process_factory_.NewRunnableMethod( | 195 kill_process_factory_.NewRunnableMethod( |
191 &WebWorkerClientProxy::workerContextDestroyed), | 196 &WebWorkerClientProxy::workerContextDestroyed), |
192 kMaxTimeForRunawayWorkerMs); | 197 kMaxTimeForRunawayWorkerMs); |
193 } | 198 } |
OLD | NEW |