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

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

Issue 2874133002: Removed WebFrameClient.cpp from Source/web (Closed)
Patch Set: Created 3 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 /* 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // Construct substitute data source for the 'shadow page'. We only need it 166 // Construct substitute data source for the 'shadow page'. We only need it
167 // to have same origin as the worker so the loading checks work correctly. 167 // to have same origin as the worker so the loading checks work correctly.
168 CString content(""); 168 CString content("");
169 RefPtr<SharedBuffer> buffer( 169 RefPtr<SharedBuffer> buffer(
170 SharedBuffer::Create(content.data(), content.length())); 170 SharedBuffer::Create(content.data(), content.length()));
171 main_frame_->GetFrame()->Loader().Load( 171 main_frame_->GetFrame()->Loader().Load(
172 FrameLoadRequest(0, ResourceRequest(url_), 172 FrameLoadRequest(0, ResourceRequest(url_),
173 SubstituteData(buffer, "text/html", "UTF-8", KURL()))); 173 SubstituteData(buffer, "text/html", "UTF-8", KURL())));
174 } 174 }
175 175
176 void WebSharedWorkerImpl::FrameDetached(WebLocalFrame* frame, DetachType type) {
177 if (type == DetachType::kRemove && frame->Parent())
178 frame->Parent()->RemoveChild(frame);
179
180 if (frame->FrameWidget())
181 frame->FrameWidget()->Close();
182
183 frame->Close();
184 }
185
176 void WebSharedWorkerImpl::DidFinishDocumentLoad() { 186 void WebSharedWorkerImpl::DidFinishDocumentLoad() {
177 DCHECK(IsMainThread()); 187 DCHECK(IsMainThread());
178 DCHECK(!loading_document_); 188 DCHECK(!loading_document_);
179 DCHECK(!main_script_loader_); 189 DCHECK(!main_script_loader_);
180 main_frame_->DataSource()->SetServiceWorkerNetworkProvider( 190 main_frame_->DataSource()->SetServiceWorkerNetworkProvider(
181 client_->CreateServiceWorkerNetworkProvider()); 191 client_->CreateServiceWorkerNetworkProvider());
182 main_script_loader_ = WorkerScriptLoader::Create(); 192 main_script_loader_ = WorkerScriptLoader::Create();
183 main_script_loader_->SetRequestContext( 193 main_script_loader_->SetRequestContext(
184 WebURLRequest::kRequestContextSharedWorker); 194 WebURLRequest::kRequestContextSharedWorker);
185 loading_document_ = main_frame_->GetFrame()->GetDocument(); 195 loading_document_ = main_frame_->GetFrame()->GetDocument();
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 if (devtools_agent) 438 if (devtools_agent)
429 devtools_agent->DispatchOnInspectorBackend(session_id, call_id, method, 439 devtools_agent->DispatchOnInspectorBackend(session_id, call_id, method,
430 message); 440 message);
431 } 441 }
432 442
433 WebSharedWorker* WebSharedWorker::Create(WebSharedWorkerClient* client) { 443 WebSharedWorker* WebSharedWorker::Create(WebSharedWorkerClient* client) {
434 return new WebSharedWorkerImpl(client); 444 return new WebSharedWorkerImpl(client);
435 } 445 }
436 446
437 } // namespace blink 447 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698