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

Side by Side Diff: extensions/browser/extension_web_contents_observer.cc

Issue 1880933002: Begin to enable extension APIs in Extension Service Worker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync @tott Created 4 years, 7 months 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 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/extension_web_contents_observer.h" 5 #include "extensions/browser/extension_web_contents_observer.h"
6 6
7 #include "content/public/browser/child_process_security_policy.h" 7 #include "content/public/browser/child_process_security_policy.h"
8 #include "content/public/browser/navigation_details.h" 8 #include "content/public/browser/navigation_details.h"
9 #include "content/public/browser/render_frame_host.h" 9 #include "content/public/browser/render_frame_host.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 264
265 if (!site.SchemeIs(kExtensionScheme)) 265 if (!site.SchemeIs(kExtensionScheme))
266 return std::string(); 266 return std::string();
267 267
268 return site.host(); 268 return site.host();
269 } 269 }
270 270
271 void ExtensionWebContentsObserver::OnRequest( 271 void ExtensionWebContentsObserver::OnRequest(
272 content::RenderFrameHost* render_frame_host, 272 content::RenderFrameHost* render_frame_host,
273 const ExtensionHostMsg_Request_Params& params) { 273 const ExtensionHostMsg_Request_Params& params) {
274 dispatcher_.Dispatch(params, render_frame_host); 274 dispatcher_.Dispatch(params, render_frame_host,
275 render_frame_host->GetProcess()->GetID());
275 } 276 }
276 277
277 void ExtensionWebContentsObserver::InitializeFrameHelper( 278 void ExtensionWebContentsObserver::InitializeFrameHelper(
278 content::RenderFrameHost* render_frame_host) { 279 content::RenderFrameHost* render_frame_host) {
279 // Since this is called for all existing RenderFrameHosts during the 280 // Since this is called for all existing RenderFrameHosts during the
280 // ExtensionWebContentsObserver's creation, it's possible that not all hosts 281 // ExtensionWebContentsObserver's creation, it's possible that not all hosts
281 // are ready. 282 // are ready.
282 // We only initialize the frame if the renderer counterpart is live; otherwise 283 // We only initialize the frame if the renderer counterpart is live; otherwise
283 // we wait for the RenderFrameCreated notification. 284 // we wait for the RenderFrameCreated notification.
284 if (render_frame_host->IsRenderFrameLive()) 285 if (render_frame_host->IsRenderFrameLive())
285 InitializeRenderFrame(render_frame_host); 286 InitializeRenderFrame(render_frame_host);
286 } 287 }
287 288
288 } // namespace extensions 289 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extension_service_worker_message_filter.cc ('k') | extensions/common/extension_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698