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 #include "extensions/browser/guest_view/app_view/app_view_guest.h" | 5 #include "extensions/browser/guest_view/app_view/app_view_guest.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 const base::WeakPtr<AppViewGuest>& app_view_guest, | 47 const base::WeakPtr<AppViewGuest>& app_view_guest, |
48 const GuestViewBase::WebContentsCreatedCallback& callback) | 48 const GuestViewBase::WebContentsCreatedCallback& callback) |
49 : guest_extension(guest_extension), | 49 : guest_extension(guest_extension), |
50 app_view_guest(app_view_guest), | 50 app_view_guest(app_view_guest), |
51 callback(callback) {} | 51 callback(callback) {} |
52 | 52 |
53 ~ResponseInfo() {} | 53 ~ResponseInfo() {} |
54 }; | 54 }; |
55 | 55 |
56 using PendingResponseMap = std::map<int, std::unique_ptr<ResponseInfo>>; | 56 using PendingResponseMap = std::map<int, std::unique_ptr<ResponseInfo>>; |
57 static base::LazyInstance<PendingResponseMap> pending_response_map = | 57 static base::LazyInstance<PendingResponseMap>::DestructorAtExit |
58 LAZY_INSTANCE_INITIALIZER; | 58 pending_response_map = LAZY_INSTANCE_INITIALIZER; |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 // static. | 62 // static. |
63 const char AppViewGuest::Type[] = "appview"; | 63 const char AppViewGuest::Type[] = "appview"; |
64 | 64 |
65 // static. | 65 // static. |
66 bool AppViewGuest::CompletePendingRequest( | 66 bool AppViewGuest::CompletePendingRequest( |
67 content::BrowserContext* browser_context, | 67 content::BrowserContext* browser_context, |
68 const GURL& url, | 68 const GURL& url, |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 279 |
280 std::vector<int> AppViewGuest::GetAllRegisteredInstanceIdsForTesting() { | 280 std::vector<int> AppViewGuest::GetAllRegisteredInstanceIdsForTesting() { |
281 std::vector<int> instances; | 281 std::vector<int> instances; |
282 for (const auto& key_value : pending_response_map.Get()) { | 282 for (const auto& key_value : pending_response_map.Get()) { |
283 instances.push_back(key_value.first); | 283 instances.push_back(key_value.first); |
284 } | 284 } |
285 return instances; | 285 return instances; |
286 } | 286 } |
287 | 287 |
288 } // namespace extensions | 288 } // namespace extensions |
OLD | NEW |