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

Side by Side Diff: components/history/core/browser/history_backend.cc

Issue 1749073002: Do V8 GC ASAP if system memory is pressured (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 8 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 "components/history/core/browser/history_backend.h" 5 #include "components/history/core/browser/history_backend.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 const HistoryDatabaseParams& history_database_params) { 242 const HistoryDatabaseParams& history_database_params) {
243 // HistoryBackend is created on the UI thread by HistoryService, then the 243 // HistoryBackend is created on the UI thread by HistoryService, then the
244 // HistoryBackend::Init() method is called on the DB thread. Create the 244 // HistoryBackend::Init() method is called on the DB thread. Create the
245 // base::SupportsUserData on the DB thread since it is not thread-safe. 245 // base::SupportsUserData on the DB thread since it is not thread-safe.
246 supports_user_data_helper_.reset(new HistoryBackendHelper); 246 supports_user_data_helper_.reset(new HistoryBackendHelper);
247 247
248 if (!force_fail) 248 if (!force_fail)
249 InitImpl(history_database_params); 249 InitImpl(history_database_params);
250 delegate_->DBLoaded(); 250 delegate_->DBLoaded();
251 typed_url_syncable_service_.reset(new TypedUrlSyncableService(this)); 251 typed_url_syncable_service_.reset(new TypedUrlSyncableService(this));
252 memory_pressure_listener_.reset(new base::MemoryPressureListener( 252 memory_pressure_listener_.reset(base::MemoryPressureListener::Create(
253 base::Bind(&HistoryBackend::OnMemoryPressure, base::Unretained(this)))); 253 base::Bind(&HistoryBackend::OnMemoryPressure, base::Unretained(this))));
254 } 254 }
255 255
256 void HistoryBackend::SetOnBackendDestroyTask(base::MessageLoop* message_loop, 256 void HistoryBackend::SetOnBackendDestroyTask(base::MessageLoop* message_loop,
257 const base::Closure& task) { 257 const base::Closure& task) {
258 if (!backend_destroy_task_.is_null()) 258 if (!backend_destroy_task_.is_null())
259 DLOG(WARNING) << "Setting more than one destroy task, overriding"; 259 DLOG(WARNING) << "Setting more than one destroy task, overriding";
260 backend_destroy_message_loop_ = message_loop; 260 backend_destroy_message_loop_ = message_loop;
261 backend_destroy_task_ = task; 261 backend_destroy_task_ = task;
262 } 262 }
(...skipping 2359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2622 // transaction is currently open. 2622 // transaction is currently open.
2623 db_->CommitTransaction(); 2623 db_->CommitTransaction();
2624 db_->Vacuum(); 2624 db_->Vacuum();
2625 db_->BeginTransaction(); 2625 db_->BeginTransaction();
2626 db_->GetStartDate(&first_recorded_time_); 2626 db_->GetStartDate(&first_recorded_time_);
2627 2627
2628 return true; 2628 return true;
2629 } 2629 }
2630 2630
2631 } // namespace history 2631 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698