Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Side by Side Diff: extensions/renderer/extension_frame_helper.h

Issue 1433343003: [Extensions] Wait until the Window object is cleared before classifying contexts Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_EXTENSION_FRAME_HELPER_H_ 5 #ifndef EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_
6 #define EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_ 6 #define EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_vector.h"
10 #include "content/public/common/console_message_level.h" 11 #include "content/public/common/console_message_level.h"
11 #include "content/public/renderer/render_frame_observer.h" 12 #include "content/public/renderer/render_frame_observer.h"
12 #include "content/public/renderer/render_frame_observer_tracker.h" 13 #include "content/public/renderer/render_frame_observer_tracker.h"
13 #include "extensions/common/view_type.h" 14 #include "extensions/common/view_type.h"
14 15
15 struct ExtensionMsg_ExternalConnectionInfo; 16 struct ExtensionMsg_ExternalConnectionInfo;
16 struct ExtensionMsg_TabConnectionInfo; 17 struct ExtensionMsg_TabConnectionInfo;
17 18
18 namespace base { 19 namespace base {
19 class ListValue; 20 class ListValue;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // RenderFrameObserver implementation. 65 // RenderFrameObserver implementation.
65 void DidCreateDocumentElement() override; 66 void DidCreateDocumentElement() override;
66 void DidCreateNewDocument() override; 67 void DidCreateNewDocument() override;
67 void DidMatchCSS( 68 void DidMatchCSS(
68 const blink::WebVector<blink::WebString>& newly_matching_selectors, 69 const blink::WebVector<blink::WebString>& newly_matching_selectors,
69 const blink::WebVector<blink::WebString>& stopped_matching_selectors) 70 const blink::WebVector<blink::WebString>& stopped_matching_selectors)
70 override; 71 override;
71 void DidCreateScriptContext(v8::Local<v8::Context>, 72 void DidCreateScriptContext(v8::Local<v8::Context>,
72 int extension_group, 73 int extension_group,
73 int world_id) override; 74 int world_id) override;
75 void DidClearWindowObject() override;
74 void WillReleaseScriptContext(v8::Local<v8::Context>, int world_id) override; 76 void WillReleaseScriptContext(v8::Local<v8::Context>, int world_id) override;
75 bool OnMessageReceived(const IPC::Message& message) override; 77 bool OnMessageReceived(const IPC::Message& message) override;
78 void DidStartProvisionalLoad() override;
76 79
77 // IPC handlers. 80 // IPC handlers.
78 void OnExtensionDispatchOnConnect( 81 void OnExtensionDispatchOnConnect(
79 int target_port_id, 82 int target_port_id,
80 const std::string& channel_name, 83 const std::string& channel_name,
81 const ExtensionMsg_TabConnectionInfo& source, 84 const ExtensionMsg_TabConnectionInfo& source,
82 const ExtensionMsg_ExternalConnectionInfo& info, 85 const ExtensionMsg_ExternalConnectionInfo& info,
83 const std::string& tls_channel_id); 86 const std::string& tls_channel_id);
84 void OnExtensionDeliverMessage(int target_port_id, 87 void OnExtensionDeliverMessage(int target_port_id,
85 const Message& message); 88 const Message& message);
86 void OnExtensionDispatchOnDisconnect(int port_id, 89 void OnExtensionDispatchOnDisconnect(int port_id,
87 const std::string& error_message); 90 const std::string& error_message);
88 void OnExtensionSetTabId(int tab_id); 91 void OnExtensionSetTabId(int tab_id);
89 void OnUpdateBrowserWindowId(int browser_window_id); 92 void OnUpdateBrowserWindowId(int browser_window_id);
90 void OnNotifyRendererViewType(ViewType view_type); 93 void OnNotifyRendererViewType(ViewType view_type);
91 void OnExtensionResponse(int request_id, 94 void OnExtensionResponse(int request_id,
92 bool success, 95 bool success,
93 const base::ListValue& response, 96 const base::ListValue& response,
94 const std::string& error); 97 const std::string& error);
95 void OnExtensionMessageInvoke(const std::string& extension_id, 98 void OnExtensionMessageInvoke(const std::string& extension_id,
96 const std::string& module_name, 99 const std::string& module_name,
97 const std::string& function_name, 100 const std::string& function_name,
98 const base::ListValue& args, 101 const base::ListValue& args,
99 bool user_gesture); 102 bool user_gesture);
100 103
104 struct PendingContext;
105 ScopedVector<PendingContext> pending_contexts_;
dcheng 2015/11/13 00:26:34 std::vector<scoped_ptr<PendingContext>>? =)
Devlin 2015/11/16 22:46:45 Yay for c++11 support!
106
107 bool did_clear_window_;
108
101 // Type of view associated with the RenderFrame. 109 // Type of view associated with the RenderFrame.
102 ViewType view_type_; 110 ViewType view_type_;
103 111
104 // The id of the tab the render frame is attached to. 112 // The id of the tab the render frame is attached to.
105 int tab_id_; 113 int tab_id_;
106 114
107 // The id of the browser window the render frame is attached to. 115 // The id of the browser window the render frame is attached to.
108 int browser_window_id_; 116 int browser_window_id_;
109 117
110 Dispatcher* extension_dispatcher_; 118 Dispatcher* extension_dispatcher_;
111 119
112 // Whether or not the current document element has been created. 120 // Whether or not the current document element has been created.
113 bool did_create_current_document_element_; 121 bool did_create_current_document_element_;
114 122
115 DISALLOW_COPY_AND_ASSIGN(ExtensionFrameHelper); 123 DISALLOW_COPY_AND_ASSIGN(ExtensionFrameHelper);
116 }; 124 };
117 125
118 } // namespace extensions 126 } // namespace extensions
119 127
120 #endif // EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_ 128 #endif // EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698