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

Side by Side Diff: chrome/browser/media_galleries/fileapi/media_file_system_backend.cc

Issue 1550593002: Switch to standard integer types in chrome/browser/, part 2 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/browser/media_galleries/fileapi/media_file_system_backend.h" 5 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/sequenced_task_runner.h" 13 #include "base/sequenced_task_runner.h"
14 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 #include "base/thread_task_runner_handle.h" 17 #include "base/thread_task_runner_handle.h"
18 #include "base/threading/sequenced_worker_pool.h" 18 #include "base/threading/sequenced_worker_pool.h"
19 #include "build/build_config.h"
19 #include "chrome/browser/browser_process.h" 20 #include "chrome/browser/browser_process.h"
20 #include "chrome/browser/extensions/extension_service.h" 21 #include "chrome/browser/extensions/extension_service.h"
21 #include "chrome/browser/media_galleries/fileapi/device_media_async_file_util.h" 22 #include "chrome/browser/media_galleries/fileapi/device_media_async_file_util.h"
22 #include "chrome/browser/media_galleries/fileapi/media_file_validator_factory.h" 23 #include "chrome/browser/media_galleries/fileapi/media_file_validator_factory.h"
23 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" 24 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h"
24 #include "chrome/browser/media_galleries/fileapi/native_media_file_util.h" 25 #include "chrome/browser/media_galleries/fileapi/native_media_file_util.h"
25 #include "chrome/browser/media_galleries/media_file_system_registry.h" 26 #include "chrome/browser/media_galleries/media_file_system_registry.h"
26 #include "chrome/browser/media_galleries/media_galleries_histograms.h" 27 #include "chrome/browser/media_galleries/media_galleries_histograms.h"
27 #include "chrome/browser/profiles/profile.h" 28 #include "chrome/browser/profiles/profile.h"
28 #include "content/public/browser/browser_thread.h" 29 #include "content/public/browser/browser_thread.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 MediaGalleryPrefId pref_id, 66 MediaGalleryPrefId pref_id,
66 const base::Callback<void(base::File::Error result)>& callback) { 67 const base::Callback<void(base::File::Error result)>& callback) {
67 MediaFileSystemRegistry* registry = 68 MediaFileSystemRegistry* registry =
68 g_browser_process->media_file_system_registry(); 69 g_browser_process->media_file_system_registry();
69 registry->RegisterMediaFileSystemForExtension( 70 registry->RegisterMediaFileSystemForExtension(
70 content::WebContents::FromRenderViewHost(rvh), extension, pref_id, 71 content::WebContents::FromRenderViewHost(rvh), extension, pref_id,
71 callback); 72 callback);
72 } 73 }
73 74
74 void AttemptAutoMountOnUIThread( 75 void AttemptAutoMountOnUIThread(
75 int32 process_id, 76 int32_t process_id,
76 int32 routing_id, 77 int32_t routing_id,
77 const std::string& storage_domain, 78 const std::string& storage_domain,
78 const std::string& mount_point, 79 const std::string& mount_point,
79 const base::Callback<void(base::File::Error result)>& callback) { 80 const base::Callback<void(base::File::Error result)>& callback) {
80 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 81 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
81 82
82 content::RenderViewHost* rvh = 83 content::RenderViewHost* rvh =
83 content::RenderViewHost::FromID(process_id, routing_id); 84 content::RenderViewHost::FromID(process_id, routing_id);
84 if (rvh) { 85 if (rvh) {
85 Profile* profile = 86 Profile* profile =
86 Profile::FromBrowserContext(rvh->GetProcess()->GetBrowserContext()); 87 Profile::FromBrowserContext(rvh->GetProcess()->GetBrowserContext());
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 type == storage::kFileSystemTypeDeviceMedia || 346 type == storage::kFileSystemTypeDeviceMedia ||
346 type == storage::kFileSystemTypeItunes || 347 type == storage::kFileSystemTypeItunes ||
347 type == storage::kFileSystemTypePicasa || 348 type == storage::kFileSystemTypePicasa ||
348 type == storage::kFileSystemTypeIphoto); 349 type == storage::kFileSystemTypeIphoto);
349 return true; 350 return true;
350 } 351 }
351 352
352 scoped_ptr<storage::FileStreamReader> 353 scoped_ptr<storage::FileStreamReader>
353 MediaFileSystemBackend::CreateFileStreamReader( 354 MediaFileSystemBackend::CreateFileStreamReader(
354 const FileSystemURL& url, 355 const FileSystemURL& url,
355 int64 offset, 356 int64_t offset,
356 int64 max_bytes_to_read, 357 int64_t max_bytes_to_read,
357 const base::Time& expected_modification_time, 358 const base::Time& expected_modification_time,
358 FileSystemContext* context) const { 359 FileSystemContext* context) const {
359 if (url.type() == storage::kFileSystemTypeDeviceMedia) { 360 if (url.type() == storage::kFileSystemTypeDeviceMedia) {
360 DCHECK(device_media_async_file_util_); 361 DCHECK(device_media_async_file_util_);
361 scoped_ptr<storage::FileStreamReader> reader = 362 scoped_ptr<storage::FileStreamReader> reader =
362 device_media_async_file_util_->GetFileStreamReader( 363 device_media_async_file_util_->GetFileStreamReader(
363 url, offset, expected_modification_time, context); 364 url, offset, expected_modification_time, context);
364 DCHECK(reader); 365 DCHECK(reader);
365 return reader.Pass(); 366 return reader.Pass();
366 } 367 }
367 368
368 return scoped_ptr<storage::FileStreamReader>( 369 return scoped_ptr<storage::FileStreamReader>(
369 storage::FileStreamReader::CreateForLocalFile( 370 storage::FileStreamReader::CreateForLocalFile(
370 context->default_file_task_runner(), 371 context->default_file_task_runner(),
371 url.path(), 372 url.path(),
372 offset, 373 offset,
373 expected_modification_time)); 374 expected_modification_time));
374 } 375 }
375 376
376 scoped_ptr<storage::FileStreamWriter> 377 scoped_ptr<storage::FileStreamWriter>
377 MediaFileSystemBackend::CreateFileStreamWriter( 378 MediaFileSystemBackend::CreateFileStreamWriter(
378 const FileSystemURL& url, 379 const FileSystemURL& url,
379 int64 offset, 380 int64_t offset,
380 FileSystemContext* context) const { 381 FileSystemContext* context) const {
381 return scoped_ptr<storage::FileStreamWriter>( 382 return scoped_ptr<storage::FileStreamWriter>(
382 storage::FileStreamWriter::CreateForLocalFile( 383 storage::FileStreamWriter::CreateForLocalFile(
383 context->default_file_task_runner(), 384 context->default_file_task_runner(),
384 url.path(), 385 url.path(),
385 offset, 386 offset,
386 storage::FileStreamWriter::OPEN_EXISTING_FILE)); 387 storage::FileStreamWriter::OPEN_EXISTING_FILE));
387 } 388 }
388 389
389 storage::FileSystemQuotaUtil* MediaFileSystemBackend::GetQuotaUtil() { 390 storage::FileSystemQuotaUtil* MediaFileSystemBackend::GetQuotaUtil() {
390 // No quota support. 391 // No quota support.
391 return NULL; 392 return NULL;
392 } 393 }
393 394
394 const storage::UpdateObserverList* MediaFileSystemBackend::GetUpdateObservers( 395 const storage::UpdateObserverList* MediaFileSystemBackend::GetUpdateObservers(
395 storage::FileSystemType type) const { 396 storage::FileSystemType type) const {
396 return NULL; 397 return NULL;
397 } 398 }
398 399
399 const storage::ChangeObserverList* MediaFileSystemBackend::GetChangeObservers( 400 const storage::ChangeObserverList* MediaFileSystemBackend::GetChangeObservers(
400 storage::FileSystemType type) const { 401 storage::FileSystemType type) const {
401 return NULL; 402 return NULL;
402 } 403 }
403 404
404 const storage::AccessObserverList* MediaFileSystemBackend::GetAccessObservers( 405 const storage::AccessObserverList* MediaFileSystemBackend::GetAccessObservers(
405 storage::FileSystemType type) const { 406 storage::FileSystemType type) const {
406 return NULL; 407 return NULL;
407 } 408 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698