OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "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" | |
17 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
18 #include "chrome/common/database_util.h" | 17 #include "chrome/common/database_util.h" |
19 #include "chrome/common/render_messages.h" | 18 #include "chrome/common/render_messages.h" |
20 #include "chrome/common/webmessageportchannel_impl.h" | 19 #include "chrome/common/webmessageportchannel_impl.h" |
21 #include "chrome/plugin/npobject_util.h" | 20 #include "chrome/plugin/npobject_util.h" |
22 #include "chrome/renderer/net/render_dns_master.h" | 21 #include "chrome/renderer/net/render_dns_master.h" |
23 #include "chrome/renderer/render_thread.h" | 22 #include "chrome/renderer/render_thread.h" |
24 #include "chrome/renderer/render_view.h" | 23 #include "chrome/renderer/render_view.h" |
25 #include "chrome/renderer/renderer_webstoragenamespace_impl.h" | 24 #include "chrome/renderer/renderer_webstoragenamespace_impl.h" |
26 #include "chrome/renderer/visitedlink_slave.h" | 25 #include "chrome/renderer/visitedlink_slave.h" |
27 #include "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h" | 26 #include "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h" |
28 #include "googleurl/src/gurl.h" | 27 #include "googleurl/src/gurl.h" |
29 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 28 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
30 #include "third_party/WebKit/WebKit/chromium/public/WebGraphicsContext3D.h" | 29 #include "third_party/WebKit/WebKit/chromium/public/WebGraphicsContext3D.h" |
31 #include "third_party/WebKit/WebKit/chromium/public/WebStorageEventDispatcher.h" | 30 #include "third_party/WebKit/WebKit/chromium/public/WebStorageEventDispatcher.h" |
32 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 31 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
33 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 32 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
34 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" | 33 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" |
35 #include "webkit/appcache/web_application_cache_host_impl.h" | |
36 #include "webkit/glue/webkit_glue.h" | 34 #include "webkit/glue/webkit_glue.h" |
37 | 35 |
38 #if defined(OS_LINUX) | 36 #if defined(OS_LINUX) |
39 #include "chrome/renderer/renderer_sandbox_support_linux.h" | 37 #include "chrome/renderer/renderer_sandbox_support_linux.h" |
40 #endif | 38 #endif |
41 | 39 |
42 #if defined(OS_POSIX) | 40 #if defined(OS_POSIX) |
43 #include "base/file_descriptor_posix.h" | 41 #include "base/file_descriptor_posix.h" |
44 #endif | 42 #endif |
45 | 43 |
46 using WebKit::WebApplicationCacheHost; | |
47 using WebKit::WebApplicationCacheHostClient; | |
48 using WebKit::WebFrame; | 44 using WebKit::WebFrame; |
49 using WebKit::WebKitClient; | 45 using WebKit::WebKitClient; |
50 using WebKit::WebStorageArea; | 46 using WebKit::WebStorageArea; |
51 using WebKit::WebStorageEventDispatcher; | 47 using WebKit::WebStorageEventDispatcher; |
52 using WebKit::WebStorageNamespace; | 48 using WebKit::WebStorageNamespace; |
53 using WebKit::WebString; | 49 using WebKit::WebString; |
54 using WebKit::WebURL; | 50 using WebKit::WebURL; |
55 using WebKit::WebVector; | 51 using WebKit::WebVector; |
56 | 52 |
57 //------------------------------------------------------------------------------ | 53 //------------------------------------------------------------------------------ |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 const WebString& new_value, const WebString& origin, | 171 const WebString& new_value, const WebString& origin, |
176 const WebKit::WebURL& url, bool is_local_storage) { | 172 const WebKit::WebURL& url, bool is_local_storage) { |
177 DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)); | 173 DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)); |
178 // Inefficient, but only used in single process mode. | 174 // Inefficient, but only used in single process mode. |
179 scoped_ptr<WebStorageEventDispatcher> event_dispatcher( | 175 scoped_ptr<WebStorageEventDispatcher> event_dispatcher( |
180 WebStorageEventDispatcher::create()); | 176 WebStorageEventDispatcher::create()); |
181 event_dispatcher->dispatchStorageEvent(key, old_value, new_value, origin, | 177 event_dispatcher->dispatchStorageEvent(key, old_value, new_value, origin, |
182 url, is_local_storage); | 178 url, is_local_storage); |
183 } | 179 } |
184 | 180 |
185 WebApplicationCacheHost* RendererWebKitClientImpl::createApplicationCacheHost( | |
186 WebApplicationCacheHostClient* client) { | |
187 return new appcache::WebApplicationCacheHostImpl(client, | |
188 RenderThread::current()->appcache_dispatcher()->backend_proxy()); | |
189 } | |
190 | |
191 //------------------------------------------------------------------------------ | 181 //------------------------------------------------------------------------------ |
192 | 182 |
193 WebString RendererWebKitClientImpl::MimeRegistry::mimeTypeForExtension( | 183 WebString RendererWebKitClientImpl::MimeRegistry::mimeTypeForExtension( |
194 const WebString& file_extension) { | 184 const WebString& file_extension) { |
195 if (IsPluginProcess()) | 185 if (IsPluginProcess()) |
196 return SimpleWebMimeRegistryImpl::mimeTypeForExtension(file_extension); | 186 return SimpleWebMimeRegistryImpl::mimeTypeForExtension(file_extension); |
197 | 187 |
198 // The sandbox restricts our access to the registry, so we need to proxy | 188 // The sandbox restricts our access to the registry, so we need to proxy |
199 // these calls over to the browser process. | 189 // these calls over to the browser process. |
200 std::string mime_type; | 190 std::string mime_type; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 const WebKit::WebString& challenge, | 317 const WebKit::WebString& challenge, |
328 const WebKit::WebURL& url) { | 318 const WebKit::WebURL& url) { |
329 std::string signed_public_key; | 319 std::string signed_public_key; |
330 RenderThread::current()->Send(new ViewHostMsg_Keygen( | 320 RenderThread::current()->Send(new ViewHostMsg_Keygen( |
331 static_cast<uint32>(key_size_index), | 321 static_cast<uint32>(key_size_index), |
332 challenge.utf8(), | 322 challenge.utf8(), |
333 GURL(url), | 323 GURL(url), |
334 &signed_public_key)); | 324 &signed_public_key)); |
335 return WebString::fromUTF8(signed_public_key); | 325 return WebString::fromUTF8(signed_public_key); |
336 } | 326 } |
OLD | NEW |