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

Side by Side Diff: content/browser/fileapi/browser_file_system_helper.cc

Issue 10829147: Make MediaFileUtil run on thread pool. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix for windows Created 8 years, 4 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
« no previous file with comments | « no previous file | webkit/fileapi/file_system_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/fileapi/browser_file_system_helper.h" 5 #include "content/browser/fileapi/browser_file_system_helper.h"
6 6
7 #include <vector> 7 #include <vector>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "base/threading/sequenced_worker_pool.h"
12 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
13 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
14 #include "webkit/fileapi/file_system_options.h" 15 #include "webkit/fileapi/file_system_options.h"
16 #include "webkit/fileapi/file_system_task_runners.h"
15 #include "webkit/quota/quota_manager.h" 17 #include "webkit/quota/quota_manager.h"
16 18
17 using content::BrowserThread; 19 using content::BrowserThread;
18 20
19 namespace { 21 namespace {
20 22
21 const char kChromeScheme[] = "chrome"; 23 const char kChromeScheme[] = "chrome";
22 const char kExtensionScheme[] = "chrome-extension"; 24 const char kExtensionScheme[] = "chrome-extension";
23 25
24 using fileapi::FileSystemOptions; 26 using fileapi::FileSystemOptions;
(...skipping 11 matching lines...) Expand all
36 : FileSystemOptions::PROFILE_MODE_NORMAL; 38 : FileSystemOptions::PROFILE_MODE_NORMAL;
37 return FileSystemOptions(profile_mode, additional_allowed_schemes); 39 return FileSystemOptions(profile_mode, additional_allowed_schemes);
38 } 40 }
39 41
40 } // anonymous namespace 42 } // anonymous namespace
41 43
42 scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext( 44 scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext(
43 const FilePath& profile_path, bool is_incognito, 45 const FilePath& profile_path, bool is_incognito,
44 quota::SpecialStoragePolicy* special_storage_policy, 46 quota::SpecialStoragePolicy* special_storage_policy,
45 quota::QuotaManagerProxy* quota_manager_proxy) { 47 quota::QuotaManagerProxy* quota_manager_proxy) {
48 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool();
49 base::SequencedWorkerPool::SequenceToken media_sequence_token =
50 pool->GetSequenceToken();
51
52 scoped_ptr<fileapi::FileSystemTaskRunners> task_runners(
53 new fileapi::FileSystemTaskRunners(
54 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
55 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
56 pool->GetSequencedTaskRunner(media_sequence_token)));
57
46 return new fileapi::FileSystemContext( 58 return new fileapi::FileSystemContext(
47 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), 59 task_runners.Pass(),
48 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
49 special_storage_policy, 60 special_storage_policy,
50 quota_manager_proxy, 61 quota_manager_proxy,
51 profile_path, 62 profile_path,
52 CreateBrowserFileSystemOptions(is_incognito)); 63 CreateBrowserFileSystemOptions(is_incognito));
53 } 64 }
OLDNEW
« no previous file with comments | « no previous file | webkit/fileapi/file_system_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698