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_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 // CacheStorage. The browser may cache it and return it on subsequent | 429 // CacheStorage. The browser may cache it and return it on subsequent |
430 // responses to speed the processing of this resource. | 430 // responses to speed the processing of this resource. |
431 std::vector<char> copy(data, data + size); | 431 std::vector<char> copy(data, data + size); |
432 RenderThread::Get()->Send( | 432 RenderThread::Get()->Send( |
433 new RenderProcessHostMsg_DidGenerateCacheableMetadataInCacheStorage( | 433 new RenderProcessHostMsg_DidGenerateCacheableMetadataInCacheStorage( |
434 url, base::Time::FromInternalValue(response_time), copy, | 434 url, base::Time::FromInternalValue(response_time), copy, |
435 cacheStorageOrigin, cacheStorageCacheName.utf8())); | 435 cacheStorageOrigin, cacheStorageCacheName.utf8())); |
436 } | 436 } |
437 | 437 |
438 WebString RendererBlinkPlatformImpl::defaultLocale() { | 438 WebString RendererBlinkPlatformImpl::defaultLocale() { |
439 return base::ASCIIToUTF16(RenderThread::Get()->GetLocale()); | 439 return WebString::fromASCII(RenderThread::Get()->GetLocale()); |
440 } | 440 } |
441 | 441 |
442 void RendererBlinkPlatformImpl::suddenTerminationChanged(bool enabled) { | 442 void RendererBlinkPlatformImpl::suddenTerminationChanged(bool enabled) { |
443 if (enabled) { | 443 if (enabled) { |
444 // We should not get more enables than disables, but we want it to be a | 444 // We should not get more enables than disables, but we want it to be a |
445 // non-fatal error if it does happen. | 445 // non-fatal error if it does happen. |
446 DCHECK_GT(sudden_termination_disables_, 0); | 446 DCHECK_GT(sudden_termination_disables_, 0); |
447 sudden_termination_disables_ = std::max(sudden_termination_disables_ - 1, | 447 sudden_termination_disables_ = std::max(sudden_termination_disables_ - 1, |
448 0); | 448 0); |
449 if (sudden_termination_disables_ != 0) | 449 if (sudden_termination_disables_ != 0) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 // The sandbox restricts our access to the registry, so we need to proxy | 506 // The sandbox restricts our access to the registry, so we need to proxy |
507 // these calls over to the browser process. | 507 // these calls over to the browser process. |
508 if (!mime_registry_) | 508 if (!mime_registry_) |
509 RenderThread::Get()->GetRemoteInterfaces()->GetInterface(&mime_registry_); | 509 RenderThread::Get()->GetRemoteInterfaces()->GetInterface(&mime_registry_); |
510 | 510 |
511 mojo::String mime_type; | 511 mojo::String mime_type; |
512 if (!mime_registry_->GetMimeTypeFromExtension( | 512 if (!mime_registry_->GetMimeTypeFromExtension( |
513 mojo::String::From(base::string16(file_extension)), &mime_type)) { | 513 mojo::String::From(base::string16(file_extension)), &mime_type)) { |
514 return WebString(); | 514 return WebString(); |
515 } | 515 } |
516 return base::ASCIIToUTF16(mime_type.get()); | 516 return WebString::fromASCII(mime_type.get()); |
517 } | 517 } |
518 | 518 |
519 //------------------------------------------------------------------------------ | 519 //------------------------------------------------------------------------------ |
520 | 520 |
521 bool RendererBlinkPlatformImpl::FileUtilities::getFileInfo( | 521 bool RendererBlinkPlatformImpl::FileUtilities::getFileInfo( |
522 const WebString& path, | 522 const WebString& path, |
523 WebFileInfo& web_file_info) { | 523 WebFileInfo& web_file_info) { |
524 base::File::Info file_info; | 524 base::File::Info file_info; |
525 base::File::Error status = base::File::FILE_ERROR_MAX; | 525 base::File::Error status = base::File::FILE_ERROR_MAX; |
526 if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileInfo( | 526 if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileInfo( |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 return &trial_token_validator_; | 1326 return &trial_token_validator_; |
1327 } | 1327 } |
1328 | 1328 |
1329 void RendererBlinkPlatformImpl::workerContextCreated( | 1329 void RendererBlinkPlatformImpl::workerContextCreated( |
1330 const v8::Local<v8::Context>& worker) { | 1330 const v8::Local<v8::Context>& worker) { |
1331 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( | 1331 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( |
1332 worker); | 1332 worker); |
1333 } | 1333 } |
1334 | 1334 |
1335 } // namespace content | 1335 } // namespace content |
OLD | NEW |