OLD | NEW |
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_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 const WebString& hostname) { | 288 const WebString& hostname) { |
289 if (hostname.isEmpty()) | 289 if (hostname.isEmpty()) |
290 return; | 290 return; |
291 | 291 |
292 std::string hostname_utf8; | 292 std::string hostname_utf8; |
293 UTF16ToUTF8(hostname.data(), hostname.length(), &hostname_utf8); | 293 UTF16ToUTF8(hostname.data(), hostname.length(), &hostname_utf8); |
294 GetContentClient()->renderer()->PrefetchHostName( | 294 GetContentClient()->renderer()->PrefetchHostName( |
295 hostname_utf8.data(), hostname_utf8.length()); | 295 hostname_utf8.data(), hostname_utf8.length()); |
296 } | 296 } |
297 | 297 |
| 298 void RendererWebKitPlatformSupportImpl::preconnect( |
| 299 const WebKit::WebURL& url, |
| 300 WebKit::WebPreconnectMotivation motivation, |
| 301 uint32_t motivationVariationId) { |
| 302 GetContentClient()->renderer()->Preconnect( |
| 303 GURL(url), motivation, motivationVariationId); |
| 304 } |
| 305 |
298 bool | 306 bool |
299 RendererWebKitPlatformSupportImpl::CheckPreparsedJsCachingEnabled() const { | 307 RendererWebKitPlatformSupportImpl::CheckPreparsedJsCachingEnabled() const { |
300 static bool checked = false; | 308 static bool checked = false; |
301 static bool result = false; | 309 static bool result = false; |
302 if (!checked) { | 310 if (!checked) { |
303 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 311 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
304 result = command_line.HasSwitch(switches::kEnablePreparsedJsCaching); | 312 result = command_line.HasSwitch(switches::kEnablePreparsedJsCaching); |
305 checked = true; | 313 checked = true; |
306 } | 314 } |
307 return result; | 315 return result; |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 //------------------------------------------------------------------------------ | 898 //------------------------------------------------------------------------------ |
891 | 899 |
892 GrContext* RendererWebKitPlatformSupportImpl::sharedOffscreenGrContext() { | 900 GrContext* RendererWebKitPlatformSupportImpl::sharedOffscreenGrContext() { |
893 if (!shared_offscreen_context_) | 901 if (!shared_offscreen_context_) |
894 return NULL; | 902 return NULL; |
895 return shared_offscreen_context_->GrContext(); | 903 return shared_offscreen_context_->GrContext(); |
896 } | 904 } |
897 | 905 |
898 | 906 |
899 } // namespace content | 907 } // namespace content |
OLD | NEW |