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

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

Issue 8857004: Delete UDPClientSocket on same thread as creation. Also refactor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to fix hunk failure. Created 9 years 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
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_SERVICE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 class SyncData; 68 class SyncData;
69 class Version; 69 class Version;
70 70
71 namespace chromeos { 71 namespace chromeos {
72 class ExtensionInputMethodEventRouter; 72 class ExtensionInputMethodEventRouter;
73 } 73 }
74 74
75 namespace extensions { 75 namespace extensions {
76 class ComponentLoader; 76 class ComponentLoader;
77 class SettingsFrontend; 77 class SettingsFrontend;
78 class SocketController;
78 } 79 }
79 80
80 // This is an interface class to encapsulate the dependencies that 81 // This is an interface class to encapsulate the dependencies that
81 // various classes have on ExtensionService. This allows easy mocking. 82 // various classes have on ExtensionService. This allows easy mocking.
82 class ExtensionServiceInterface : public SyncableService { 83 class ExtensionServiceInterface : public SyncableService {
83 public: 84 public:
84 // A function that returns true if the given extension should be 85 // A function that returns true if the given extension should be
85 // included and false if it should be filtered out. Identical to 86 // included and false if it should be filtered out. Identical to
86 // PendingExtensionInfo::ShouldAllowInstallPredicate. 87 // PendingExtensionInfo::ShouldAllowInstallPredicate.
87 typedef bool (*ExtensionFilter)(const Extension&); 88 typedef bool (*ExtensionFilter)(const Extension&);
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 #if defined(UNIT_TEST) 563 #if defined(UNIT_TEST)
563 void TrackTerminatedExtensionForTest(const Extension* extension) { 564 void TrackTerminatedExtensionForTest(const Extension* extension) {
564 TrackTerminatedExtension(extension); 565 TrackTerminatedExtension(extension);
565 } 566 }
566 #endif 567 #endif
567 568
568 ExtensionWarningSet* extension_warnings() { 569 ExtensionWarningSet* extension_warnings() {
569 return &extension_warnings_; 570 return &extension_warnings_;
570 } 571 }
571 572
573 extensions::SocketController* socket_controller() {
574 return socket_controller_;
575 }
576
572 private: 577 private:
573 // Bundle of type (app or extension)-specific sync stuff. 578 // Bundle of type (app or extension)-specific sync stuff.
574 struct SyncBundle { 579 struct SyncBundle {
575 SyncBundle(); 580 SyncBundle();
576 ~SyncBundle(); 581 ~SyncBundle();
577 582
578 bool HasExtensionId(const std::string& id) const; 583 bool HasExtensionId(const std::string& id) const;
579 bool HasPendingExtensionId(const std::string& id) const; 584 bool HasPendingExtensionId(const std::string& id) const;
580 585
581 ExtensionFilter filter; 586 ExtensionFilter filter;
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 bool external_extension_url_added_; 817 bool external_extension_url_added_;
813 818
814 NaClModuleInfoList nacl_module_list_; 819 NaClModuleInfoList nacl_module_list_;
815 820
816 SyncBundle app_sync_bundle_; 821 SyncBundle app_sync_bundle_;
817 SyncBundle extension_sync_bundle_; 822 SyncBundle extension_sync_bundle_;
818 823
819 // Contains an entry for each warning that shall be currently shown. 824 // Contains an entry for each warning that shall be currently shown.
820 ExtensionWarningSet extension_warnings_; 825 ExtensionWarningSet extension_warnings_;
821 826
827 // We need to control destruction of this object (it needs to happen on the
828 // IO thread), so we don't get to use any RAII devices with it.
829 extensions::SocketController* socket_controller_;
830
822 extensions::ProcessMap process_map_; 831 extensions::ProcessMap process_map_;
823 832
824 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 833 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
825 InstallAppsWithUnlimtedStorage); 834 InstallAppsWithUnlimtedStorage);
826 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 835 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
827 InstallAppsAndCheckStorageProtection); 836 InstallAppsAndCheckStorageProtection);
828 DISALLOW_COPY_AND_ASSIGN(ExtensionService); 837 DISALLOW_COPY_AND_ASSIGN(ExtensionService);
829 }; 838 };
830 839
831 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 840 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/socket/socket_api_controller_unittest.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698