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

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

Issue 145303002: Convert Media Galleries to use base::File (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 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/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 base::FilePath::FromUTF16Unsafe(file_path), 472 base::FilePath::FromUTF16Unsafe(file_path),
473 &mime_type)); 473 &mime_type));
474 return base::ASCIIToUTF16(mime_type); 474 return base::ASCIIToUTF16(mime_type);
475 } 475 }
476 476
477 //------------------------------------------------------------------------------ 477 //------------------------------------------------------------------------------
478 478
479 bool RendererWebKitPlatformSupportImpl::FileUtilities::getFileInfo( 479 bool RendererWebKitPlatformSupportImpl::FileUtilities::getFileInfo(
480 const WebString& path, 480 const WebString& path,
481 WebFileInfo& web_file_info) { 481 WebFileInfo& web_file_info) {
482 base::PlatformFileInfo file_info; 482 base::File::Info file_info;
483 base::PlatformFileError status; 483 base::File::Error status;
484 if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileInfo( 484 if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileInfo(
485 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) || 485 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) ||
486 status != base::PLATFORM_FILE_OK) { 486 status != base::File::FILE_OK) {
487 return false; 487 return false;
488 } 488 }
489 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); 489 webkit_glue::FileInfoToWebFileInfo(file_info, &web_file_info);
490 web_file_info.platformPath = path; 490 web_file_info.platformPath = path;
491 return true; 491 return true;
492 } 492 }
493 493
494 bool RendererWebKitPlatformSupportImpl::FileUtilities:: 494 bool RendererWebKitPlatformSupportImpl::FileUtilities::
495 SendSyncMessageFromAnyThread(IPC::SyncMessage* msg) const { 495 SendSyncMessageFromAnyThread(IPC::SyncMessage* msg) const {
496 base::TimeTicks begin = base::TimeTicks::Now(); 496 base::TimeTicks begin = base::TimeTicks::Now();
497 const bool success = thread_safe_sender_->Send(msg); 497 const bool success = thread_safe_sender_->Send(msg);
498 base::TimeDelta delta = base::TimeTicks::Now() - begin; 498 base::TimeDelta delta = base::TimeTicks::Now() - begin;
499 UMA_HISTOGRAM_TIMES("RendererSyncIPC.ElapsedTime", delta); 499 UMA_HISTOGRAM_TIMES("RendererSyncIPC.ElapsedTime", delta);
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 return; 1074 return;
1075 QuotaDispatcher::ThreadSpecificInstance( 1075 QuotaDispatcher::ThreadSpecificInstance(
1076 thread_safe_sender_.get(), 1076 thread_safe_sender_.get(),
1077 quota_message_filter_.get())->QueryStorageUsageAndQuota( 1077 quota_message_filter_.get())->QueryStorageUsageAndQuota(
1078 storage_partition, 1078 storage_partition,
1079 static_cast<quota::StorageType>(type), 1079 static_cast<quota::StorageType>(type),
1080 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); 1080 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
1081 } 1081 }
1082 1082
1083 } // namespace content 1083 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_file_system_host.cc ('k') | content/worker/worker_webkitplatformsupport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698