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

Side by Side Diff: webkit/appcache/appcache_service.cc

Issue 7863009: Replace ancient crufty AppCacheThread with much improved MessageLoopProxy usage. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 | « webkit/appcache/appcache_service.h ('k') | webkit/appcache/appcache_storage_impl.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/appcache/appcache_service.h" 5 #include "webkit/appcache/appcache_service.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 STLDeleteElements(&pending_helpers_); 427 STLDeleteElements(&pending_helpers_);
428 if (quota_client_) 428 if (quota_client_)
429 quota_client_->NotifyAppCacheDestroyed(); 429 quota_client_->NotifyAppCacheDestroyed();
430 430
431 // Destroy storage_ first; ~AppCacheStorageImpl accesses other data members 431 // Destroy storage_ first; ~AppCacheStorageImpl accesses other data members
432 // (special_storage_policy_). 432 // (special_storage_policy_).
433 storage_.reset(); 433 storage_.reset();
434 } 434 }
435 435
436 void AppCacheService::Initialize(const FilePath& cache_directory, 436 void AppCacheService::Initialize(const FilePath& cache_directory,
437 base::MessageLoopProxy* db_thread,
437 base::MessageLoopProxy* cache_thread) { 438 base::MessageLoopProxy* cache_thread) {
438 DCHECK(!storage_.get()); 439 DCHECK(!storage_.get());
439 AppCacheStorageImpl* storage = new AppCacheStorageImpl(this); 440 AppCacheStorageImpl* storage = new AppCacheStorageImpl(this);
440 storage->Initialize(cache_directory, cache_thread); 441 storage->Initialize(cache_directory, db_thread, cache_thread);
441 storage_.reset(storage); 442 storage_.reset(storage);
442 } 443 }
443 444
444 void AppCacheService::CanHandleMainResourceOffline( 445 void AppCacheService::CanHandleMainResourceOffline(
445 const GURL& url, 446 const GURL& url,
446 const GURL& first_party, 447 const GURL& first_party,
447 net::CompletionCallback* callback) { 448 net::CompletionCallback* callback) {
448 CanHandleOfflineHelper* helper = 449 CanHandleOfflineHelper* helper =
449 new CanHandleOfflineHelper(this, url, first_party, callback); 450 new CanHandleOfflineHelper(this, url, first_party, callback);
450 helper->Start(); 451 helper->Start();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 backends_.insert( 489 backends_.insert(
489 BackendMap::value_type(backend_impl->process_id(), backend_impl)); 490 BackendMap::value_type(backend_impl->process_id(), backend_impl));
490 } 491 }
491 492
492 void AppCacheService::UnregisterBackend( 493 void AppCacheService::UnregisterBackend(
493 AppCacheBackendImpl* backend_impl) { 494 AppCacheBackendImpl* backend_impl) {
494 backends_.erase(backend_impl->process_id()); 495 backends_.erase(backend_impl->process_id());
495 } 496 }
496 497
497 } // namespace appcache 498 } // namespace appcache
OLDNEW
« no previous file with comments | « webkit/appcache/appcache_service.h ('k') | webkit/appcache/appcache_storage_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698