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/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/file_system/file_system_dispatcher.h" | 10 #include "content/common/file_system/file_system_dispatcher.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 146 } |
147 | 147 |
148 // TODO(abarth): Security checks should use WebDocument or WebSecurityOrigin, | 148 // TODO(abarth): Security checks should use WebDocument or WebSecurityOrigin, |
149 // not WebFrame as the context object because WebFrames can contain different | 149 // not WebFrame as the context object because WebFrames can contain different |
150 // WebDocuments at different times. | 150 // WebDocuments at different times. |
151 bool WebWorkerClientProxy::allowDatabase(WebFrame* frame, | 151 bool WebWorkerClientProxy::allowDatabase(WebFrame* frame, |
152 const WebString& name, | 152 const WebString& name, |
153 const WebString& display_name, | 153 const WebString& display_name, |
154 unsigned long estimated_size) { | 154 unsigned long estimated_size) { |
155 WebSecurityOrigin origin = frame->document().securityOrigin(); | 155 WebSecurityOrigin origin = frame->document().securityOrigin(); |
156 if (origin.isEmpty()) | 156 if (origin.isUnique()) |
157 return false; | 157 return false; |
158 | 158 |
159 bool result = false; | 159 bool result = false; |
160 Send(new WorkerProcessHostMsg_AllowDatabase( | 160 Send(new WorkerProcessHostMsg_AllowDatabase( |
161 route_id_, GURL(origin.toString().utf8()), name, display_name, | 161 route_id_, GURL(origin.toString().utf8()), name, display_name, |
162 estimated_size, &result)); | 162 estimated_size, &result)); |
163 return result; | 163 return result; |
164 } | 164 } |
165 | 165 |
166 bool WebWorkerClientProxy::allowFileSystem() { | 166 bool WebWorkerClientProxy::allowFileSystem() { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 // This shuts down the process cleanly from the perspective of the browser | 208 // This shuts down the process cleanly from the perspective of the browser |
209 // process, and avoids the crashed worker infobar from appearing to the new | 209 // process, and avoids the crashed worker infobar from appearing to the new |
210 // 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 |
211 // 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. |
212 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 212 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
213 base::Bind( | 213 base::Bind( |
214 &WebWorkerClientProxy::workerContextDestroyed, | 214 &WebWorkerClientProxy::workerContextDestroyed, |
215 weak_factory_.GetWeakPtr()), | 215 weak_factory_.GetWeakPtr()), |
216 kMaxTimeForRunawayWorkerMs); | 216 kMaxTimeForRunawayWorkerMs); |
217 } | 217 } |
OLD | NEW |