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

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

Issue 31063004: Have Frame::loader() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 | « Source/web/WebPluginContainerImpl.cpp ('k') | Source/web/WebViewImpl.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 m_mainFrame = WebFrame::create(this); 131 m_mainFrame = WebFrame::create(this);
132 m_webView->setMainFrame(m_mainFrame); 132 m_webView->setMainFrame(m_mainFrame);
133 133
134 WebFrameImpl* webFrame = toWebFrameImpl(m_webView->mainFrame()); 134 WebFrameImpl* webFrame = toWebFrameImpl(m_webView->mainFrame());
135 135
136 // Construct substitute data source for the 'shadow page'. We only need it 136 // Construct substitute data source for the 'shadow page'. We only need it
137 // to have same origin as the worker so the loading checks work correctly. 137 // to have same origin as the worker so the loading checks work correctly.
138 CString content(""); 138 CString content("");
139 int length = static_cast<int>(content.length()); 139 int length = static_cast<int>(content.length());
140 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length)); 140 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length));
141 webFrame->frame()->loader()->load(FrameLoadRequest(0, ResourceRequest(url), SubstituteData(buffer, "text/html", "UTF-8", KURL()))); 141 webFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(url), S ubstituteData(buffer, "text/html", "UTF-8", KURL())));
142 142
143 // This document will be used as 'loading context' for the worker. 143 // This document will be used as 'loading context' for the worker.
144 m_loadingDocument = webFrame->frame()->document(); 144 m_loadingDocument = webFrame->frame()->document();
145 } 145 }
146 146
147 void WebSharedWorkerImpl::didCreateDataSource(WebFrame*, WebDataSource* ds) 147 void WebSharedWorkerImpl::didCreateDataSource(WebFrame*, WebDataSource* ds)
148 { 148 {
149 // Tell the loader to load the data into the 'shadow page' synchronously, 149 // Tell the loader to load the data into the 'shadow page' synchronously,
150 // so we can grab the resulting Document right after load. 150 // so we can grab the resulting Document right after load.
151 static_cast<WebDataSourceImpl*>(ds)->setDeferMainResourceDataLoad(false); 151 static_cast<WebDataSourceImpl*>(ds)->setDeferMainResourceDataLoad(false);
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 workerThread()->runLoop().postTaskForMode(createCallbackTask(dispatchOnInspe ctorBackendTask, String(message)), WorkerDebuggerAgent::debuggerTaskMode); 360 workerThread()->runLoop().postTaskForMode(createCallbackTask(dispatchOnInspe ctorBackendTask, String(message)), WorkerDebuggerAgent::debuggerTaskMode);
361 WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(workerThread()); 361 WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(workerThread());
362 } 362 }
363 363
364 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) 364 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client)
365 { 365 {
366 return new WebSharedWorkerImpl(client); 366 return new WebSharedWorkerImpl(client);
367 } 367 }
368 368
369 } // namespace WebKit 369 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/WebPluginContainerImpl.cpp ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698