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

Side by Side Diff: chrome/browser/chrome_content_browser_client.h

Issue 949293002: Implement a poor man's PostAfterStartupTask() function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ 5 #ifndef CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_
6 #define CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ 6 #define CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_
7 7
8 #include <deque>
8 #include <set> 9 #include <set>
9 #include <string> 10 #include <string>
10 #include <utility> 11 #include <utility>
11 #include <vector> 12 #include <vector>
12 13
13 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
14 #include "base/gtest_prod_util.h" 15 #include "base/gtest_prod_util.h"
15 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
17 #include "chrome/common/chrome_version_info.h" 18 #include "chrome/common/chrome_version_info.h"
(...skipping 25 matching lines...) Expand all
43 ~ChromeContentBrowserClient() override; 44 ~ChromeContentBrowserClient() override;
44 45
45 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 46 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
46 47
47 // Notification that the application locale has changed. This allows us to 48 // Notification that the application locale has changed. This allows us to
48 // update our I/O thread cache of this value. 49 // update our I/O thread cache of this value.
49 static void SetApplicationLocale(const std::string& locale); 50 static void SetApplicationLocale(const std::string& locale);
50 51
51 content::BrowserMainParts* CreateBrowserMainParts( 52 content::BrowserMainParts* CreateBrowserMainParts(
52 const content::MainFunctionParams& parameters) override; 53 const content::MainFunctionParams& parameters) override;
54 void PostAfterStartupTask(const tracked_objects::Location& from_here,
55 const scoped_refptr<base::TaskRunner>& task_runner,
56 const base::Closure& task) override;
53 std::string GetStoragePartitionIdForSite( 57 std::string GetStoragePartitionIdForSite(
54 content::BrowserContext* browser_context, 58 content::BrowserContext* browser_context,
55 const GURL& site) override; 59 const GURL& site) override;
56 bool IsValidStoragePartitionId(content::BrowserContext* browser_context, 60 bool IsValidStoragePartitionId(content::BrowserContext* browser_context,
57 const std::string& partition_id) override; 61 const std::string& partition_id) override;
58 void GetStoragePartitionConfigForSite( 62 void GetStoragePartitionConfigForSite(
59 content::BrowserContext* browser_context, 63 content::BrowserContext* browser_context,
60 const GURL& site, 64 const GURL& site,
61 bool can_be_default, 65 bool can_be_default,
62 std::string* partition_domain, 66 std::string* partition_domain,
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 content::RenderFrameHost* render_frame_host, 263 content::RenderFrameHost* render_frame_host,
260 blink::WebPageVisibilityState* visibility_state) override; 264 blink::WebPageVisibilityState* visibility_state) override;
261 265
262 #if defined(OS_POSIX) && !defined(OS_MACOSX) 266 #if defined(OS_POSIX) && !defined(OS_MACOSX)
263 void GetAdditionalMappedFilesForChildProcess( 267 void GetAdditionalMappedFilesForChildProcess(
264 const base::CommandLine& command_line, 268 const base::CommandLine& command_line,
265 int child_process_id, 269 int child_process_id,
266 content::FileDescriptorInfo* mappings) override; 270 content::FileDescriptorInfo* mappings) override;
267 #endif 271 #endif
268 #if defined(OS_WIN) 272 #if defined(OS_WIN)
269 virtual const wchar_t* GetResourceDllName() override; 273 const wchar_t* GetResourceDllName() override;
270 virtual void PreSpawnRenderer(sandbox::TargetPolicy* policy, 274 void PreSpawnRenderer(sandbox::TargetPolicy* policy, bool* success) override;
271 bool* success) override;
272 #endif 275 #endif
273 bool CheckMediaAccessPermission(content::BrowserContext* browser_context, 276 bool CheckMediaAccessPermission(content::BrowserContext* browser_context,
274 const GURL& security_origin, 277 const GURL& security_origin,
275 content::MediaStreamType type) override; 278 content::MediaStreamType type) override;
276 279
277 void OpenURL(content::BrowserContext* browser_context, 280 void OpenURL(content::BrowserContext* browser_context,
278 const content::OpenURLParams& params, 281 const content::OpenURLParams& params,
279 const base::Callback<void(content::WebContents*)>& callback) 282 const base::Callback<void(content::WebContents*)>& callback)
280 override; 283 override;
281 284
282 void RecordURLMetric(const std::string& metric, const GURL& url) override; 285 void RecordURLMetric(const std::string& metric, const GURL& url) override;
283 286
284 private: 287 private:
285 friend class DisableWebRtcEncryptionFlagTest; 288 friend class DisableWebRtcEncryptionFlagTest;
286 289
290 void OnAfterStartupTasksTimer();
291
287 #if defined(ENABLE_WEBRTC) 292 #if defined(ENABLE_WEBRTC)
288 // Copies disable WebRTC encryption switch depending on the channel. 293 // Copies disable WebRTC encryption switch depending on the channel.
289 static void MaybeCopyDisableWebRtcEncryptionSwitch( 294 static void MaybeCopyDisableWebRtcEncryptionSwitch(
290 base::CommandLine* to_command_line, 295 base::CommandLine* to_command_line,
291 const base::CommandLine& from_command_line, 296 const base::CommandLine& from_command_line,
292 VersionInfo::Channel channel); 297 VersionInfo::Channel channel);
293 #endif 298 #endif
294 299
295 void FileSystemAccessed( 300 void FileSystemAccessed(
296 const GURL& url, 301 const GURL& url,
(...skipping 24 matching lines...) Expand all
321 // Set of origins that can use "dev chanel" APIs from NaCl, even on stable 326 // Set of origins that can use "dev chanel" APIs from NaCl, even on stable
322 // versions of Chrome. 327 // versions of Chrome.
323 std::set<std::string> allowed_dev_channel_origins_; 328 std::set<std::string> allowed_dev_channel_origins_;
324 #endif 329 #endif
325 330
326 #if defined(OS_POSIX) && !defined(OS_MACOSX) 331 #if defined(OS_POSIX) && !defined(OS_MACOSX)
327 base::ScopedFD v8_natives_fd_; 332 base::ScopedFD v8_natives_fd_;
328 base::ScopedFD v8_snapshot_fd_; 333 base::ScopedFD v8_snapshot_fd_;
329 #endif // OS_POSIX && !OS_MACOSX 334 #endif // OS_POSIX && !OS_MACOSX
330 335
336 base::WeakPtr<ChromeContentBrowserClient> weak_this_;
337 std::deque<base::Callback<bool(void)>> after_startup_tasks_;
338
331 // Vector of additional ChromeContentBrowserClientParts. 339 // Vector of additional ChromeContentBrowserClientParts.
332 // Parts are deleted in the reverse order they are added. 340 // Parts are deleted in the reverse order they are added.
333 std::vector<ChromeContentBrowserClientParts*> extra_parts_; 341 std::vector<ChromeContentBrowserClientParts*> extra_parts_;
334 342
335 base::WeakPtrFactory<ChromeContentBrowserClient> weak_factory_; 343 base::WeakPtrFactory<ChromeContentBrowserClient> weak_factory_;
336 344
337 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClient); 345 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClient);
338 }; 346 };
339 347
340 } // namespace chrome 348 } // namespace chrome
341 349
342 #endif // CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ 350 #endif // CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698