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

Side by Side Diff: storage/browser/database/database_tracker.cc

Issue 1120553002: [storage] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Review Nits Created 5 years, 7 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) 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 "storage/browser/database/database_tracker.h" 5 #include "storage/browser/database/database_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/files/file.h" 12 #include "base/files/file.h"
13 #include "base/files/file_enumerator.h" 13 #include "base/files/file_enumerator.h"
14 #include "base/files/file_util.h" 14 #include "base/files/file_util.h"
15 #include "base/message_loop/message_loop_proxy.h"
16 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
18 #include "net/base/net_errors.h" 17 #include "net/base/net_errors.h"
19 #include "sql/connection.h" 18 #include "sql/connection.h"
20 #include "sql/meta_table.h" 19 #include "sql/meta_table.h"
21 #include "sql/transaction.h" 20 #include "sql/transaction.h"
22 #include "storage/browser/database/database_quota_client.h" 21 #include "storage/browser/database/database_quota_client.h"
23 #include "storage/browser/database/database_util.h" 22 #include "storage/browser/database/database_util.h"
24 #include "storage/browser/database/databases_table.h" 23 #include "storage/browser/database/databases_table.h"
25 #include "storage/browser/quota/quota_manager_proxy.h" 24 #include "storage/browser/quota/quota_manager_proxy.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 76 }
78 77
79 OriginInfo::OriginInfo(const std::string& origin_identifier, int64 total_size) 78 OriginInfo::OriginInfo(const std::string& origin_identifier, int64 total_size)
80 : origin_identifier_(origin_identifier), total_size_(total_size) {} 79 : origin_identifier_(origin_identifier), total_size_(total_size) {}
81 80
82 DatabaseTracker::DatabaseTracker( 81 DatabaseTracker::DatabaseTracker(
83 const base::FilePath& profile_path, 82 const base::FilePath& profile_path,
84 bool is_incognito, 83 bool is_incognito,
85 storage::SpecialStoragePolicy* special_storage_policy, 84 storage::SpecialStoragePolicy* special_storage_policy,
86 storage::QuotaManagerProxy* quota_manager_proxy, 85 storage::QuotaManagerProxy* quota_manager_proxy,
87 base::MessageLoopProxy* db_tracker_thread) 86 base::SingleThreadTaskRunner* db_tracker_thread)
88 : is_initialized_(false), 87 : is_initialized_(false),
89 is_incognito_(is_incognito), 88 is_incognito_(is_incognito),
90 force_keep_session_state_(false), 89 force_keep_session_state_(false),
91 shutting_down_(false), 90 shutting_down_(false),
92 profile_path_(profile_path), 91 profile_path_(profile_path),
93 db_dir_(is_incognito_ 92 db_dir_(is_incognito_
94 ? profile_path_.Append(kIncognitoDatabaseDirectoryName) 93 ? profile_path_.Append(kIncognitoDatabaseDirectoryName)
95 : profile_path_.Append(kDatabaseDirectoryName)), 94 : profile_path_.Append(kDatabaseDirectoryName)),
96 db_(new sql::Connection()), 95 db_(new sql::Connection()),
97 special_storage_policy_(special_storage_policy), 96 special_storage_policy_(special_storage_policy),
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 if (!db_tracker_thread_->BelongsToCurrentThread()) { 859 if (!db_tracker_thread_->BelongsToCurrentThread()) {
861 db_tracker_thread_->PostTask( 860 db_tracker_thread_->PostTask(
862 FROM_HERE, 861 FROM_HERE,
863 base::Bind(&DatabaseTracker::SetForceKeepSessionState, this)); 862 base::Bind(&DatabaseTracker::SetForceKeepSessionState, this));
864 return; 863 return;
865 } 864 }
866 force_keep_session_state_ = true; 865 force_keep_session_state_ = true;
867 } 866 }
868 867
869 } // namespace storage 868 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/database/database_tracker.h ('k') | storage/browser/fileapi/async_file_util_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698