| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 const GURL& script_url, | 65 const GURL& script_url, |
| 66 const ResultCallback& continuation) OVERRIDE; | 66 const ResultCallback& continuation) OVERRIDE; |
| 67 virtual void UnregisterServiceWorker(const GURL& pattern, | 67 virtual void UnregisterServiceWorker(const GURL& pattern, |
| 68 const ResultCallback& continuation) | 68 const ResultCallback& continuation) |
| 69 OVERRIDE; | 69 OVERRIDE; |
| 70 virtual void Terminate() OVERRIDE; | 70 virtual void Terminate() OVERRIDE; |
| 71 | 71 |
| 72 void AddObserver(ServiceWorkerContextObserver* observer); | 72 void AddObserver(ServiceWorkerContextObserver* observer); |
| 73 void RemoveObserver(ServiceWorkerContextObserver* observer); | 73 void RemoveObserver(ServiceWorkerContextObserver* observer); |
| 74 | 74 |
| 75 bool is_incognito() const { return is_incognito_; } |
| 76 |
| 75 private: | 77 private: |
| 76 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; | 78 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; |
| 77 friend class EmbeddedWorkerTestHelper; | 79 friend class EmbeddedWorkerTestHelper; |
| 78 friend class ServiceWorkerProcessManager; | 80 friend class ServiceWorkerProcessManager; |
| 79 virtual ~ServiceWorkerContextWrapper(); | 81 virtual ~ServiceWorkerContextWrapper(); |
| 80 | 82 |
| 81 void InitInternal(const base::FilePath& user_data_directory, | 83 void InitInternal(const base::FilePath& user_data_directory, |
| 82 base::SequencedTaskRunner* database_task_runner, | 84 base::SequencedTaskRunner* database_task_runner, |
| 83 base::MessageLoopProxy* disk_cache_thread, | 85 base::MessageLoopProxy* disk_cache_thread, |
| 84 quota::QuotaManagerProxy* quota_manager_proxy); | 86 quota::QuotaManagerProxy* quota_manager_proxy); |
| 85 void ShutdownOnIO(); | 87 void ShutdownOnIO(); |
| 86 | 88 |
| 87 void DidDeleteAndStartOver(ServiceWorkerStatusCode status); | 89 void DidDeleteAndStartOver(ServiceWorkerStatusCode status); |
| 88 | 90 |
| 89 const scoped_refptr<ObserverListThreadSafe<ServiceWorkerContextObserver> > | 91 const scoped_refptr<ObserverListThreadSafe<ServiceWorkerContextObserver> > |
| 90 observer_list_; | 92 observer_list_; |
| 91 const scoped_ptr<ServiceWorkerProcessManager> process_manager_; | 93 const scoped_ptr<ServiceWorkerProcessManager> process_manager_; |
| 92 // Cleared in Shutdown(): | 94 // Cleared in Shutdown(): |
| 93 scoped_ptr<ServiceWorkerContextCore> context_core_; | 95 scoped_ptr<ServiceWorkerContextCore> context_core_; |
| 96 |
| 97 // Initialized in Init(); true of the user data directory is empty. |
| 98 bool is_incognito_; |
| 94 }; | 99 }; |
| 95 | 100 |
| 96 } // namespace content | 101 } // namespace content |
| 97 | 102 |
| 98 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 103 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
| OLD | NEW |