| OLD | NEW |
| 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 CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_CHANNEL_ID_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_CHANNEL_ID_HELPER_H_ |
| 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_CHANNEL_ID_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_CHANNEL_ID_HELPER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 // This class is a thin wrapper around BrowsingDataChannelIDHelper that | 48 // This class is a thin wrapper around BrowsingDataChannelIDHelper that |
| 49 // does not fetch its information from the ChannelIDService, but gets them | 49 // does not fetch its information from the ChannelIDService, but gets them |
| 50 // passed as a parameter during construction. | 50 // passed as a parameter during construction. |
| 51 class CannedBrowsingDataChannelIDHelper | 51 class CannedBrowsingDataChannelIDHelper |
| 52 : public BrowsingDataChannelIDHelper { | 52 : public BrowsingDataChannelIDHelper { |
| 53 public: | 53 public: |
| 54 CannedBrowsingDataChannelIDHelper(); | 54 CannedBrowsingDataChannelIDHelper(); |
| 55 | 55 |
| 56 // Return a copy of the ChannelID helper. Only one consumer can use the | |
| 57 // StartFetching method at a time, so we need to create a copy of the helper | |
| 58 // every time we instantiate a cookies tree model for it. | |
| 59 CannedBrowsingDataChannelIDHelper* Clone(); | |
| 60 | |
| 61 // Add an ChannelID to the set of canned channel IDs that is | 56 // Add an ChannelID to the set of canned channel IDs that is |
| 62 // returned by this helper. | 57 // returned by this helper. |
| 63 void AddChannelID( | 58 void AddChannelID( |
| 64 const net::ChannelIDStore::ChannelID& channel_id); | 59 const net::ChannelIDStore::ChannelID& channel_id); |
| 65 | 60 |
| 66 // Clears the list of canned channel IDs. | 61 // Clears the list of canned channel IDs. |
| 67 void Reset(); | 62 void Reset(); |
| 68 | 63 |
| 69 // True if no ChannelIDs are currently stored. | 64 // True if no ChannelIDs are currently stored. |
| 70 bool empty() const; | 65 bool empty() const; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 84 typedef std::map<std::string, net::ChannelIDStore::ChannelID> | 79 typedef std::map<std::string, net::ChannelIDStore::ChannelID> |
| 85 ChannelIDMap; | 80 ChannelIDMap; |
| 86 ChannelIDMap channel_id_map_; | 81 ChannelIDMap channel_id_map_; |
| 87 | 82 |
| 88 FetchResultCallback completion_callback_; | 83 FetchResultCallback completion_callback_; |
| 89 | 84 |
| 90 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataChannelIDHelper); | 85 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataChannelIDHelper); |
| 91 }; | 86 }; |
| 92 | 87 |
| 93 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_CHANNEL_ID_HELPER_H_ | 88 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_CHANNEL_ID_HELPER_H_ |
| OLD | NEW |