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

Unified Diff: content/renderer/shared_worker_repository.cc

Issue 133093003: Move the worker script loading code to the worker process (phase:4/5) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@02ScriptLoadInWorkerChrome
Patch Set: change comments in worker_webapplicationcachehost_impl.h and rebase. Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/shared_worker_repository.cc
diff --git a/content/renderer/shared_worker_repository.cc b/content/renderer/shared_worker_repository.cc
index 5f4fabf708d1c65c41cf350f10b0ec417e339b24..29dacfd331a70031b9b5fe6d9dc3934ae4a6071e 100644
--- a/content/renderer/shared_worker_repository.cc
+++ b/content/renderer/shared_worker_repository.cc
@@ -8,6 +8,7 @@
#include "content/common/view_messages.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/websharedworker_proxy.h"
+#include "third_party/WebKit/public/web/WebContentSecurityPolicy.h"
#include "third_party/WebKit/public/web/WebFrame.h"
namespace content {
@@ -27,8 +28,6 @@ SharedWorkerRepository::createSharedWorkerConnector(
const blink::WebString& content_security_policy,
blink::WebContentSecurityPolicyType security_policy_type) {
int route_id = MSG_ROUTING_NONE;
- bool exists = false;
- bool url_mismatch = false;
ViewHostMsg_CreateWorker_Params params;
params.url = url;
params.name = name;
@@ -36,16 +35,12 @@ SharedWorkerRepository::createSharedWorkerConnector(
params.security_policy_type = security_policy_type;
params.document_id = document_id;
params.render_frame_route_id = render_frame()->GetRoutingID();
- params.route_id = MSG_ROUTING_NONE;
- params.script_resource_appcache_id = 0;
- Send(new ViewHostMsg_LookupSharedWorker(
- params, &exists, &route_id, &url_mismatch));
- if (url_mismatch)
+ Send(new ViewHostMsg_CreateWorker(params, &route_id));
+ if (route_id == MSG_ROUTING_NONE)
return NULL;
documents_with_workers_.insert(document_id);
return new WebSharedWorkerProxy(ChildThread::current(),
document_id,
- exists,
route_id,
params.render_frame_route_id);
}

Powered by Google App Engine
This is Rietveld 408576698