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

Side by Side Diff: content/public/browser/browser_thread.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 CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 const base::Closure& task); 177 const base::Closure& task);
178 static bool PostBlockingPoolTaskAndReply( 178 static bool PostBlockingPoolTaskAndReply(
179 const tracked_objects::Location& from_here, 179 const tracked_objects::Location& from_here,
180 const base::Closure& task, 180 const base::Closure& task,
181 const base::Closure& reply); 181 const base::Closure& reply);
182 static bool PostBlockingPoolSequencedTask( 182 static bool PostBlockingPoolSequencedTask(
183 const std::string& sequence_token_name, 183 const std::string& sequence_token_name,
184 const tracked_objects::Location& from_here, 184 const tracked_objects::Location& from_here,
185 const base::Closure& task); 185 const base::Closure& task);
186 186
187 // For use with scheduling non-critical tasks for exeuction after startup.
jam 2015/03/10 23:04:34 nit: spelling
188 // The order or execution of tasks posted here is unspecified even when
189 // posting to a SequencedTaskRunner.
190 // Note: the embedder must override ContentBrowserClient.PostAfterStartupTask
191 // to provide this function, otherwise the default behavior is to post the
192 // task immediately.
jam 2015/03/10 23:04:34 nit: i think the "Note" part is confusing. it star
michaeln 2015/03/20 00:21:28 Done. // Note: see related ContentBrowserClient.P
193 static void PostAfterStartupTask(
194 const tracked_objects::Location& from_here,
195 const scoped_refptr<base::TaskRunner>& task_runner,
196 const base::Closure& task);
197
187 // Returns the thread pool used for blocking file I/O. Use this object to 198 // Returns the thread pool used for blocking file I/O. Use this object to
188 // perform random blocking operations such as file writes or querying the 199 // perform random blocking operations such as file writes or querying the
189 // Windows registry. 200 // Windows registry.
190 static base::SequencedWorkerPool* GetBlockingPool() WARN_UNUSED_RESULT; 201 static base::SequencedWorkerPool* GetBlockingPool() WARN_UNUSED_RESULT;
191 202
192 // Callable on any thread. Returns whether the given well-known thread is 203 // Callable on any thread. Returns whether the given well-known thread is
193 // initialized. 204 // initialized.
194 static bool IsThreadInitialized(ID identifier) WARN_UNUSED_RESULT; 205 static bool IsThreadInitialized(ID identifier) WARN_UNUSED_RESULT;
195 206
196 // Callable on any thread. Returns whether you're currently on a particular 207 // Callable on any thread. Returns whether you're currently on a particular
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 private: 298 private:
288 friend class BrowserThreadImpl; 299 friend class BrowserThreadImpl;
289 300
290 BrowserThread() {} 301 BrowserThread() {}
291 DISALLOW_COPY_AND_ASSIGN(BrowserThread); 302 DISALLOW_COPY_AND_ASSIGN(BrowserThread);
292 }; 303 };
293 304
294 } // namespace content 305 } // namespace content
295 306
296 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ 307 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698