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 EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CONTA
INER_H_ | 5 #ifndef EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CONTA
INER_H_ |
6 #define EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CONTA
INER_H_ | 6 #define EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CONTA
INER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "extensions/renderer/guest_view/guest_view_container.h" | 13 #include "extensions/renderer/guest_view/guest_view_container.h" |
14 #include "extensions/renderer/scoped_persistent.h" | |
15 #include "third_party/WebKit/public/platform/WebURLLoader.h" | 14 #include "third_party/WebKit/public/platform/WebURLLoader.h" |
16 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" | 15 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" |
17 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
18 #include "url/gurl.h" | 17 #include "url/gurl.h" |
19 #include "v8/include/v8.h" | 18 #include "v8/include/v8.h" |
20 | 19 |
21 namespace extensions { | 20 namespace extensions { |
22 | 21 |
23 // A container for loading up an extension inside a BrowserPlugin to handle a | 22 // A container for loading up an extension inside a BrowserPlugin to handle a |
24 // MIME type. A request for the URL of the data to load inside the container is | 23 // MIME type. A request for the URL of the data to load inside the container is |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 GURL original_url_; | 96 GURL original_url_; |
98 | 97 |
99 // The RenderView routing ID of the guest. | 98 // The RenderView routing ID of the guest. |
100 int guest_proxy_routing_id_; | 99 int guest_proxy_routing_id_; |
101 | 100 |
102 // A URL loader to load the |original_url_| when the plugin is embedded. In | 101 // A URL loader to load the |original_url_| when the plugin is embedded. In |
103 // the embedded case, no URL request is made automatically. | 102 // the embedded case, no URL request is made automatically. |
104 scoped_ptr<blink::WebURLLoader> loader_; | 103 scoped_ptr<blink::WebURLLoader> loader_; |
105 | 104 |
106 // The scriptable object that backs the plugin. | 105 // The scriptable object that backs the plugin. |
107 ScopedPersistent<v8::Object> scriptable_object_; | 106 v8::UniquePersistent<v8::Object> scriptable_object_; |
108 | 107 |
109 // Pending postMessage messages that need to be sent to the guest. These are | 108 // Pending postMessage messages that need to be sent to the guest. These are |
110 // queued while the guest is loading and once it is fully loaded they are | 109 // queued while the guest is loading and once it is fully loaded they are |
111 // delivered so that messages aren't lost. | 110 // delivered so that messages aren't lost. |
112 std::vector<linked_ptr<ScopedPersistent<v8::Value>>> pending_messages_; | 111 std::vector<linked_ptr<v8::UniquePersistent<v8::Value>>> pending_messages_; |
113 | 112 |
114 // True if the guest page has fully loaded and its JavaScript onload function | 113 // True if the guest page has fully loaded and its JavaScript onload function |
115 // has been called. | 114 // has been called. |
116 bool guest_loaded_; | 115 bool guest_loaded_; |
117 | 116 |
118 // The size of the element. | 117 // The size of the element. |
119 gfx::Size element_size_; | 118 gfx::Size element_size_; |
120 | 119 |
121 base::WeakPtrFactory<MimeHandlerViewContainer> weak_factory_; | 120 base::WeakPtrFactory<MimeHandlerViewContainer> weak_factory_; |
122 | 121 |
123 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewContainer); | 122 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewContainer); |
124 }; | 123 }; |
125 | 124 |
126 } // namespace extensions | 125 } // namespace extensions |
127 | 126 |
128 #endif // EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CO
NTAINER_H_ | 127 #endif // EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CO
NTAINER_H_ |
OLD | NEW |