OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/renderer_webkitclient_impl.h" | 5 #include "chrome/renderer/renderer_webkitclient_impl.h" |
6 | 6 |
7 #if defined(USE_SYSTEM_SQLITE) | 7 #if defined(USE_SYSTEM_SQLITE) |
8 #include <sqlite3.h> | 8 #include <sqlite3.h> |
9 #else | 9 #else |
10 #include "third_party/sqlite/preprocessed/sqlite3.h" | 10 #include "third_party/sqlite/preprocessed/sqlite3.h" |
11 #endif | 11 #endif |
12 | 12 |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
15 #include "base/platform_file.h" | 15 #include "base/platform_file.h" |
16 #include "chrome/common/appcache/appcache_dispatcher.h" | 16 #include "chrome/common/appcache/appcache_dispatcher.h" |
17 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
18 #include "chrome/common/db_message_filter.h" | 18 #include "chrome/common/db_message_filter.h" |
19 #include "chrome/common/render_messages.h" | 19 #include "chrome/common/render_messages.h" |
20 #include "chrome/common/webmessageportchannel_impl.h" | 20 #include "chrome/common/webmessageportchannel_impl.h" |
21 #include "chrome/plugin/npobject_util.h" | 21 #include "chrome/plugin/npobject_util.h" |
22 #include "chrome/renderer/net/render_dns_master.h" | 22 #include "chrome/renderer/net/render_dns_master.h" |
23 #include "chrome/renderer/render_thread.h" | 23 #include "chrome/renderer/render_thread.h" |
24 #include "chrome/renderer/renderer_webstoragenamespace_impl.h" | 24 #include "chrome/renderer/renderer_webstoragenamespace_impl.h" |
25 #include "chrome/renderer/visitedlink_slave.h" | 25 #include "chrome/renderer/visitedlink_slave.h" |
| 26 #include "googleurl/src/gurl.h" |
26 #include "webkit/api/public/WebString.h" | 27 #include "webkit/api/public/WebString.h" |
27 #include "webkit/api/public/WebURL.h" | 28 #include "webkit/api/public/WebURL.h" |
28 #include "webkit/appcache/web_application_cache_host_impl.h" | 29 #include "webkit/appcache/web_application_cache_host_impl.h" |
29 #include "webkit/glue/glue_util.h" | 30 #include "webkit/glue/glue_util.h" |
30 #include "webkit/glue/webkit_glue.h" | 31 #include "webkit/glue/webkit_glue.h" |
31 | 32 |
32 #if defined(OS_LINUX) | 33 #if defined(OS_LINUX) |
33 #include "chrome/renderer/renderer_sandbox_support_linux.h" | 34 #include "chrome/renderer/renderer_sandbox_support_linux.h" |
34 #endif | 35 #endif |
35 | 36 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return WebStorageNamespace::createSessionStorageNamespace(); | 164 return WebStorageNamespace::createSessionStorageNamespace(); |
164 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION); | 165 return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION); |
165 } | 166 } |
166 | 167 |
167 WebApplicationCacheHost* RendererWebKitClientImpl::createApplicationCacheHost( | 168 WebApplicationCacheHost* RendererWebKitClientImpl::createApplicationCacheHost( |
168 WebApplicationCacheHostClient* client) { | 169 WebApplicationCacheHostClient* client) { |
169 return new appcache::WebApplicationCacheHostImpl(client, | 170 return new appcache::WebApplicationCacheHostImpl(client, |
170 RenderThread::current()->appcache_dispatcher()->backend_proxy()); | 171 RenderThread::current()->appcache_dispatcher()->backend_proxy()); |
171 } | 172 } |
172 | 173 |
| 174 WebKit::WebString RendererWebKitClientImpl::genKeyAndSignChallenge( |
| 175 unsigned keySizeIndex, |
| 176 const WebKit::WebString& challenge, |
| 177 const WebKit::WebURL& url) { |
| 178 std::string signedPublicKey; |
| 179 RenderThread::current()->Send(new ViewHostMsg_Keygen( |
| 180 static_cast<uint32>(keySizeIndex), |
| 181 webkit_glue::WebStringToStdString(challenge), |
| 182 GURL(url) , |
| 183 &signedPublicKey)); |
| 184 return webkit_glue::StdStringToWebString(signedPublicKey); |
| 185 } |
| 186 |
173 //------------------------------------------------------------------------------ | 187 //------------------------------------------------------------------------------ |
174 | 188 |
175 WebString RendererWebKitClientImpl::MimeRegistry::mimeTypeForExtension( | 189 WebString RendererWebKitClientImpl::MimeRegistry::mimeTypeForExtension( |
176 const WebString& file_extension) { | 190 const WebString& file_extension) { |
177 if (IsPluginProcess()) | 191 if (IsPluginProcess()) |
178 return SimpleWebMimeRegistryImpl::mimeTypeForExtension(file_extension); | 192 return SimpleWebMimeRegistryImpl::mimeTypeForExtension(file_extension); |
179 | 193 |
180 // The sandbox restricts our access to the registry, so we need to proxy | 194 // The sandbox restricts our access to the registry, so we need to proxy |
181 // these calls over to the browser process. | 195 // these calls over to the browser process. |
182 std::string mime_type; | 196 std::string mime_type; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 long long RendererWebKitClientImpl::databaseGetFileSize( | 321 long long RendererWebKitClientImpl::databaseGetFileSize( |
308 const WebString& file_name) { | 322 const WebString& file_name) { |
309 DBMessageFilter* db_message_filter = DBMessageFilter::GetInstance(); | 323 DBMessageFilter* db_message_filter = DBMessageFilter::GetInstance(); |
310 int message_id = db_message_filter->GetUniqueID(); | 324 int message_id = db_message_filter->GetUniqueID(); |
311 return db_message_filter->SendAndWait( | 325 return db_message_filter->SendAndWait( |
312 new ViewHostMsg_DatabaseGetFileSize( | 326 new ViewHostMsg_DatabaseGetFileSize( |
313 FilePath(webkit_glue::WebStringToFilePathString(file_name)), | 327 FilePath(webkit_glue::WebStringToFilePathString(file_name)), |
314 message_id), | 328 message_id), |
315 message_id, 0LL); | 329 message_id, 0LL); |
316 } | 330 } |
OLD | NEW |