Chromium Code Reviews| Index: components/previews/core/previews_io_data.h |
| diff --git a/components/previews/core/previews_io_data.h b/components/previews/core/previews_io_data.h |
| index 16dd0099ac255834c89c1cd64eef2c6148ebb55d..a5d55ba1e94974d1a10dc40a2a459fc3257a4a1e 100644 |
| --- a/components/previews/core/previews_io_data.h |
| +++ b/components/previews/core/previews_io_data.h |
| @@ -1,56 +1,66 @@ |
| // Copyright 2016 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_IO_DATA_H_ |
| -#define COMPONENTS_PREVIEWS_CORE_PREVIEWS_IO_DATA_H_ |
| +#ifndef COMPONENTS_PREVIEWS_PREVIEWS_IO_DATA_H_ |
| +#define COMPONENTS_PREVIEWS_PREVIEWS_IO_DATA_H_ |
|
tbansal1
2016/09/19 21:26:08
_CORE_ missing. check other header files too.
RyanSturm
2016/09/19 22:37:45
Done.
|
| +#include <memory> |
| #include <string> |
| #include "base/macros.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/single_thread_task_runner.h" |
| -#include "base/threading/thread_checker.h" |
| +#include "base/time/time.h" |
| +#include "components/previews/core/previews_opt_out_store.h" |
| namespace previews { |
| +class PreviewsBlackList; |
| class PreviewsUIService; |
| +enum class PreviewsType; |
|
tbansal1
2016/09/19 21:26:08
Why is this defined here?
RyanSturm
2016/09/19 22:37:45
Done. Left over from UI to IO messages.
|
| // A class to manage the IO portion of inter-thread communication between |
| // previews/ objects. Created on the UI thread, but used only on the IO thread |
| // after initialization. |
| class PreviewsIOData { |
| public: |
| PreviewsIOData( |
| const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner, |
| const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner); |
| virtual ~PreviewsIOData(); |
| // Stores |previews_ui_service| as |previews_ui_service_| and posts a task to |
| // InitializeOnIOThread on the IO thread. |
| - void Initialize(base::WeakPtr<PreviewsUIService> previews_ui_service); |
| + void Initialize(base::WeakPtr<PreviewsUIService> previews_ui_service, |
| + std::unique_ptr<PreviewsOptOutStore> previews_opt_out_store); |
| + |
| + PreviewsBlackList* black_list() const { return black_list_.get(); } |
| protected: |
| // Posts a task to SetIOData for |previews_ui_service_| on the UI thread with |
| // a weak pointer to |this|. Virtualized for testing. |
| - virtual void InitializeOnIOThread(); |
| + virtual void InitializeOnIOThread( |
| + std::unique_ptr<PreviewsOptOutStore> previews_opt_out_store); |
| private: |
| // The UI thread portion of the inter-thread communication for previews. |
| base::WeakPtr<PreviewsUIService> previews_ui_service_; |
| + std::unique_ptr<PreviewsBlackList> black_list_; |
|
tbansal1
2016/09/19 21:26:08
either s/black_list_/previews_black_list_/
or s/Pr
RyanSturm
2016/09/19 22:37:46
Done.
|
| + |
| // The UI and IO thread task runners. |ui_task_runner_| is used to post |
| // tasks to |previews_ui_service_|, and |io_task_runner_| is used to post from |
| // Initialize to InitializeOnIOThread as well as verify that execution is |
| // happening on the IO thread. |
| scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
| scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| base::WeakPtrFactory<PreviewsIOData> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(PreviewsIOData); |
| }; |
| } // namespace previews |
| -#endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_IO_DATA_H_ |
| +#endif // COMPONENTS_PREVIEWS_PREVIEWS_IO_DATA_H_ |