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

Side by Side Diff: chrome/browser/extensions/extension_function.h

Issue 7663019: Add some comments to IOThreadExtensionFunction explaining its intended use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_EXTENSIONS_EXTENSION_FUNCTION_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <list> 10 #include <list>
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 const NotificationDetails& details); 271 const NotificationDetails& details);
272 UIThreadExtensionFunction* function_; 272 UIThreadExtensionFunction* function_;
273 NotificationRegistrar registrar_; 273 NotificationRegistrar registrar_;
274 }; 274 };
275 275
276 virtual void Destruct() const; 276 virtual void Destruct() const;
277 277
278 scoped_ptr<RenderViewHostTracker> tracker_; 278 scoped_ptr<RenderViewHostTracker> tracker_;
279 }; 279 };
280 280
281 // Extension functions that run on the IO thread. 281 // Extension functions that run on the IO thread. This type of function avoids
282 // a roundtrip to and from the UI thread (because communication with the
283 // extension process happens on the IO thread). It's intended to be used when
284 // performance is critical (e.g. the webRequest API which can block network
285 // requests). Generally, UIThreadExtensionFunction is more appropriate and will
286 // be easier to use and interface with the rest of the browser.
282 class IOThreadExtensionFunction : public ExtensionFunction { 287 class IOThreadExtensionFunction : public ExtensionFunction {
283 public: 288 public:
284 IOThreadExtensionFunction(); 289 IOThreadExtensionFunction();
285 290
286 virtual IOThreadExtensionFunction* AsIOThreadExtensionFunction() OVERRIDE; 291 virtual IOThreadExtensionFunction* AsIOThreadExtensionFunction() OVERRIDE;
287 292
288 void set_ipc_sender(base::WeakPtr<ChromeRenderMessageFilter> ipc_sender, 293 void set_ipc_sender(base::WeakPtr<ChromeRenderMessageFilter> ipc_sender,
289 int routing_id) { 294 int routing_id) {
290 ipc_sender_ = ipc_sender; 295 ipc_sender_ = ipc_sender;
291 routing_id_ = routing_id; 296 routing_id_ = routing_id;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 public: 357 public:
353 SyncIOThreadExtensionFunction(); 358 SyncIOThreadExtensionFunction();
354 359
355 virtual void Run() OVERRIDE; 360 virtual void Run() OVERRIDE;
356 361
357 protected: 362 protected:
358 virtual ~SyncIOThreadExtensionFunction(); 363 virtual ~SyncIOThreadExtensionFunction();
359 }; 364 };
360 365
361 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ 366 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698