Index: extensions/renderer/guest_view/guest_view_container.h |
diff --git a/extensions/renderer/guest_view/guest_view_container.h b/extensions/renderer/guest_view/guest_view_container.h |
index d891775c94c90f162512625eac67485d46e56f16..a307a1bb23324c084f8220522457f658ae86217d 100644 |
--- a/extensions/renderer/guest_view/guest_view_container.h |
+++ b/extensions/renderer/guest_view/guest_view_container.h |
@@ -5,98 +5,32 @@ |
#ifndef CHROME_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ |
Fady Samuel
2014/11/03 11:03:38
EXTENSIONS_RENDERER_GUEST_VIEW_CONTAINER_H_
raymes
2014/11/03 22:51:31
Done.
|
#define CHROME_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ |
-#include <queue> |
- |
-#include "base/memory/linked_ptr.h" |
-#include "base/memory/scoped_ptr.h" |
-#include "base/values.h" |
#include "content/public/renderer/browser_plugin_delegate.h" |
#include "content/public/renderer/render_frame_observer.h" |
-#include "extensions/renderer/scoped_persistent.h" |
+#include "ipc/ipc_message.h" |
namespace extensions { |
class GuestViewContainer : public content::BrowserPluginDelegate, |
public content::RenderFrameObserver { |
public: |
- // This class represents an AttachGuest request from Javascript. It includes |
- // the input parameters and the callback function. The Attach operation may |
- // not execute immediately, if the container is not ready or if there are |
- // other attach operations in flight. |
- class AttachRequest { |
- public: |
- AttachRequest(int element_instance_id, |
- int guest_instance_id, |
- scoped_ptr<base::DictionaryValue> params, |
- v8::Handle<v8::Function> callback, |
- v8::Isolate* isolate); |
- ~AttachRequest(); |
- |
- int element_instance_id() const { return element_instance_id_; } |
- |
- int guest_instance_id() const { return guest_instance_id_; } |
- |
- base::DictionaryValue* attach_params() const { |
- return params_.get(); |
- } |
- |
- bool HasCallback() const; |
- |
- v8::Handle<v8::Function> GetCallback() const; |
- |
- v8::Isolate* isolate() const { return isolate_; } |
- |
- private: |
- const int element_instance_id_; |
- const int guest_instance_id_; |
- scoped_ptr<base::DictionaryValue> params_; |
- ScopedPersistent<v8::Function> callback_; |
- v8::Isolate* const isolate_; |
- }; |
- |
- GuestViewContainer(content::RenderFrame* render_frame, |
- const std::string& mime_type); |
+ explicit GuestViewContainer(content::RenderFrame* render_frame); |
~GuestViewContainer() override; |
- static GuestViewContainer* FromID(int render_view_routing_id, |
- int element_instance_id); |
- |
- void AttachGuest(linked_ptr<AttachRequest> request); |
- |
// BrowserPluginDelegate implementation. |
void SetElementInstanceID(int element_instance_id) override; |
- void DidFinishLoading() override; |
- void DidReceiveData(const char* data, int data_length) override; |
- void Ready() override; |
// RenderFrameObserver override. |
void OnDestruct() override; |
bool OnMessageReceived(const IPC::Message& message) override; |
- private: |
- void OnCreateMimeHandlerViewGuestACK(int element_instance_id); |
- void OnGuestAttached(int element_instance_id, int guest_proxy_routing_id); |
- |
- void AttachGuestInternal(linked_ptr<AttachRequest> request); |
- void EnqueueAttachRequest(linked_ptr<AttachRequest> request); |
- void PerformPendingAttachRequest(); |
- void HandlePendingResponseCallback(int guest_proxy_routing_id); |
+ virtual bool HandlesMessage(const IPC::Message& message) = 0; |
+ virtual bool OnMessage(const IPC::Message& message) = 0; |
- static bool ShouldHandleMessage(const IPC::Message& mesage); |
- |
- const std::string mime_type_; |
+ protected: |
int element_instance_id_; |
- std::string html_string_; |
- // Save the RenderView RoutingID here so that we can use it during |
- // destruction. |
int render_view_routing_id_; |
- bool attached_; |
- bool ready_; |
- |
- std::deque<linked_ptr<AttachRequest> > pending_requests_; |
- linked_ptr<AttachRequest> pending_response_; |
- |
DISALLOW_COPY_AND_ASSIGN(GuestViewContainer); |
}; |