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

Side by Side Diff: Source/web/WebEmbeddedWorkerImpl.cpp

Issue 232133004: Split WebLocalFrame into a distinct subclass of WebFrame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix Mac Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/web/WebFrameImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 void WebEmbeddedWorkerImpl::prepareShadowPageForLoader() 186 void WebEmbeddedWorkerImpl::prepareShadowPageForLoader()
187 { 187 {
188 // Create 'shadow page', which is never displayed and is used mainly to 188 // Create 'shadow page', which is never displayed and is used mainly to
189 // provide a context for loading on the main thread. 189 // provide a context for loading on the main thread.
190 // 190 //
191 // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader. 191 // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader.
192 // This code, and probably most of the code in this class should be shared 192 // This code, and probably most of the code in this class should be shared
193 // with SharedWorker. 193 // with SharedWorker.
194 ASSERT(!m_webView); 194 ASSERT(!m_webView);
195 m_webView = WebView::create(0); 195 m_webView = WebView::create(0);
196 m_mainFrame = WebFrame::create(this); 196 m_mainFrame = WebLocalFrame::create(this);
197 m_webView->setMainFrame(m_mainFrame); 197 m_webView->setMainFrame(m_mainFrame);
198 198
199 WebFrameImpl* webFrame = toWebFrameImpl(m_webView->mainFrame()); 199 WebFrameImpl* webFrame = toWebFrameImpl(m_webView->mainFrame());
200 200
201 // Construct substitute data source for the 'shadow page'. We only need it 201 // Construct substitute data source for the 'shadow page'. We only need it
202 // to have same origin as the worker so the loading checks work correctly. 202 // to have same origin as the worker so the loading checks work correctly.
203 CString content(""); 203 CString content("");
204 int length = static_cast<int>(content.length()); 204 int length = static_cast<int>(content.length());
205 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length)); 205 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length));
206 webFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(m_worke rStartData.scriptURL), SubstituteData(buffer, "text/html", "UTF-8", KURL()))); 206 webFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(m_worke rStartData.scriptURL), SubstituteData(buffer, "text/html", "UTF-8", KURL())));
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 m_mainScriptLoader.clear(); 265 m_mainScriptLoader.clear();
266 266
267 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW ebFrameImpl(m_mainFrame)->frame()->document(), *contextClient); 267 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW ebFrameImpl(m_mainFrame)->frame()->document(), *contextClient);
268 m_loaderProxy = LoaderProxy::create(*this); 268 m_loaderProxy = LoaderProxy::create(*this);
269 269
270 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release()); 270 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release());
271 m_workerThread->start(); 271 m_workerThread->start();
272 } 272 }
273 273
274 } // namespace blink 274 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/web/WebFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698