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

Side by Side Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 9875026: **NOTFORLANDING** New link rel=prerender API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wdyt? Created 8 years, 8 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
OLDNEW
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/renderer/renderer_webkitplatformsupport_impl.h" 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/platform_file.h" 10 #include "base/platform_file.h"
11 #include "base/shared_memory.h" 11 #include "base/shared_memory.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "content/common/database_util.h" 13 #include "content/common/database_util.h"
14 #include "content/common/fileapi/webblobregistry_impl.h" 14 #include "content/common/fileapi/webblobregistry_impl.h"
15 #include "content/common/fileapi/webfilesystem_impl.h" 15 #include "content/common/fileapi/webfilesystem_impl.h"
16 #include "content/common/file_utilities_messages.h" 16 #include "content/common/file_utilities_messages.h"
17 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" 17 #include "content/common/indexed_db/proxy_webidbfactory_impl.h"
18 #include "content/common/mime_registry_messages.h" 18 #include "content/common/mime_registry_messages.h"
19 #include "content/common/npobject_util.h" 19 #include "content/common/npobject_util.h"
20 #include "content/common/view_messages.h" 20 #include "content/common/view_messages.h"
21 #include "content/common/webmessageportchannel_impl.h" 21 #include "content/common/webmessageportchannel_impl.h"
22 #include "content/public/common/content_switches.h" 22 #include "content/public/common/content_switches.h"
23 #include "content/public/common/gpu_info.h" 23 #include "content/public/common/gpu_info.h"
24 #include "content/public/common/referrer.h"
24 #include "content/public/renderer/content_renderer_client.h" 25 #include "content/public/renderer/content_renderer_client.h"
25 #include "content/renderer/gamepad_shared_memory_reader.h" 26 #include "content/renderer/gamepad_shared_memory_reader.h"
26 #include "content/renderer/media/audio_device.h" 27 #include "content/renderer/media/audio_device.h"
27 #include "content/renderer/media/audio_hardware.h" 28 #include "content/renderer/media/audio_hardware.h"
28 #include "content/renderer/media/renderer_webaudiodevice_impl.h" 29 #include "content/renderer/media/renderer_webaudiodevice_impl.h"
29 #include "content/renderer/render_thread_impl.h" 30 #include "content/renderer/render_thread_impl.h"
30 #include "content/renderer/render_view_impl.h" 31 #include "content/renderer/render_view_impl.h"
31 #include "content/renderer/renderer_clipboard_client.h" 32 #include "content/renderer/renderer_clipboard_client.h"
32 #include "content/renderer/renderer_webstoragenamespace_impl.h" 33 #include "content/renderer/renderer_webstoragenamespace_impl.h"
33 #include "content/renderer/websharedworkerrepository_impl.h" 34 #include "content/renderer/websharedworkerrepository_impl.h"
34 #include "googleurl/src/gurl.h" 35 #include "googleurl/src/gurl.h"
35 #include "ipc/ipc_sync_message_filter.h" 36 #include "ipc/ipc_sync_message_filter.h"
36 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis try.h" 37 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis try.h"
37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads. h" 39 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads. h"
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h"
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h"
42 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre amCenter.h" 43 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre amCenter.h"
43 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre amCenterClient.h" 44 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre amCenterClient.h"
44 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne ctionHandler.h" 45 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne ctionHandler.h"
45 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne ctionHandlerClient.h" 46 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne ctionHandlerClient.h"
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" 47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
47 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize dScriptValue.h" 48 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize dScriptValue.h"
48 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat cher.h" 49 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat cher.h"
50 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebReferrerP olicy.h"
49 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 51 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
50 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" 52 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
51 #include "webkit/glue/simple_webmimeregistry_impl.h" 53 #include "webkit/glue/simple_webmimeregistry_impl.h"
52 #include "webkit/glue/webclipboard_impl.h" 54 #include "webkit/glue/webclipboard_impl.h"
53 #include "webkit/glue/webfileutilities_impl.h" 55 #include "webkit/glue/webfileutilities_impl.h"
54 #include "webkit/glue/webkit_glue.h" 56 #include "webkit/glue/webkit_glue.h"
55 57
56 #if defined(OS_WIN) 58 #if defined(OS_WIN)
57 #include "content/common/child_process_messages.h" 59 #include "content/common/child_process_messages.h"
58 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/win/WebSandb oxSupport.h" 60 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/win/WebSandb oxSupport.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 const WebString& hostname) { 251 const WebString& hostname) {
250 if (hostname.isEmpty()) 252 if (hostname.isEmpty())
251 return; 253 return;
252 254
253 std::string hostname_utf8; 255 std::string hostname_utf8;
254 UTF16ToUTF8(hostname.data(), hostname.length(), &hostname_utf8); 256 UTF16ToUTF8(hostname.data(), hostname.length(), &hostname_utf8);
255 content::GetContentClient()->renderer()->PrefetchHostName( 257 content::GetContentClient()->renderer()->PrefetchHostName(
256 hostname_utf8.data(), hostname_utf8.length()); 258 hostname_utf8.data(), hostname_utf8.length());
257 } 259 }
258 260
261 void RendererWebKitPlatformSupportImpl::newLinkPrerender(
262 int prerender_id,
263 WebKit::WebView* webView,
264 const WebKit::WebURL& url,
265 const WebKit::WebString& referrer,
266 WebKit::WebReferrerPolicy policy,
267 const WebKit::WebSize& size) {
268 RenderViewImpl* render_view = RenderViewImpl::FromWebView(webView);
269 const int render_view_route_id = render_view->GetRoutingID();
270 content::Referrer content_referrer(GURL(referrer), policy);
271 content::GetContentClient()->renderer()->NewLinkPrerender(
272 prerender_id, render_view_route_id, GURL(url), content_referrer, size);
273 }
274
275 void RendererWebKitPlatformSupportImpl::removedLinkPrerender(int prerender_id) {
276 content::GetContentClient()->renderer()->RemovedLinkPrerender(prerender_id);
277 }
278
279 void RendererWebKitPlatformSupportImpl::unloadedLinkPrerender(
280 int prerender_id) {
281 content::GetContentClient()->renderer()->UnloadedLinkPrerender(prerender_id);
282 }
283
259 bool 284 bool
260 RendererWebKitPlatformSupportImpl::CheckPreparsedJsCachingEnabled() const { 285 RendererWebKitPlatformSupportImpl::CheckPreparsedJsCachingEnabled() const {
261 static bool checked = false; 286 static bool checked = false;
262 static bool result = false; 287 static bool result = false;
263 if (!checked) { 288 if (!checked) {
264 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 289 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
265 result = command_line.HasSwitch(switches::kEnablePreparsedJsCaching); 290 result = command_line.HasSwitch(switches::kEnablePreparsedJsCaching);
266 checked = true; 291 checked = true;
267 } 292 }
268 return result; 293 return result;
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 DCHECK(render_thread); 715 DCHECK(render_thread);
691 if (!render_thread) 716 if (!render_thread)
692 return NULL; 717 return NULL;
693 return render_thread->CreateMediaStreamCenter(client); 718 return render_thread->CreateMediaStreamCenter(client);
694 } 719 }
695 720
696 GpuChannelHostFactory* 721 GpuChannelHostFactory*
697 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { 722 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() {
698 return RenderThreadImpl::current(); 723 return RenderThreadImpl::current();
699 } 724 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698