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

Side by Side Diff: chrome/common/appcache/chrome_appcache_service.h

Issue 195077: Tell the AppCacheService which request context to use when fetching resources... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « chrome/browser/profile.cc ('k') | webkit/appcache/appcache_service.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef CHROME_COMMON_APPCACHE_CHROME_APPCACHE_SERVICE_H_ 5 #ifndef CHROME_COMMON_APPCACHE_CHROME_APPCACHE_SERVICE_H_
6 #define CHROME_COMMON_APPCACHE_CHROME_APPCACHE_SERVICE_H_ 6 #define CHROME_COMMON_APPCACHE_CHROME_APPCACHE_SERVICE_H_
7 7
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/ref_counted.h" 10 #include "base/ref_counted.h"
(...skipping 15 matching lines...) Expand all
26 : public base::RefCountedThreadSafe<ChromeAppCacheService>, 26 : public base::RefCountedThreadSafe<ChromeAppCacheService>,
27 public appcache::AppCacheService { 27 public appcache::AppCacheService {
28 public: 28 public:
29 29
30 explicit ChromeAppCacheService() 30 explicit ChromeAppCacheService()
31 : was_initialized_with_io_thread_(false) { 31 : was_initialized_with_io_thread_(false) {
32 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); 32 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
33 } 33 }
34 34
35 void InitializeOnUIThread(const FilePath& data_directory, 35 void InitializeOnUIThread(const FilePath& data_directory,
36 URLRequestContext* request_context,
36 bool is_incognito) { 37 bool is_incognito) {
37 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); 38 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
39 set_request_context(request_context);
38 40
39 // Some test cases run without an IO thread. 41 // Some test cases run without an IO thread.
40 MessageLoop* io_thread = ChromeThread::GetMessageLoop(ChromeThread::IO); 42 MessageLoop* io_thread = ChromeThread::GetMessageLoop(ChromeThread::IO);
41 if (io_thread) { 43 if (io_thread) {
42 was_initialized_with_io_thread_ = true; 44 was_initialized_with_io_thread_ = true;
43 io_thread->PostTask(FROM_HERE, 45 io_thread->PostTask(FROM_HERE,
44 NewRunnableMethod(this, &ChromeAppCacheService::InitializeOnIOThread, 46 NewRunnableMethod(this, &ChromeAppCacheService::InitializeOnIOThread,
45 data_directory, is_incognito)); 47 data_directory, is_incognito));
46 } 48 }
47 } 49 }
(...skipping 10 matching lines...) Expand all
58 bool is_incognito) { 60 bool is_incognito) {
59 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); 61 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
60 Initialize(is_incognito ? FilePath() 62 Initialize(is_incognito ? FilePath()
61 : data_directory.Append(chrome::kAppCacheDirname)); 63 : data_directory.Append(chrome::kAppCacheDirname));
62 } 64 }
63 65
64 bool was_initialized_with_io_thread_; 66 bool was_initialized_with_io_thread_;
65 }; 67 };
66 68
67 #endif // CHROME_COMMON_APPCACHE_CHROME_APPCACHE_SERVICE_H_ 69 #endif // CHROME_COMMON_APPCACHE_CHROME_APPCACHE_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/profile.cc ('k') | webkit/appcache/appcache_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698