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

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

Issue 339593005: Set the target type when creating the request for main resource (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Switched to constructors Created 6 years, 6 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
« no previous file with comments | « Source/web/FrameLoaderClientImpl.cpp ('k') | Source/web/WebLocalFrameImpl.cpp » ('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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 m_mainFrame = WebLocalFrame::create(this); 274 m_mainFrame = WebLocalFrame::create(this);
275 m_webView->setMainFrame(m_mainFrame); 275 m_webView->setMainFrame(m_mainFrame);
276 276
277 WebLocalFrameImpl* webFrame = toWebLocalFrameImpl(m_webView->mainFrame()); 277 WebLocalFrameImpl* webFrame = toWebLocalFrameImpl(m_webView->mainFrame());
278 278
279 // Construct substitute data source for the 'shadow page'. We only need it 279 // Construct substitute data source for the 'shadow page'. We only need it
280 // to have same origin as the worker so the loading checks work correctly. 280 // to have same origin as the worker so the loading checks work correctly.
281 CString content(""); 281 CString content("");
282 int length = static_cast<int>(content.length()); 282 int length = static_cast<int>(content.length());
283 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length)); 283 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length));
284 webFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(m_worke rStartData.scriptURL), SubstituteData(buffer, "text/html", "UTF-8", KURL()))); 284 ResourceRequest request = ResourceRequest(m_workerStartData.scriptURL, !webF rame->parent());
285 webFrame->frame()->loader().load(FrameLoadRequest(0, request, SubstituteData (buffer, "text/html", "UTF-8", KURL())));
285 } 286 }
286 287
287 void WebEmbeddedWorkerImpl::willSendRequest( 288 void WebEmbeddedWorkerImpl::willSendRequest(
288 WebLocalFrame* frame, unsigned, WebURLRequest& request, 289 WebLocalFrame* frame, unsigned, WebURLRequest& request,
289 const WebURLResponse& redirectResponse) 290 const WebURLResponse& redirectResponse)
290 { 291 {
291 if (m_networkProvider) 292 if (m_networkProvider)
292 m_networkProvider->willSendRequest(frame->dataSource(), request); 293 m_networkProvider->willSendRequest(frame->dataSource(), request);
293 } 294 }
294 295
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 m_mainScriptLoader.clear(); 354 m_mainScriptLoader.clear();
354 355
355 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW ebLocalFrameImpl(m_mainFrame)->frame()->document(), *m_workerContextClient); 356 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW ebLocalFrameImpl(m_mainFrame)->frame()->document(), *m_workerContextClient);
356 m_loaderProxy = LoaderProxy::create(*this); 357 m_loaderProxy = LoaderProxy::create(*this);
357 358
358 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release()); 359 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release());
359 m_workerThread->start(); 360 m_workerThread->start();
360 } 361 }
361 362
362 } // namespace blink 363 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/FrameLoaderClientImpl.cpp ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698