| 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 COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ | 5 #ifndef COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ |
| 6 #define COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ | 6 #define COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 return static_cast<T*>(this); | 58 return static_cast<T*>(this); |
| 59 | 59 |
| 60 return nullptr; | 60 return nullptr; |
| 61 } | 61 } |
| 62 | 62 |
| 63 // Cleans up state when this GuestView is being destroyed. | 63 // Cleans up state when this GuestView is being destroyed. |
| 64 // Note that this cannot be done in the destructor since a GuestView could | 64 // Note that this cannot be done in the destructor since a GuestView could |
| 65 // potentially be created and destroyed in JavaScript before getting a | 65 // potentially be created and destroyed in JavaScript before getting a |
| 66 // GuestViewBase instance. This method can be hidden by a CleanUp() method in | 66 // GuestViewBase instance. This method can be hidden by a CleanUp() method in |
| 67 // a derived class, in which case the derived method should call this one. | 67 // a derived class, in which case the derived method should call this one. |
| 68 static void CleanUp(int embedder_process_id, int view_instance_id); | 68 static void CleanUp(content::BrowserContext* browser_context, |
| 69 int embedder_process_id, |
| 70 int view_instance_id); |
| 69 | 71 |
| 70 static GuestViewBase* FromWebContents( | 72 static GuestViewBase* FromWebContents( |
| 71 const content::WebContents* web_contents); | 73 const content::WebContents* web_contents); |
| 72 | 74 |
| 73 static GuestViewBase* From(int owner_process_id, int instance_id); | 75 static GuestViewBase* From(int owner_process_id, int instance_id); |
| 74 | 76 |
| 75 // Given a |web_contents|, returns the top level owner WebContents. If | 77 // Given a |web_contents|, returns the top level owner WebContents. If |
| 76 // |web_contents| does not belong to a GuestView, it will be returned | 78 // |web_contents| does not belong to a GuestView, it will be returned |
| 77 // unchanged. | 79 // unchanged. |
| 78 static content::WebContents* GetTopLevelWebContents( | 80 static content::WebContents* GetTopLevelWebContents( |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 // This is used to ensure pending tasks will not fire after this object is | 455 // This is used to ensure pending tasks will not fire after this object is |
| 454 // destroyed. | 456 // destroyed. |
| 455 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 457 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
| 456 | 458 |
| 457 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 459 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
| 458 }; | 460 }; |
| 459 | 461 |
| 460 } // namespace guest_view | 462 } // namespace guest_view |
| 461 | 463 |
| 462 #endif // COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ | 464 #endif // COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ |
| OLD | NEW |