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

Side by Side Diff: content/worker/webworkerclient_proxy.cc

Issue 7012007: Chrome side of having the WebKit FileSystem API use WebPermissionClient for checking if using fil... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « content/worker/webworkerclient_proxy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(WebFrame* frame) {
160 WebSecurityOrigin origin = frame->securityOrigin();
michaeln 2011/05/12 02:57:19 frame not needed, see see stub_->url().GetOrigin()
jam 2011/05/12 16:40:34 Done.
161 if (origin.isEmpty())
162 return false;
163
164 bool result = false;
165 Send(new WorkerProcessHostMsg_AllowFileSystem(
166 route_id_, GURL(origin.toString().utf8()), &result));
167 return result;
168 }
169
161 void WebWorkerClientProxy::openFileSystem( 170 void WebWorkerClientProxy::openFileSystem(
162 WebKit::WebFileSystem::Type type, 171 WebKit::WebFileSystem::Type type,
163 long long size, 172 long long size,
164 bool create, 173 bool create,
165 WebKit::WebFileSystemCallbacks* callbacks) { 174 WebKit::WebFileSystemCallbacks* callbacks) {
166 ChildThread::current()->file_system_dispatcher()->OpenFileSystem( 175 ChildThread::current()->file_system_dispatcher()->OpenFileSystem(
167 stub_->url().GetOrigin(), static_cast<fileapi::FileSystemType>(type), 176 stub_->url().GetOrigin(), static_cast<fileapi::FileSystemType>(type),
168 size, create, new WebFileSystemCallbackDispatcher(callbacks)); 177 size, create, new WebFileSystemCallbackDispatcher(callbacks));
169 } 178 }
170 179
(...skipping 13 matching lines...) Expand all
184 193
185 // This shuts down the process cleanly from the perspective of the browser 194 // 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 195 // 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 196 // 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. 197 // will exit the message loop and subsequent ones won't be executed.
189 MessageLoop::current()->PostDelayedTask(FROM_HERE, 198 MessageLoop::current()->PostDelayedTask(FROM_HERE,
190 kill_process_factory_.NewRunnableMethod( 199 kill_process_factory_.NewRunnableMethod(
191 &WebWorkerClientProxy::workerContextDestroyed), 200 &WebWorkerClientProxy::workerContextDestroyed),
192 kMaxTimeForRunawayWorkerMs); 201 kMaxTimeForRunawayWorkerMs);
193 } 202 }
OLDNEW
« no previous file with comments | « content/worker/webworkerclient_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698