Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 namespace tab_capture = extensions::api::tab_capture; | 27 namespace tab_capture = extensions::api::tab_capture; |
| 28 | 28 |
| 29 class TabCaptureRegistry : public ProfileKeyedService, | 29 class TabCaptureRegistry : public ProfileKeyedService, |
| 30 public content::NotificationObserver { | 30 public content::NotificationObserver { |
| 31 public: | 31 public: |
| 32 struct TabCaptureRequest { | 32 struct TabCaptureRequest { |
| 33 std::string extension_id; | 33 std::string extension_id; |
| 34 int tab_id; | 34 int tab_id; |
| 35 tab_capture::TabCaptureState status; | 35 tab_capture::TabCaptureState status; |
| 36 | 36 |
| 37 TabCaptureRequest() : tab_id(-1) {} | |
|
Matt Perry
2013/01/04 21:17:18
What is the reason for removing this constructor?
justinlin
2013/01/04 22:10:52
Yea, kmadhusu@ found the uninitialized status issu
| |
| 38 TabCaptureRequest(std::string extension_id, int tab_id, | 37 TabCaptureRequest(std::string extension_id, int tab_id, |
| 39 tab_capture::TabCaptureState status) | 38 tab_capture::TabCaptureState status) |
| 40 : extension_id(extension_id), tab_id(tab_id), status(status) {} | 39 : extension_id(extension_id), tab_id(tab_id), status(status) {} |
|
Matt Perry
2013/01/04 21:17:18
Move the constructor definition to the .cc file. A
justinlin
2013/01/04 22:10:52
Done.
| |
| 41 }; | 40 }; |
| 42 typedef std::vector<TabCaptureRequest> CaptureRequestList; | 41 typedef std::vector<TabCaptureRequest> CaptureRequestList; |
| 43 | 42 |
| 44 explicit TabCaptureRegistry(Profile* profile); | 43 explicit TabCaptureRegistry(Profile* profile); |
| 45 | 44 |
| 46 const CaptureRequestList GetCapturedTabs(const std::string& extension_id); | 45 const CaptureRequestList GetCapturedTabs(const std::string& extension_id); |
| 47 bool AddRequest(const std::pair<int, int>, const TabCaptureRequest& request); | 46 bool AddRequest(const std::pair<int, int>, const TabCaptureRequest& request); |
| 48 bool VerifyRequest(int render_process_id, int render_view_id); | 47 bool VerifyRequest(int render_process_id, int render_view_id); |
| 49 | 48 |
| 50 private: | 49 private: |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 content::NotificationRegistrar registrar_; | 98 content::NotificationRegistrar registrar_; |
| 100 Profile* const profile_; | 99 Profile* const profile_; |
| 101 DeviceCaptureRequestMap requests_; | 100 DeviceCaptureRequestMap requests_; |
| 102 | 101 |
| 103 DISALLOW_COPY_AND_ASSIGN(TabCaptureRegistry); | 102 DISALLOW_COPY_AND_ASSIGN(TabCaptureRegistry); |
| 104 }; | 103 }; |
| 105 | 104 |
| 106 } // namespace extension | 105 } // namespace extension |
| 107 | 106 |
| 108 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_H_ | 107 #endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_H_ |
| OLD | NEW |