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

Side by Side Diff: extensions/browser/api/async_api_function.h

Issue 180163009: chrome.bluetooth API improvements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ChromeOS Full build. Created 6 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_ASYNC_API_FUCTION_H_ 5 #ifndef EXTENSIONS_BROWSER_API_ASYNC_API_FUCTION_H_
6 #define EXTENSIONS_BROWSER_API_ASYNC_API_FUCTION_H_ 6 #define EXTENSIONS_BROWSER_API_ASYNC_API_FUCTION_H_
7 7
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "extensions/browser/extension_function.h" 9 #include "extensions/browser/extension_function.h"
10 10
(...skipping 24 matching lines...) Expand all
35 // Notify AsyncIOApiFunction that the work is completed 35 // Notify AsyncIOApiFunction that the work is completed
36 void AsyncWorkCompleted(); 36 void AsyncWorkCompleted();
37 37
38 // Respond. Guaranteed to happen on UI thread. 38 // Respond. Guaranteed to happen on UI thread.
39 virtual bool Respond() = 0; 39 virtual bool Respond() = 0;
40 40
41 // ExtensionFunction::RunImpl() 41 // ExtensionFunction::RunImpl()
42 virtual bool RunImpl() OVERRIDE; 42 virtual bool RunImpl() OVERRIDE;
43 43
44 protected: 44 protected:
45 content::BrowserThread::ID work_thread_id() const { return work_thread_id_; }
45 void set_work_thread_id(content::BrowserThread::ID work_thread_id) { 46 void set_work_thread_id(content::BrowserThread::ID work_thread_id) {
46 work_thread_id_ = work_thread_id; 47 work_thread_id_ = work_thread_id;
47 } 48 }
48 49
49 private: 50 private:
50 void WorkOnWorkThread(); 51 void WorkOnWorkThread();
51 void RespondOnUIThread(); 52 void RespondOnUIThread();
52 53
53 // If you don't want your Work() method to happen on the IO thread, then set 54 // If you don't want your Work() method to happen on the IO thread, then set
54 // this to the thread that you do want, preferably in Prepare(). 55 // this to the thread that you do want, preferably in Prepare().
55 content::BrowserThread::ID work_thread_id_; 56 content::BrowserThread::ID work_thread_id_;
56 }; 57 };
57 58
58 } // namespace extensions 59 } // namespace extensions
59 60
60 #endif // EXTENSIONS_BROWSER_API_ASYNC_API_FUCTION_H_ 61 #endif // EXTENSIONS_BROWSER_API_ASYNC_API_FUCTION_H_
OLDNEW
« no previous file with comments | « extensions/browser/api/api_resource_manager.h ('k') | extensions/browser/extension_function_histogram_value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698