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

Side by Side Diff: headless/lib/browser/headless_browser_impl.h

Issue 2690163005: Change platform methods and try to make init logging logic clearer (Closed)
Patch Set: Uploaded upstream Created 3 years, 10 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
« no previous file with comments | « no previous file | headless/lib/browser/headless_browser_impl_aura.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_ 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_
6 #define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_ 6 #define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_
7 7
8 #include "headless/public/headless_browser.h" 8 #include "headless/public/headless_browser.h"
9 9
10 #include <memory> 10 #include <memory>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // (all web contents associated with it go away too). 65 // (all web contents associated with it go away too).
66 void DestroyBrowserContext(HeadlessBrowserContextImpl* browser_context); 66 void DestroyBrowserContext(HeadlessBrowserContextImpl* browser_context);
67 67
68 base::WeakPtr<HeadlessBrowserImpl> GetWeakPtr(); 68 base::WeakPtr<HeadlessBrowserImpl> GetWeakPtr();
69 69
70 // All the methods that begin with Platform need to be implemented by the 70 // All the methods that begin with Platform need to be implemented by the
71 // platform specific headless implementation. 71 // platform specific headless implementation.
72 // Helper for one time initialization of application 72 // Helper for one time initialization of application
73 void PlatformInitialize(); 73 void PlatformInitialize();
74 void PlatformCreateWindow(); 74 void PlatformCreateWindow();
75 void PlatformSetWebContents(const gfx::Size& initial_size, 75 void PlatformInitializeWebContents(const gfx::Size& initial_size,
76 content::WebContents* web_contents); 76 content::WebContents* web_contents);
77 77
78 protected: 78 protected:
79 #if defined(USE_AURA) 79 #if defined(USE_AURA)
80 // TODO(eseckler): Currently one window and one window_tree_host 80 // TODO(eseckler): Currently one window and one window_tree_host
81 // is used for all web contents. We should probably use one 81 // is used for all web contents. We should probably use one
82 // window per web contents, but additional investigation is needed. 82 // window per web contents, but additional investigation is needed.
83 std::unique_ptr<HeadlessWindowTreeHost> window_tree_host_; 83 std::unique_ptr<HeadlessWindowTreeHost> window_tree_host_;
84 #endif 84 #endif
85 base::Callback<void(HeadlessBrowser*)> on_start_callback_; 85 base::Callback<void(HeadlessBrowser*)> on_start_callback_;
86 HeadlessBrowser::Options options_; 86 HeadlessBrowser::Options options_;
87 HeadlessBrowserMainParts* browser_main_parts_; // Not owned. 87 HeadlessBrowserMainParts* browser_main_parts_; // Not owned.
88 88
89 std::unordered_map<std::string, std::unique_ptr<HeadlessBrowserContextImpl>> 89 std::unordered_map<std::string, std::unique_ptr<HeadlessBrowserContextImpl>>
90 browser_contexts_; 90 browser_contexts_;
91 HeadlessBrowserContext* default_browser_context_; // Not owned. 91 HeadlessBrowserContext* default_browser_context_; // Not owned.
92 92
93 base::WeakPtrFactory<HeadlessBrowserImpl> weak_ptr_factory_; 93 base::WeakPtrFactory<HeadlessBrowserImpl> weak_ptr_factory_;
94 94
95 private: 95 private:
96 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserImpl); 96 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserImpl);
97 }; 97 };
98 98
99 } // namespace headless 99 } // namespace headless
100 100
101 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_ 101 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | headless/lib/browser/headless_browser_impl_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698