| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/websharedworkerclient_proxy.h" | 5 #include "content/worker/websharedworkerclient_proxy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "content/common/fileapi/file_system_dispatcher.h" | 10 #include "content/common/fileapi/file_system_dispatcher.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 return result; | 161 return result; |
| 162 } | 162 } |
| 163 | 163 |
| 164 void WebSharedWorkerClientProxy::openFileSystem( | 164 void WebSharedWorkerClientProxy::openFileSystem( |
| 165 WebKit::WebFileSystemType type, | 165 WebKit::WebFileSystemType type, |
| 166 long long size, | 166 long long size, |
| 167 bool create, | 167 bool create, |
| 168 WebKit::WebFileSystemCallbacks* callbacks) { | 168 WebKit::WebFileSystemCallbacks* callbacks) { |
| 169 ChildThread::current()->file_system_dispatcher()->OpenFileSystem( | 169 ChildThread::current()->file_system_dispatcher()->OpenFileSystem( |
| 170 stub_->url().GetOrigin(), static_cast<fileapi::FileSystemType>(type), | 170 stub_->url().GetOrigin(), static_cast<fileapi::FileSystemType>(type), |
| 171 size, create, new WebFileSystemCallbackDispatcher(callbacks)); | 171 size, create, |
| 172 base::Bind(&WebFileSystemCallbackDispatcher::DidOpenFileSystem, |
| 173 base::Owned(new WebFileSystemCallbackDispatcher(callbacks)))); |
| 172 } | 174 } |
| 173 | 175 |
| 174 bool WebSharedWorkerClientProxy::allowIndexedDB(const WebKit::WebString& name) { | 176 bool WebSharedWorkerClientProxy::allowIndexedDB(const WebKit::WebString& name) { |
| 175 bool result = false; | 177 bool result = false; |
| 176 Send(new WorkerProcessHostMsg_AllowIndexedDB( | 178 Send(new WorkerProcessHostMsg_AllowIndexedDB( |
| 177 route_id_, stub_->url().GetOrigin(), name, &result)); | 179 route_id_, stub_->url().GetOrigin(), name, &result)); |
| 178 return result; | 180 return result; |
| 179 } | 181 } |
| 180 | 182 |
| 181 void WebSharedWorkerClientProxy::queryUsageAndQuota( | 183 void WebSharedWorkerClientProxy::queryUsageAndQuota( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 208 // page. It's ok to post several of theese, because the first executed task | 210 // page. It's ok to post several of theese, because the first executed task |
| 209 // will exit the message loop and subsequent ones won't be executed. | 211 // will exit the message loop and subsequent ones won't be executed. |
| 210 base::MessageLoop::current()->PostDelayedTask( | 212 base::MessageLoop::current()->PostDelayedTask( |
| 211 FROM_HERE, | 213 FROM_HERE, |
| 212 base::Bind(&WebSharedWorkerClientProxy::workerContextDestroyed, | 214 base::Bind(&WebSharedWorkerClientProxy::workerContextDestroyed, |
| 213 weak_factory_.GetWeakPtr()), | 215 weak_factory_.GetWeakPtr()), |
| 214 base::TimeDelta::FromSeconds(kMaxTimeForRunawayWorkerSeconds)); | 216 base::TimeDelta::FromSeconds(kMaxTimeForRunawayWorkerSeconds)); |
| 215 } | 217 } |
| 216 | 218 |
| 217 } // namespace content | 219 } // namespace content |
| OLD | NEW |